Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

636 lines
20 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. // This source code is only intended as a supplement to the
  5. // Microsoft Foundation Classes Reference and related
  6. // electronic documentation provided with the library.
  7. // See these sources for detailed information regarding the
  8. // Microsoft Foundation Classes product.
  9. #ifndef __AFXISAPI_H_
  10. #define __AFXISAPI_H_
  11. #ifdef _UNICODE
  12. #error ERROR: ISAPI does not yet support Unicode.
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // Turn off warnings for /W4
  16. // To resume any of these warning: #pragma warning(default: 4xxx)
  17. // which should be placed after the AFX include files
  18. #ifndef ALL_WARNINGS
  19. // warnings generated with common MFC/Windows code
  20. #pragma warning(disable: 4127) // constant expression for TRACE/ASSERT
  21. #pragma warning(disable: 4134) // message map member fxn casts
  22. #pragma warning(disable: 4201) // nameless unions are part of C++
  23. #pragma warning(disable: 4511) // private copy constructors are good to have
  24. #pragma warning(disable: 4512) // private operator= are good to have
  25. #pragma warning(disable: 4514) // unreferenced inlines are common
  26. #pragma warning(disable: 4710) // private constructors are disallowed
  27. #pragma warning(disable: 4705) // statement has no effect in optimized code
  28. #pragma warning(disable: 4191) // pointer-to-function casting
  29. // warnings caused by normal optimizations
  30. #ifndef _DEBUG
  31. #pragma warning(disable: 4701) // local variable *may* be used without init
  32. #pragma warning(disable: 4702) // unreachable code caused by optimizations
  33. #pragma warning(disable: 4791) // loss of debugging info in retail version
  34. #pragma warning(disable: 4189) // initialized but unused variable
  35. #pragma warning(disable: 4390) // empty controlled statement
  36. #endif
  37. // warnings specific to _AFXDLL version
  38. #ifdef _AFXDLL
  39. #pragma warning(disable: 4204) // non-constant aggregate initializer
  40. #endif
  41. #ifdef _AFXDLL
  42. #pragma warning(disable: 4275) // deriving exported class from non-exported
  43. #pragma warning(disable: 4251) // using non-exported as public in exported
  44. #endif
  45. #endif //!ALL_WARNINGS
  46. #define STRICT 1
  47. #ifndef _DEBUG
  48. #ifndef _AFX_ENABLE_INLINES
  49. #define _AFX_ENABLE_INLINES
  50. #endif
  51. #endif
  52. #ifndef _AFX
  53. #include <afxv_cpu.h>
  54. #endif
  55. #include <httpext.h>
  56. #include <httpfilt.h>
  57. #ifndef _INC_STDLIB
  58. #include <stdlib.h>
  59. #endif
  60. #ifndef _INC_TCHAR
  61. #include <tchar.h>
  62. #endif
  63. #ifndef UNUSED
  64. #ifdef _DEBUG
  65. #define UNUSED(x)
  66. #else
  67. #define UNUSED(x) x
  68. #endif
  69. #endif
  70. #define AFXISAPI __stdcall
  71. #define AFXIS_DATADEF
  72. #define AFXISAPI_CDECL __cdecl
  73. #ifndef AFX_INLINE
  74. #if _MSC_VER >= 0x1200
  75. #define AFX_INLINE __forceinline
  76. #else
  77. #define AFX_INLINE inline
  78. #endif
  79. #endif
  80. /////////////////////////////////////////////////////////////////////////////
  81. // Internet Server API Library
  82. #ifndef _AFX_NOFORCE_LIBS
  83. #ifdef _AFXDLL
  84. #ifdef _DEBUG
  85. #ifdef _UNICODE
  86. #pragma comment(lib, "MFCISUD.lib")
  87. #else
  88. #pragma comment(lib, "EAFXISD.lib")
  89. #endif
  90. #else
  91. #ifdef _UNICODE
  92. #pragma comment(lib, "MFCISU.lib")
  93. #else
  94. #pragma comment(lib, "EAFXIS.lib")
  95. #endif // _UNICODE
  96. #endif // _DEBUG
  97. #else
  98. #ifdef _DEBUG
  99. #ifdef _UNICODE
  100. #pragma comment(lib, "UAFXISD.lib")
  101. #else
  102. #pragma comment(lib, "NAFXISD.lib")
  103. #endif
  104. #else
  105. #ifdef _UNICODE
  106. #pragma comment(lib, "UAFXIS.lib")
  107. #else
  108. #pragma comment(lib, "NAFXIS.lib")
  109. #endif // _UNICODE
  110. #endif // _DEBUG
  111. #endif // _AFXDLL
  112. #pragma comment(lib, "kernel32.lib")
  113. #pragma comment(lib, "user32.lib")
  114. #pragma comment(lib, "winspool.lib")
  115. #pragma comment(lib, "advapi32.lib")
  116. #endif // _AFX_NOFORCE_LIBS
  117. extern HINSTANCE AFXISAPI AfxGetResourceHandle();
  118. /////////////////////////////////////////////////////////////////////////////
  119. // AFXIASPI - MFC Internet Server API support
  120. // Classes declared in this file
  121. class CHtmlStream;
  122. class CHttpServerContext;
  123. class CHttpServer;
  124. class CHttpFilterContext;
  125. class CHttpFilter;
  126. // Classes this file uses from elsewhere, sometimes
  127. #ifdef _AFX
  128. class CLongBinary;
  129. class CByteArray;
  130. #endif
  131. ///////////////////////////////////////////////////////////////////////
  132. // CHtmlStream -- manages in-memory HTML
  133. class CHtmlStream
  134. {
  135. public:
  136. // Constructors
  137. CHtmlStream(UINT nGrowBytes = 4096);
  138. CHtmlStream(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
  139. // Operations
  140. void Attach(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
  141. BYTE* Detach();
  142. DWORD GetStreamSize() const;
  143. virtual void Abort();
  144. virtual void Close();
  145. virtual void InitStream();
  146. virtual void Reset();
  147. virtual void Write(const void* lpBuf, UINT nCount);
  148. CHtmlStream& operator<<(LPCTSTR psz);
  149. CHtmlStream& operator<<(short int w);
  150. CHtmlStream& operator<<(long int dw);
  151. CHtmlStream& operator<<(const CHtmlStream& stream);
  152. CHtmlStream& operator<<(double d);
  153. CHtmlStream& operator<<(float f);
  154. #ifdef _AFX
  155. CHtmlStream& operator<<(const CByteArray& array);
  156. CHtmlStream& operator<<(const CLongBinary& blob);
  157. #endif
  158. // Advanced Overridables
  159. protected:
  160. virtual BYTE* Alloc(DWORD nBytes);
  161. virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes);
  162. virtual BYTE* Memcpy(BYTE* lpMemTarget, const BYTE* lpMemSource, UINT nBytes);
  163. virtual void GrowStream(DWORD dwNewLen);
  164. DWORD m_nStreamSize;
  165. public:
  166. virtual void Free(BYTE* lpMem);
  167. // Implementation
  168. protected:
  169. UINT m_nGrowBytes;
  170. DWORD m_nPosition;
  171. DWORD m_nBufferSize;
  172. BYTE* m_lpBuffer;
  173. BOOL m_bAutoDelete;
  174. public:
  175. virtual ~CHtmlStream();
  176. };
  177. ///////////////////////////////////////////////////////////////////////
  178. // Status codes for HTTP transactions
  179. #ifndef _WININET_ // these symbols may come from WININET.H
  180. #define HTTP_STATUS_OK 200 // OK
  181. #define HTTP_STATUS_CREATED 201 // created
  182. #define HTTP_STATUS_ACCEPTED 202 // accepted
  183. #define HTTP_STATUS_NO_CONTENT 204 // no content
  184. #define HTTP_STATUS_REDIRECT 301 // moved permanently
  185. #define HTTP_STATUS_TEMP_REDIRECT 302 // moved temporarily
  186. #define HTTP_STATUS_NOT_MODIFIED 304 // not modified
  187. #define HTTP_STATUS_BAD_REQUEST 400 // bad request
  188. #define HTTP_STATUS_AUTH_REQUIRED 401 // unauthorized
  189. #define HTTP_STATUS_FORBIDDEN 403 // forbidden
  190. #define HTTP_STATUS_NOT_FOUND 404 // not found
  191. #define HTTP_STATUS_SERVER_ERROR 500 // internal server error
  192. #define HTTP_STATUS_NOT_IMPLEMENTED 501 // not implemented
  193. #define HTTP_STATUS_BAD_GATEWAY 502 // bad gateway
  194. #define HTTP_STATUS_SERVICE_NA 503 // service unavailable
  195. #endif
  196. ///////////////////////////////////////////////////////////////////////
  197. // Parse Map macros
  198. #ifndef AFX_PARSE_CALL
  199. #define AFX_PARSE_CALL
  200. #endif
  201. typedef void (AFX_PARSE_CALL CHttpServer::*AFX_PISAPICMD)(CHttpServerContext* pCtxt);
  202. struct AFX_PARSEMAP_ENTRY; // declared after CHttpServer, below
  203. struct AFX_PARSEMAP
  204. {
  205. UINT (PASCAL* pfnGetNumMapEntries)();
  206. #ifdef _AFXDLL
  207. const AFX_PARSEMAP* (PASCAL* pfnGetBaseMap)();
  208. #else
  209. const AFX_PARSEMAP* pBaseMap;
  210. #endif
  211. const AFX_PARSEMAP_ENTRY* lpEntries;
  212. ~AFX_PARSEMAP();
  213. };
  214. struct AFX_PARSEMAP_ENTRY_PARAMS
  215. {
  216. int nParams; // number of parameters
  217. int nRequired; // number of parameters without defaults
  218. // all of these are arrays!
  219. LPTSTR* ppszInfo; // pointers to name[2n], pointer to default[2n+1]
  220. BYTE* ppszDefaults; // pointers to coerced default values
  221. BYTE* ppszValues; // pointers to coerced actual values
  222. ~AFX_PARSEMAP_ENTRY_PARAMS();
  223. };
  224. #ifdef _AFXDLL
  225. #define DECLARE_PARSE_MAP() \
  226. private: \
  227. static AFX_PARSEMAP_ENTRY _parseEntries[]; \
  228. public: \
  229. static const AFX_PARSEMAP parseMap; \
  230. static const AFX_PARSEMAP* PASCAL _GetBaseParseMap(); \
  231. static UINT PASCAL GetNumMapEntries(); \
  232. virtual const AFX_PARSEMAP* GetParseMap() const; \
  233. #else
  234. #define DECLARE_PARSE_MAP() \
  235. private: \
  236. static AFX_PARSEMAP_ENTRY _parseEntries[]; \
  237. public: \
  238. static const AFX_PARSEMAP parseMap; \
  239. static UINT PASCAL GetNumMapEntries(); \
  240. virtual const AFX_PARSEMAP* GetParseMap() const; \
  241. #endif // _AFXDLL
  242. #ifdef _AFXDLL
  243. #define BEGIN_PARSE_MAP(theClass, baseClass) \
  244. const AFX_PARSEMAP* PASCAL theClass::_GetBaseParseMap() \
  245. { return &baseClass::parseMap; } \
  246. typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
  247. const AFX_PARSEMAP* theClass::GetParseMap() const \
  248. { return &theClass::parseMap; } \
  249. AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
  250. { &theClass::GetNumMapEntries, &theClass::_GetBaseParseMap, &theClass::_parseEntries[0] }; \
  251. AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
  252. { \
  253. #else
  254. #define BEGIN_PARSE_MAP(theClass, baseClass) \
  255. typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
  256. const AFX_PARSEMAP* theClass::GetParseMap() const \
  257. { return &theClass::parseMap; } \
  258. AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
  259. { &theClass::GetNumMapEntries, &baseClass::parseMap, &theClass::_parseEntries[0] }; \
  260. AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
  261. { \
  262. #endif
  263. #define ON_PARSE_COMMAND(FnName, mapClass, Args) \
  264. { _T(#FnName), (AFX_PISAPICMD) (mapClass##CALL)mapClass::FnName,\
  265. Args, NULL },
  266. #define ON_PARSE_COMMAND_PARAMS(Params) \
  267. { NULL, (AFX_PISAPICMD) NULL, Params, NULL },
  268. #define DEFAULT_PARSE_COMMAND(FnName, mapClass) \
  269. { _T(#FnName), (AFX_PISAPICMD) (mapClass##CALL)mapClass::FnName,\
  270. NULL, NULL },
  271. #define END_PARSE_MAP(theClass) \
  272. }; \
  273. UINT PASCAL theClass::GetNumMapEntries() { \
  274. return sizeof(theClass::_parseEntries) /\
  275. sizeof(AFX_PARSEMAP_ENTRY); } \
  276. ///////////////////////////////////////////////////////////////////////
  277. //
  278. class CHttpServerContext
  279. {
  280. public:
  281. CHttpServerContext(EXTENSION_CONTROL_BLOCK* pECB);
  282. virtual ~CHttpServerContext();
  283. // Operations
  284. BOOL GetServerVariable(LPTSTR lpszVariableName,
  285. LPVOID lpvBuffer, LPDWORD lpdwSize);
  286. BOOL WriteClient(LPVOID lpvBuffer, LPDWORD lpdwBytes, DWORD dwReserved = 0);
  287. BOOL ReadClient(LPVOID lpvBuffer, LPDWORD lpdwSize);
  288. BOOL ServerSupportFunction(DWORD dwHSERRequest,
  289. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType);
  290. #if _MFC_VER >= 0x0600
  291. BOOL TransmitFile(HANDLE hFile,
  292. DWORD dwFlags = HSE_IO_DISCONNECT_AFTER_SEND,
  293. LPVOID pstrHeader = NULL, DWORD dwHeaderLen = 0,
  294. LPVOID pstrTrailer = NULL, DWORD dwTrailerLen = 0);
  295. #endif
  296. CHttpServerContext& operator<<(LPCTSTR psz);
  297. CHttpServerContext& operator<<(long int dw);
  298. CHttpServerContext& operator<<(short int w);
  299. CHttpServerContext& operator<<(const CHtmlStream& stream);
  300. CHttpServerContext& operator<<(double d);
  301. CHttpServerContext& operator<<(float f);
  302. #ifdef _AFX
  303. CHttpServerContext& operator<<(const CLongBinary& blob);
  304. CHttpServerContext& operator<<(const CByteArray& array);
  305. #endif
  306. #if _MFC_VER >= 0x0600
  307. DWORD SetChunkSize(DWORD dwNewSize);
  308. DWORD GetChunkSize() const;
  309. #endif
  310. void Reset();
  311. // Attributes
  312. public:
  313. BOOL m_bSendHeaders;
  314. #if _MFC_VER >= 0x0600
  315. DWORD m_dwStatusCode;
  316. #endif
  317. EXTENSION_CONTROL_BLOCK* const m_pECB;
  318. CHtmlStream* m_pStream;
  319. DWORD m_dwEndOfHeaders;
  320. #ifdef _DEBUG
  321. DWORD m_dwOldEndOfHeaders;
  322. #endif
  323. #if _MFC_VER >= 0x0600
  324. // Implementation
  325. DWORD m_dwBytesReceived;
  326. DWORD m_dwChunkSize;
  327. #endif
  328. };
  329. ///////////////////////////////////////////////////////////////////////
  330. // Internet Information Server Extension Support
  331. class CHttpServer
  332. {
  333. public:
  334. CHttpServer(TCHAR cDelimiter = '&');
  335. virtual ~CHttpServer();
  336. enum errors {
  337. callOK = 0, // everything is fine
  338. callParamRequired, // a required parameter was missing
  339. callBadParamCount, // there were too many or too few parameters
  340. callBadCommand, // the command name was not found
  341. callNoStackSpace, // no stack space was available
  342. callNoStream, // no CHtmlStream was available
  343. callMissingQuote, // a parameter had a bad format
  344. callMissingParams, // no parameters were available
  345. callBadParam, // a paremeter had a bad format (ie, only one quote)
  346. };
  347. // overridables
  348. virtual int CallFunction(CHttpServerContext* pCtxt,
  349. LPTSTR pszQuery, LPTSTR pszCommand);
  350. virtual BOOL OnParseError(CHttpServerContext* pCtxt, int nCause);
  351. #if _MFC_VER >= 0x0600
  352. virtual BOOL OnWriteBody(CHttpServerContext* pCtxt, LPBYTE pbContent,
  353. DWORD dwSize, DWORD dwReserved = 0);
  354. #endif
  355. // operations
  356. virtual void EndContent(CHttpServerContext* pCtxt) const;
  357. virtual void StartContent(CHttpServerContext* pCtxt) const;
  358. virtual void WriteTitle(CHttpServerContext* pCtxt) const;
  359. virtual LPCTSTR GetTitle() const;
  360. void AddHeader(CHttpServerContext* pCtxt, LPCTSTR pszString) const;
  361. #if _MFC_VER >= 0x0600
  362. virtual BOOL TerminateExtension(DWORD dwFlags);
  363. #endif
  364. virtual DWORD HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);
  365. virtual BOOL GetExtensionVersion(HSE_VERSION_INFO *pVer);
  366. virtual CHtmlStream* ConstructStream();
  367. virtual BOOL InitInstance(CHttpServerContext* pCtxt);
  368. // implementation
  369. protected:
  370. UINT PASCAL GetStackSize(const BYTE* pbParams);
  371. int CallMemberFunc(CHttpServerContext* pCtxt,
  372. const AFX_PARSEMAP_ENTRY* pEntry,
  373. AFX_PARSEMAP_ENTRY* pParams, LPTSTR szParams);
  374. LPTSTR GetQuery(CHttpServerContext* pCtxt, LPTSTR lpszQuery);
  375. const AFX_PARSEMAP_ENTRY* LookUp(LPCTSTR szMethod,
  376. const AFX_PARSEMAP*& pMap, AFX_PARSEMAP_ENTRY*& pParams,
  377. AFX_PISAPICMD pCmdDefault = NULL);
  378. int CountParams(LPCTSTR pszCommandLine, int& nCount);
  379. int ParseDefaultParams(AFX_PARSEMAP_ENTRY* pParams,
  380. int nParams, AFX_PARSEMAP_ENTRY_PARAMS*& pBlock,
  381. const BYTE* pbTypes);
  382. LPVOID PreprocessString(LPTSTR psz);
  383. void BuildStatusCode(LPTSTR szResponse, DWORD dwCode);
  384. #ifdef _SHADOW_DOUBLES
  385. int PushDefaultStackArgs(BYTE* pStack,
  386. CHttpServerContext* pCtxt, const BYTE* pbParams,
  387. LPTSTR lpszParams, AFX_PARSEMAP_ENTRY_PARAMS* pDefParams,
  388. int nSizeArgs);
  389. int PushStackArgs(BYTE* pStack, CHttpServerContext* pCtxt,
  390. const BYTE* pbParams, LPTSTR lpszParams, UINT nSizeArgs);
  391. BYTE* StoreStackParameter(BYTE* pStack, BYTE nType,
  392. LPTSTR pszCurParam, UINT nSizeArgs, BOOL bDoShadow);
  393. BYTE* StoreRawStackParameter(BYTE* pStack, BYTE nType,
  394. BYTE* pRawParam, int nSizeArgs);
  395. #else
  396. int PushDefaultStackArgs(BYTE* pStack,
  397. CHttpServerContext* pCtxt, const BYTE* pbParams,
  398. LPTSTR lpszParams, AFX_PARSEMAP_ENTRY_PARAMS* pDefParams);
  399. int PushStackArgs(BYTE* pStack, CHttpServerContext* pCtxt,
  400. const BYTE* pbParams, LPTSTR lpszParams);
  401. BYTE* StoreStackParameter(BYTE* pStack, BYTE nType, LPTSTR pszParam);
  402. BYTE* StoreRawStackParameter(BYTE* pStack, BYTE nType, BYTE* pRawParam);
  403. #endif
  404. LPCRITICAL_SECTION m_pCritSec;
  405. const TCHAR m_cTokenDelimiter; // can't EVER change
  406. DECLARE_PARSE_MAP()
  407. };
  408. extern "C" BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer);
  409. extern "C" DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);
  410. struct AFX_PARSEMAP_ENTRY
  411. {
  412. LPTSTR pszFnName; // if default param entry, ptr to AFX_PARSEMAP_ENTRY_PARAMS
  413. AFX_PISAPICMD pfn; // NULL if default param entry
  414. LPCSTR pszArgs; // NULL if default function entry
  415. LPSTR pszParamInfo; // copy of pszArgs for parsing
  416. };
  417. ///////////////////////////////////////////////////////////////////////
  418. // Constants to describe parameter types
  419. #define ITS_EMPTY "\x06" // no parameters
  420. #define ITS_I2 "\x01" // a 'short'
  421. #define ITS_I4 "\x02" // a 'long'
  422. #define ITS_R4 "\x03" // a 'float'
  423. #define ITS_R8 "\x04" // a 'double'
  424. #define ITS_PSTR "\x05" // a 'LPCTSTR'
  425. #if _MFC_VER >= 0x0600
  426. #define ITS_RAW "\x07" // exactly as received
  427. #endif
  428. enum INETVARENUM
  429. {
  430. IT_I2 = 1,
  431. IT_I4 = 2,
  432. IT_R4 = 3,
  433. IT_R8 = 4,
  434. IT_PSTR = 5,
  435. IT_EMPTY = 6,
  436. #if _MFC_VER >= 0x0600
  437. IT_RAW = 7,
  438. #endif
  439. };
  440. ///////////////////////////////////////////////////////////////////////
  441. // Internet Information Server Entry Points
  442. extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc,
  443. DWORD dwNotificationType, LPVOID pvNotification);
  444. extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer);
  445. ///////////////////////////////////////////////////////////////////////
  446. // Internet Information Server Filter Support
  447. class CHttpFilterContext
  448. {
  449. public:
  450. CHttpFilterContext(PHTTP_FILTER_CONTEXT pfc);
  451. ~CHttpFilterContext() { }
  452. BOOL GetServerVariable(LPTSTR lpszVariableName, LPVOID lpvBuffer,
  453. LPDWORD lpdwSize);
  454. BOOL AddResponseHeaders(LPTSTR lpszHeaders, DWORD dwReserved = 0);
  455. BOOL WriteClient(LPVOID lpvBuffer, LPDWORD lpdwBytes,
  456. DWORD dwReserved = 0);
  457. LPVOID AllocMem(DWORD cbSize, DWORD dwReserved = 0);
  458. BOOL ServerSupportFunction(enum SF_REQ_TYPE sfReq,
  459. LPVOID lpvBuffer, LPDWORD lpdwSize, LPDWORD lpdwDataType);
  460. PHTTP_FILTER_CONTEXT const m_pFC;
  461. };
  462. ///////////////////////////////////////////////////////////////////////
  463. //
  464. class CHttpFilter
  465. {
  466. public:
  467. CHttpFilter();
  468. ~CHttpFilter();
  469. protected:
  470. public:
  471. virtual DWORD HttpFilterProc(PHTTP_FILTER_CONTEXT pfc,
  472. DWORD dwNotificationType, LPVOID pvNotification);
  473. virtual BOOL GetFilterVersion(PHTTP_FILTER_VERSION pVer);
  474. virtual DWORD OnReadRawData(CHttpFilterContext* pfc, PHTTP_FILTER_RAW_DATA pRawData);
  475. virtual DWORD OnPreprocHeaders(CHttpFilterContext* pfc, PHTTP_FILTER_PREPROC_HEADERS pHeaders);
  476. virtual DWORD OnAuthentication(CHttpFilterContext* pfc, PHTTP_FILTER_AUTHENT pAuthent);
  477. virtual DWORD OnUrlMap(CHttpFilterContext* pfc, PHTTP_FILTER_URL_MAP pUrlMap);
  478. virtual DWORD OnSendRawData(CHttpFilterContext* pfc, PHTTP_FILTER_RAW_DATA pRawData);
  479. virtual DWORD OnLog(CHttpFilterContext* pfc, PHTTP_FILTER_LOG pLog);
  480. virtual DWORD OnEndOfNetSession(CHttpFilterContext* pfc);
  481. virtual DWORD OnEndOfRequest(CHttpFilterContext* pfc);
  482. };
  483. /////////////////////////////////////////////////////////////////////////////
  484. // Alternate debugging suppot
  485. #include <crtdbg.h>
  486. #ifdef _AFX
  487. #define ISAPIASSERT(expr) ASSERT(expr)
  488. #define ISAPITRACE TRACE
  489. #define ISAPITRACE0(str) TRACE0(str)
  490. #define ISAPITRACE1(str, arg1) TRACE1(str, arg1)
  491. #define ISAPITRACE2(str, arg1, arg2) TRACE2(str, arg1, arg2)
  492. #define ISAPITRACE3(str, arg1, arg2, arg3) TRACE3(str, arg1, arg2, arg3)
  493. #ifdef _DEBUG
  494. #define ISAPIVERIFY(f) ASSERT(f)
  495. #else
  496. #define ISAPIVERIFY(f) ((void)(f))
  497. #endif // _DEBUG
  498. #else // !_AFX
  499. #define ISAPIASSERT(expr) _ASSERTE(expr)
  500. #define ISAPITRACE0(str) _RPT0(_CRT_WARN, str)
  501. #define ISAPITRACE1(str, arg1) _RPT1(_CRT_WARN, str, arg1)
  502. #define ISAPITRACE2(str, arg1, arg2) _RPT2(_CRT_WARN, str, arg1, arg2)
  503. #define ISAPITRACE3(str, arg1, arg2, arg3) _RPT3(_CRT_WARN, arg1, arg2, arg3)
  504. #ifdef _DEBUG
  505. void AFXISAPI_CDECL AfxISAPITrace(LPCTSTR lpszFormat, ...);
  506. #define ISAPIVERIFY(expr) _ASSERTE(expr)
  507. #define ISAPITRACE AfxISAPITrace
  508. #else
  509. AFX_INLINE void AfxISAPITrace(LPCTSTR, ...) { }
  510. #define ISAPIVERIFY(expr) ((void)(expr))
  511. #define ISAPITRACE AfxISAPITrace
  512. #endif // _DEBUG
  513. #endif // _AFX
  514. /////////////////////////////////////////////////////////////////////////////
  515. // Inline function declarations
  516. #ifdef _AFX_ENABLE_INLINES
  517. #define _AFXISAPI_INLINE AFX_INLINE
  518. #include <afxisapi.inl>
  519. #endif
  520. #undef AFX_DATA
  521. #define AFX_DATA
  522. #ifdef _AFX_MINREBUILD
  523. #pragma component(minrebuild, on)
  524. #endif
  525. #ifndef _AFX_FULLTYPEINFO
  526. #pragma component(mintypeinfo, off)
  527. #endif
  528. #endif // the whole file