1 // This is a part of the Active Template Library.
2 // Copyright (C) Microsoft Corporation
3 // All rights reserved.
5 // This source code is only intended as a supplement to the
6 // Active Template Library Reference and related
7 // electronic documentation provided with the library.
8 // See these sources for detailed information regarding the
9 // Active Template Library product.
11 #ifndef __ATLSIFACE_H__
12 #define __ATLSIFACE_H__
22 #pragma pack(push,_ATL_PACKING)
25 // Forward declarations of custom data types used in
26 // interfaces declared in this file.
27 struct AtlServerRequest
;
29 __interface IAtlMemMgr
;
32 // Forward declarations of all interfaces declared in this file.
33 __interface IWriteStream
;
34 __interface IHttpFile
;
35 __interface IHttpServerContext
;
36 __interface IHttpRequestLookup
;
37 __interface IRequestHandler
;
38 __interface ITagReplacer
;
39 __interface IIsapiExtension
;
40 __interface IPageCacheControl
;
41 __interface IRequestStats
;
42 __interface IBrowserCaps
;
43 __interface IBrowserCapsSvc
;
46 // ATLS Interface declarations.
49 // Interface for writing to a stream.
50 __interface IWriteStream
52 HRESULT
WriteStream(LPCSTR szOut
, int nLen
, DWORD
*pdwWritten
);
53 HRESULT
FlushStream();
57 // This is an interface that provides for basic accessor
58 // functionality for files (see CHttpRequestFile).
61 LPCSTR
GetParamName();
63 LPCSTR
GetFullFileName();
64 LPCSTR
GetContentType();
65 LPCSTR
GetTempFileName();
66 ULONGLONG
GetFileSize();
71 // This interface encapsulates the capabilities of the web server and provides information about
72 // the current request being handled. See CServerContext for implementation.
73 __interface ATL_NO_VTABLE
__declspec(uuid("813F3F00-3881-11d3-977B-00C04F8EE25E"))
74 IHttpServerContext
: public IUnknown
76 HRESULT STDMETHODCALLTYPE
QueryInterface(REFIID riid
, void **ppv
);
77 ULONG STDMETHODCALLTYPE
AddRef();
78 ULONG STDMETHODCALLTYPE
Release();
80 LPCSTR
GetRequestMethod();
81 LPCSTR
GetQueryString();
83 LPCSTR
GetPathTranslated();
84 LPCSTR
GetScriptPathTranslated();
85 DWORD
GetTotalBytes();
86 DWORD
GetAvailableBytes();
87 BYTE
*GetAvailableData();
88 LPCSTR
GetContentType();
89 BOOL
GetServerVariable(__in_z LPCSTR pszVariableName
,
90 __out_ecount_part_opt(*pdwSize
, *pdwSize
) LPSTR pvBuffer
, __inout DWORD
*pdwSize
);
91 BOOL
GetImpersonationToken(HANDLE
* pToken
);
92 BOOL
WriteClient(void *pvBuffer
, DWORD
*pdwBytes
);
93 BOOL
AsyncWriteClient(void *pvBuffer
, DWORD
*pdwBytes
);
94 BOOL
ReadClient(void *pvBuffer
, DWORD
*pdwSize
);
95 BOOL
AsyncReadClient(void *pvBuffer
, DWORD
*pdwSize
);
96 BOOL
SendRedirectResponse(LPCSTR pszRedirectUrl
);
97 BOOL
SendResponseHeader(LPCSTR pszHeader
, LPCSTR pszStatusCode
,
99 BOOL
DoneWithSession(DWORD dwHttpStatusCode
);
100 BOOL
RequestIOCompletion(PFN_HSE_IO_COMPLETION pfn
, DWORD
*pdwContext
);
101 BOOL
TransmitFile(HANDLE hFile
, PFN_HSE_IO_COMPLETION pfn
, void *pContext
,
102 LPCSTR szStatusCode
, DWORD dwBytesToWrite
, DWORD dwOffset
,
103 void *pvHead
, DWORD dwHeadLen
, void *pvTail
,
104 DWORD dwTailLen
, DWORD dwFlags
);
105 BOOL
AppendToLog(LPCSTR szMessage
, DWORD
* pdwLen
);
106 BOOL
MapUrlToPathEx(LPCSTR szLogicalPath
, DWORD dwLen
, HSE_URL_MAPEX_INFO
*pumInfo
);
109 // IHttpRequestLookup
110 // This interface is designed to allow one map to chain to another map.
111 // The interface is implemented by the CHttpThunkMap and CHttpRequest classes.
112 // Pointers to this interface are passed around by CRequestHandlerT and CHtmlTagReplacer.
113 // dwType - the type of item being requested
114 __interface ATL_NO_VTABLE
__declspec(uuid("A5990B44-FF74-4bfe-B66D-F9E7E9F42D42"))
115 IHttpRequestLookup
: public IUnknown
117 POSITION
GetFirstQueryParam(LPCSTR
*ppszName
, LPCSTR
*ppszValue
);
118 POSITION
GetNextQueryParam(POSITION pos
, LPCSTR
*ppszName
, LPCSTR
*ppszValue
);
120 POSITION
GetFirstFormVar(LPCSTR
*ppszName
, LPCSTR
*ppszValue
);
121 POSITION
GetNextFormVar(POSITION pos
, LPCSTR
*ppszName
, LPCSTR
*ppszValue
);
123 POSITION
GetFirstFile(LPCSTR
*ppszName
, IHttpFile
**ppFile
);
124 POSITION
GetNextFile(POSITION pos
, LPCSTR
*ppszName
, IHttpFile
**ppFile
);
126 HRESULT
GetServerContext(IHttpServerContext
**ppOut
);
131 // This interface is impelemented by clients who want to be request handlers in an
132 // atl server application. Server default implementations are provided in ATL, including
133 // IRequestHandlerImpl (atlisapi.h) and CRequestHandlerT (atlstencil.h)
134 __interface ATL_NO_VTABLE
__declspec(uuid("D57F8D0C-751A-4223-92BC-0B29F65D2453"))
135 IRequestHandler
: public IUnknown
137 HTTP_CODE
GetFlags(DWORD
*pdwStatus
);
138 HTTP_CODE
InitializeHandler(AtlServerRequest
*pRequestInfo
, IServiceProvider
*pProvider
);
139 HTTP_CODE
InitializeChild(AtlServerRequest
*pRequestInfo
, IServiceProvider
*pProvider
, IHttpRequestLookup
*pLookup
);
140 HTTP_CODE
HandleRequest(AtlServerRequest
*pRequestInfo
, IServiceProvider
*pProvider
);
141 void UninitializeHandler();
145 // This interface defines the methods necessary for server response file processing.
146 __interface ATL_NO_VTABLE
__declspec(uuid("8FF5E90C-8CE0-43aa-96C4-3BF930837512"))
147 ITagReplacer
: public IUnknown
149 HTTP_CODE
FindReplacementOffset(LPCSTR szMethodName
, DWORD
*pdwMethodOffset
,
150 LPCSTR szObjectName
, DWORD
*pdwObjOffset
, DWORD
*pdwMap
, void **ppvParam
, IAtlMemMgr
*pMemMgr
);
151 HTTP_CODE
RenderReplacement(DWORD dwFnOffset
, DWORD dwObjOffset
, DWORD dwMap
, void *pvParam
);
152 HRESULT
GetContext(REFIID riid
, void** ppv
);
153 IWriteStream
*SetStream(IWriteStream
*pStream
);
157 struct CStencilState
;
160 // Tnis is the interface to the ISAPI extension of a running ATL Server web
161 // application. Provides request handler clients with access to functions of the
163 __interface
__declspec(uuid("79DD4A27-D820-4fa6-954D-E1DFC2C05978"))
164 IIsapiExtension
: public IUnknown
166 BOOL
DispatchStencilCall(AtlServerRequest
*pRequestInfo
);
167 void RequestComplete(AtlServerRequest
*pRequestInfo
, DWORD hStatus
, DWORD dwSubStatus
);
168 BOOL
OnThreadAttach();
169 void OnThreadTerminate();
170 BOOL
QueueRequest(AtlServerRequest
*pRequestInfo
);
171 CIsapiWorker
*GetThreadWorker();
172 BOOL
SetThreadWorker(CIsapiWorker
*pWorker
);
173 HTTP_CODE
LoadRequestHandler(LPCSTR szDllPath
, LPCSTR szHandlerName
, IHttpServerContext
*pServerContext
,
174 HINSTANCE
*phInstance
, IRequestHandler
**ppHandler
);
175 HRESULT
AddService(REFGUID guidService
, REFIID riid
, IUnknown
*punk
, HINSTANCE hInstance
);
176 HRESULT
RemoveService(REFGUID guidService
, REFIID riid
);
177 HTTP_CODE
LoadDispatchFile(LPCSTR szFileName
, AtlServerRequest
*pRequestInfo
);
179 AtlServerRequest
* CreateRequest();
180 void FreeRequest(AtlServerRequest
* pRequest
);
181 HTTP_CODE
TransferRequest(
182 AtlServerRequest
*pRequest
,
183 IServiceProvider
*pServiceProvider
,
184 IWriteStream
*pWriteStream
,
185 IHttpRequestLookup
*pLookup
,
188 bool bContinueAfterProcess
,
189 CStencilState
*pState
);
193 // This interface controls the cacheability of the current page
194 __interface ATL_NO_VTABLE
__declspec(uuid("9868BFC0-D44D-4154-931C-D186EC0C45D5"))
195 IPageCacheControl
: public IUnknown
197 HRESULT
GetExpiration(FILETIME
*pftExpiration
);
198 HRESULT
SetExpiration(FILETIME ftExpiration
);
200 BOOL
Cache(BOOL bCache
);
204 // Used to query request statistics from a running ATL server ISAPI application.
205 __interface ATL_NO_VTABLE
__declspec(uuid("2B75C68D-0DDF-48d6-B58A-CC7C2387A6F2"))
206 IRequestStats
: public IUnknown
208 long GetTotalRequests();
209 long GetFailedRequests();
210 long GetAvgResponseTime();
211 long GetCurrWaiting();
212 long GetMaxWaiting();
213 long GetActiveThreads();
217 // Interface that provides information about a particular web brorwser.
218 // See atlutil.h and the ATL Browser Capabilities service for information
219 // about this interface's implementation
220 __interface
__declspec(uuid("3339FCE2-99BC-4985-A702-4ABC8304A995"))
221 IBrowserCaps
: public IUnknown
223 HRESULT
GetPropertyString(BSTR bstrProperty
, BSTR
* pbstrOut
);
224 HRESULT
GetBooleanPropertyValue(BSTR bstrProperty
, BOOL
* pbOut
);
225 HRESULT
GetBrowserName(BSTR
* pbstrName
);
226 HRESULT
GetPlatform(BSTR
* pbstrPlatform
);
227 HRESULT
GetVersion(BSTR
* pbstrVersion
);
228 HRESULT
GetMajorVer(BSTR
* pbstrMajorVer
);
229 HRESULT
GetMinorVer(BSTR
* pbstrMinorVer
);
230 HRESULT
SupportsFrames(BOOL
* pbFrames
);
231 HRESULT
SupportsTables(BOOL
* pbTables
);
232 HRESULT
SupportsCookies(BOOL
* pbCookies
);
233 HRESULT
SupportsBackgroundSounds(BOOL
* pbBackgroundSounds
);
234 HRESULT
SupportsVBScript(BOOL
* pbVBScript
);
235 HRESULT
SupportsJavaScript(BOOL
* pbJavaScript
);
236 HRESULT
SupportsJavaApplets(BOOL
* pbJavaApplets
);
237 HRESULT
SupportsActiveXControls(BOOL
* pbActiveXControls
);
238 HRESULT
SupportsCDF(BOOL
* pbCDF
);
239 HRESULT
SupportsAuthenticodeUpdate(BOOL
* pbAuthenticodeUpdate
);
240 HRESULT
IsBeta(BOOL
* pbIsBeta
);
241 HRESULT
IsCrawler(BOOL
* pbIsCrawler
);
242 HRESULT
IsAOL(BOOL
* pbIsAOL
);
243 HRESULT
IsWin16(BOOL
* pbIsWin16
);
244 HRESULT
IsAK(BOOL
* pbIsAK
);
245 HRESULT
IsSK(BOOL
* pbIsSK
);
246 HRESULT
IsUpdate(BOOL
* pbIsUpdate
);
250 // Interface on the browser caps service. Used by clients to query a running
251 // instance of the browser capabilities service for information about a user's web
252 // browser. See atlutil.h for implementation of the browser capabilities services.
253 __interface
__declspec(uuid("391E7418-863B-430e-81BB-1312ED2FF3E9"))
254 IBrowserCapsSvc
: public IUnknown
256 HRESULT
GetCaps(IHttpServerContext
* pContext
, IBrowserCaps
** ppOut
);
257 HRESULT
GetCapsUserAgent(BSTR bstrAgent
, IBrowserCaps
** ppOut
);
260 class CBrowserCapsSvc
: public IBrowserCapsSvc
,
261 public CComObjectRootEx
<CComSingleThreadModel
>
264 virtual ~CBrowserCapsSvc()
268 BEGIN_COM_MAP(CBrowserCapsSvc
)
269 COM_INTERFACE_ENTRY(IBrowserCapsSvc
)
272 __success(SUCCEEDED(return)) __checkReturn HRESULT
GetCaps(__in IHttpServerContext
* pContext
, __deref_out_opt IBrowserCaps
** ppOut
)
282 char szUserAgent
[256];
283 DWORD dwSize
= sizeof(szUserAgent
);
284 if (!pContext
->GetServerVariable("HTTP_USER_AGENT", szUserAgent
, &dwSize
))
287 return GetCapsUserAgent(CComBSTR(szUserAgent
), ppOut
);
290 __success(SUCCEEDED(return)) __checkReturn HRESULT
GetCapsUserAgent(__in BSTR bstrAgent
, __deref_out IBrowserCaps
** ppOut
)
292 if (::SysStringLen(bstrAgent
) == 0 || ppOut
== NULL
)
299 BrowserCaps
* pCaps
= NULL
;
303 CW2CT
szUserAgent(bstrAgent
);
305 if (!m_mapAgent
.Lookup(szUserAgent
, pCaps
))
308 for (size_t i
=0; i
<m_caps
.GetCount(); i
++)
310 BrowserCaps
& caps
= m_caps
[i
];
311 if (IsEqualAgentString(caps
.m_strUserAgent
, szUserAgent
))
324 #pragma warning(push)
325 #pragma warning(disable: 6014)
328 CComObjectNoLock
<CBrowserCaps
> *pRet
= NULL
;
330 ATLTRY(pRet
= new CComObjectNoLock
<CBrowserCaps
>);
333 return E_OUTOFMEMORY
;
336 HRESULT hr
= pRet
->Initialize(pCaps
);
351 __checkReturn HRESULT
Initialize(__in HINSTANCE hInstance
) throw()
353 // tries loading browscap.ini from the same directory as the module
354 if (hInstance
!= NULL
)
358 CPath strBrowscapPath
;
360 LPTSTR sz
= strBrowscapPath
.m_strPath
.GetBuffer(MAX_PATH
);
361 UINT nChars
= ::GetModuleFileName(hInstance
, sz
, MAX_PATH
);
362 strBrowscapPath
.m_strPath
.ReleaseBuffer(nChars
);
364 nChars
!= MAX_PATH
&&
365 strBrowscapPath
.RemoveFileSpec())
367 strBrowscapPath
+= _T("\\browscap.ini");
368 if (SUCCEEDED(Load(strBrowscapPath
)))
378 // falls back to the system browscap.ini if previous Load failed
382 HRESULT
Uninitialize()
389 static bool IsEqualAgentString(__in LPCTSTR szPattern
, __in LPCTSTR szInput
)
391 while (*szPattern
&& *szInput
&& (*szPattern
== *szInput
|| *szPattern
== '?'))
397 if (*szPattern
== *szInput
)
402 if (*szPattern
== '*')
411 if (IsEqualAgentString(szPattern
, szInput
))
423 __checkReturn HRESULT
Load(__in_opt LPCTSTR szPath
= NULL
)
429 CString
strBrowscapPath(szPath
);
431 // use default load path if a path isn't specified
432 if (strBrowscapPath
.IsEmpty())
434 LPTSTR sz
= strBrowscapPath
.GetBuffer(MAX_PATH
);
435 UINT nChars
= ::GetSystemDirectory(sz
, MAX_PATH
);
436 strBrowscapPath
.ReleaseBuffer(nChars
);
437 if (nChars
== 0 || nChars
== MAX_PATH
)
440 strBrowscapPath
+= _T("\\inetsrv\\browscap.ini");
443 size_t nCurrent
= 16384;
444 CHeapPtr
<TCHAR
> data
;
446 if (!data
.Allocate(nCurrent
))
447 return E_OUTOFMEMORY
;
449 // load the list of all the user agents
450 bool bRetrieved
= false;
454 DWORD dwRetrieved
= ::GetPrivateProfileSectionNames(data
, (DWORD
) nCurrent
, strBrowscapPath
);
455 if (dwRetrieved
== 0)
457 return AtlHresultFromWin32(ERROR_FILE_NOT_FOUND
);
459 else if (dwRetrieved
< nCurrent
-2)
463 else if(SIZE_MAX
/2<nCurrent
)
465 return E_OUTOFMEMORY
;
467 else if (!data
.Reallocate(nCurrent
*= 2))
469 return E_OUTOFMEMORY
;
471 } while (!bRetrieved
);
473 // figure out how many user agents there are
474 // and set them in the structure
480 sz
+= (lstrlen(sz
)+1);
483 if (!m_caps
.SetCount(nSections
))
484 return E_OUTOFMEMORY
;
490 BrowserCaps
& caps
= m_caps
[nSections
++];
491 caps
.m_strUserAgent
= sz
;
492 m_mapAgent
[caps
.m_strUserAgent
] = &caps
;
493 sz
+= (caps
.m_strUserAgent
.GetLength()+1);
496 // for each user agent, load the properties
497 for (size_t i
=0; i
<m_caps
.GetCount(); i
++)
500 BrowserCaps
& caps
= m_caps
[i
];
501 caps
.m_pParent
= NULL
;
505 DWORD dwRetrieved
= ::GetPrivateProfileSection(caps
.m_strUserAgent
, data
, (DWORD
) nCurrent
, strBrowscapPath
);
506 if (dwRetrieved
== 0)
508 return AtlHresultFromWin32(ERROR_FILE_NOT_FOUND
);
510 else if (dwRetrieved
< nCurrent
-2)
514 else if(SIZE_MAX
/2<nCurrent
)
516 return E_OUTOFMEMORY
;
518 else if (!data
.Reallocate(nCurrent
*= 2))
520 return E_OUTOFMEMORY
;
522 } while (!bRetrieved
);
528 int nChar
= str
.Find('=');
531 CString strPropName
= str
.Left(nChar
);
532 CString strPropVal
= str
.Mid(nChar
+1);
535 caps
.m_props
.SetAt(strPropName
, strPropVal
);
537 // if it's the parent property, set up the parent pointer
538 if (strPropName
.CompareNoCase(_T("parent")) == 0)
540 BrowserCaps
* pParent
= NULL
;
541 if (m_mapAgent
.Lookup(strPropVal
, pParent
))
542 caps
.m_pParent
= pParent
;
545 sz
+= (str
.GetLength()+1);
560 m_mapAgent
.RemoveAll();
563 friend class CBrowserCaps
;
567 CString m_strUserAgent
; // user agent string to match against (with wildcards)
568 BrowserCaps
* m_pParent
;
569 CAtlMap
<CString
, CString
, CStringElementTraitsI
<CString
>, CStringElementTraits
<CString
> > m_props
;
572 // map from UserAgent string to caps
573 // used for non-wildcard lookup and parent lookup
574 CAtlMap
<CString
, BrowserCaps
*, CStringElementTraits
<CString
> > m_mapAgent
;
577 CAtlArray
<BrowserCaps
> m_caps
;
579 class CBrowserCaps
: public IBrowserCaps
, public CComObjectRootEx
<CComSingleThreadModel
>
583 BEGIN_COM_MAP(CBrowserCaps
)
584 COM_INTERFACE_ENTRY(IBrowserCaps
)
591 HRESULT
Initialize(__in
CBrowserCapsSvc::BrowserCaps
* pCaps
)
597 __checkReturn HRESULT
GetPropertyString(__in BSTR bstrProperty
, __out BSTR
* pbstrOut
)
610 CString
strName(bstrProperty
);
613 CBrowserCapsSvc::BrowserCaps
* pCaps
= m_pCaps
;
616 if (pCaps
->m_props
.Lookup(strName
, strVal
))
618 CComBSTR
bstrVal(strVal
);
619 *pbstrOut
= bstrVal
.Detach();
623 pCaps
= pCaps
->m_pParent
;
634 __checkReturn HRESULT
GetBooleanPropertyValue(__in BSTR bstrProperty
, __out BOOL
* pbOut
)
640 HRESULT hr
= GetPropertyString(bstrProperty
, &bstrOut
);
641 if (FAILED(hr
) || S_FALSE
== hr
)
644 if (_wcsicmp(bstrOut
, L
"true") == 0)
652 __checkReturn HRESULT
GetBrowserName(__out BSTR
* pbstrName
)
654 return GetPropertyString(CComBSTR(L
"browser"), pbstrName
);
657 __checkReturn HRESULT
GetPlatform(__out BSTR
* pbstrPlatform
)
659 return GetPropertyString(CComBSTR(L
"platform"), pbstrPlatform
);
662 __checkReturn HRESULT
GetVersion(__out BSTR
* pbstrVersion
)
664 return GetPropertyString(CComBSTR(L
"version"), pbstrVersion
);
667 __checkReturn HRESULT
GetMajorVer(__out BSTR
* pbstrMajorVer
)
669 return GetPropertyString(CComBSTR(L
"majorver"), pbstrMajorVer
);
672 __checkReturn HRESULT
GetMinorVer(__out BSTR
* pbstrMinorVer
)
674 return GetPropertyString(CComBSTR(L
"minorver"), pbstrMinorVer
);
677 __checkReturn HRESULT
SupportsFrames(__out BOOL
* pbFrames
)
679 return GetBooleanPropertyValue(CComBSTR(L
"frames"), pbFrames
);
682 __checkReturn HRESULT
SupportsTables(__out BOOL
* pbTables
)
684 return GetBooleanPropertyValue(CComBSTR(L
"tables"), pbTables
);
686 __checkReturn HRESULT
SupportsCookies(__out BOOL
* pbCookies
)
688 return GetBooleanPropertyValue(CComBSTR(L
"cookies"), pbCookies
);
690 __checkReturn HRESULT
SupportsBackgroundSounds(__out BOOL
* pbBackgroundSounds
)
692 return GetBooleanPropertyValue(CComBSTR(L
"backgroundsounds"), pbBackgroundSounds
);
694 __checkReturn HRESULT
SupportsVBScript(__out BOOL
* pbVBScript
)
696 return GetBooleanPropertyValue(CComBSTR(L
"vbscript"), pbVBScript
);
698 __checkReturn HRESULT
SupportsJavaScript(__out BOOL
* pbJavaScript
)
700 return GetBooleanPropertyValue(CComBSTR(L
"javascript"), pbJavaScript
);
702 __checkReturn HRESULT
SupportsJavaApplets(__out BOOL
* pbJavaApplets
)
704 return GetBooleanPropertyValue(CComBSTR(L
"javaapplets"), pbJavaApplets
);
706 __checkReturn HRESULT
SupportsActiveXControls(__out BOOL
* pbActiveXControls
)
708 return GetBooleanPropertyValue(CComBSTR(L
"ActiveXControls"), pbActiveXControls
);
710 __checkReturn HRESULT
SupportsCDF(__out BOOL
* pbCDF
)
712 return GetBooleanPropertyValue(CComBSTR(L
"CDF"), pbCDF
);
714 __checkReturn HRESULT
SupportsAuthenticodeUpdate(__out BOOL
* pbAuthenticodeUpdate
)
716 return GetBooleanPropertyValue(CComBSTR(L
"AuthenticodeUpdate"), pbAuthenticodeUpdate
);
718 __checkReturn HRESULT
IsBeta(__out BOOL
* pbIsBeta
)
720 return GetBooleanPropertyValue(CComBSTR(L
"beta"), pbIsBeta
);
722 __checkReturn HRESULT
IsCrawler(__out BOOL
* pbIsCrawler
)
724 return GetBooleanPropertyValue(CComBSTR(L
"Crawler"), pbIsCrawler
);
726 __checkReturn HRESULT
IsAOL(__out BOOL
* pbIsAOL
)
728 return GetBooleanPropertyValue(CComBSTR(L
"AOL"), pbIsAOL
);
730 __checkReturn HRESULT
IsWin16(__out BOOL
* pbIsWin16
)
732 return GetBooleanPropertyValue(CComBSTR(L
"Win16"), pbIsWin16
);
734 __checkReturn HRESULT
IsAK(__out BOOL
* pbIsAK
)
736 return GetBooleanPropertyValue(CComBSTR(L
"AK"), pbIsAK
);
738 __checkReturn HRESULT
IsSK(__out BOOL
* pbIsSK
)
740 return GetBooleanPropertyValue(CComBSTR(L
"SK"), pbIsSK
);
742 __checkReturn HRESULT
IsUpdate(__out BOOL
* pbIsUpdate
)
744 return GetBooleanPropertyValue(CComBSTR(L
"Update"), pbIsUpdate
);
748 CBrowserCapsSvc::BrowserCaps
* m_pCaps
;
752 typedef DWORD_PTR HSESSIONENUM
;
755 // Interface on a single client session. Used to access variables in the client
756 // session in the session state services. See atlsession.h for implementation of
758 __interface
__declspec(uuid("DEB69BE3-7AC9-4a13-9519-266C1EA3AB39"))
759 ISession
: public IUnknown
761 STDMETHOD(SetVariable
)(LPCSTR szName
, VARIANT NewVal
);
762 STDMETHOD(GetVariable
)(LPCSTR szName
, VARIANT
*pVal
);
763 STDMETHOD(GetCount
)(long *pnCount
);
764 STDMETHOD(RemoveVariable
)(LPCSTR szName
);
765 STDMETHOD(RemoveAllVariables
)();
766 STDMETHOD(BeginVariableEnum
)(POSITION
*pPOS
, HSESSIONENUM
*phEnumHandle
);
767 STDMETHOD(GetNextVariable
)(POSITION
*pPOS
, VARIANT
*pVal
, HSESSIONENUM hEnum
, LPSTR szName
, DWORD dwLen
);
768 STDMETHOD(CloseEnum
)(HSESSIONENUM hEnumHandle
);
769 STDMETHOD(IsExpired
)();
770 STDMETHOD(SetTimeout
)(unsigned __int64 dwNewTimeout
);
774 // ISessionStateService
775 // Interface on the session state service for an ISAPI application. Request
776 // handler objects will use this interface to access user sessions. See
777 // atlsession.h for implementation of this interface.
778 __interface
__declspec(uuid("C5740C4F-0C6D-4b43-92C4-2AF778F35DDE"))
779 ISessionStateService
: public IUnknown
781 STDMETHOD(CreateNewSession
)(LPSTR szNewID
, DWORD
*pdwSize
, ISession
** ppSession
);
782 STDMETHOD(CreateNewSessionByName
)(LPSTR szNewID
, ISession
** ppSession
);
783 STDMETHOD(GetSession
)(LPCSTR szID
, ISession
**ppSession
);
784 STDMETHOD(CloseSession
)(LPCSTR szID
);
787 // ISessionStateControl
788 // Interface used by session state service to get information about the service.
789 // Currently you can get the count of active sessions and the current default
790 // timeout for a session.
791 __interface
__declspec(uuid("6C7F5F56-6CBD-49ee-9797-4C837D4C527A"))
792 ISessionStateControl
: public IUnknown
794 STDMETHOD(SetSessionTimeout
)(unsigned __int64 nTimeout
);
795 STDMETHOD(GetSessionTimeout
)(unsigned __int64
*pnTimeout
);
796 STDMETHOD(GetSessionCount
)(DWORD
*pnSessionCount
);
802 #endif // __ATLSIFACE_H__