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.

716 lines
23 KiB

  1. /********
  2. *
  3. * Copyright (c) 1995 Process Software Corporation
  4. *
  5. * Copyright (c) 1995-1999 Microsoft Corporation
  6. *
  7. *
  8. * Module Name : HttpExt.h
  9. *
  10. * Abstract :
  11. *
  12. * This module contains the structure definitions and prototypes for the
  13. * HTTP Server Extension interface used to build ISAPI Applications
  14. *
  15. ******************/
  16. #ifndef _HTTPEXT_H_
  17. #define _HTTPEXT_H_
  18. #include <windows.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. ;begin_internal
  23. /*++
  24. Copyright (c) 1997-1999 Microsoft Corporation
  25. Module Name :
  26. iisextp.h
  27. Abstract:
  28. This module contains private HTTP server extension info
  29. Environment:
  30. Win32 User Mode
  31. --*/
  32. #ifndef _IISEXTP_H_
  33. #define _IISEXTP_H_
  34. #include <iisext.h>
  35. ;end_internal
  36. /************************************************************
  37. * Manifest Constants
  38. ************************************************************/
  39. #define HSE_VERSION_MAJOR 6 // major version of this spec
  40. #define HSE_VERSION_MINOR 0 // minor version of this spec
  41. #define HSE_LOG_BUFFER_LEN 80
  42. #define HSE_MAX_EXT_DLL_NAME_LEN 256
  43. #define HSE_VERSION MAKELONG( HSE_VERSION_MINOR, HSE_VERSION_MAJOR )
  44. //
  45. // the following are the status codes returned by the Extension DLL
  46. //
  47. #define HSE_STATUS_SUCCESS 1
  48. #define HSE_STATUS_SUCCESS_AND_KEEP_CONN 2
  49. #define HSE_STATUS_PENDING 3
  50. #define HSE_STATUS_ERROR 4
  51. //
  52. // The following are the values to request services with the
  53. // ServerSupportFunction().
  54. // Values from 0 to 1000 are reserved for future versions of the interface
  55. #define HSE_REQ_BASE 0
  56. #define HSE_REQ_SEND_URL_REDIRECT_RESP ( HSE_REQ_BASE + 1 )
  57. #define HSE_REQ_SEND_URL ( HSE_REQ_BASE + 2 )
  58. #define HSE_REQ_SEND_RESPONSE_HEADER ( HSE_REQ_BASE + 3 )
  59. #define HSE_REQ_DONE_WITH_SESSION ( HSE_REQ_BASE + 4 )
  60. #define HSE_REQ_END_RESERVED 1000
  61. //
  62. // These are Microsoft specific extensions
  63. //
  64. #define HSE_REQ_MAP_URL_TO_PATH (HSE_REQ_END_RESERVED+1)
  65. #define HSE_REQ_GET_SSPI_INFO (HSE_REQ_END_RESERVED+2)
  66. #define HSE_APPEND_LOG_PARAMETER (HSE_REQ_END_RESERVED+3)
  67. ;begin_internal
  68. // available
  69. // #define ??? (HSE_REQ_END_RESERVED+4)
  70. ;end_internal
  71. #define HSE_REQ_IO_COMPLETION (HSE_REQ_END_RESERVED+5)
  72. #define HSE_REQ_TRANSMIT_FILE (HSE_REQ_END_RESERVED+6)
  73. #define HSE_REQ_REFRESH_ISAPI_ACL (HSE_REQ_END_RESERVED+7)
  74. #define HSE_REQ_IS_KEEP_CONN (HSE_REQ_END_RESERVED+8)
  75. ;begin_internal
  76. // no longer supported
  77. #define HSE_REQ_GET_CERT_INFO (HSE_REQ_END_RESERVED+9)
  78. ;end_internal
  79. #define HSE_REQ_ASYNC_READ_CLIENT (HSE_REQ_END_RESERVED+10)
  80. #define HSE_REQ_GET_IMPERSONATION_TOKEN (HSE_REQ_END_RESERVED+11)
  81. #define HSE_REQ_MAP_URL_TO_PATH_EX (HSE_REQ_END_RESERVED+12)
  82. ;begin_internal
  83. // will be public in IIS 5.0
  84. #define HSE_REQ_EXECUTE_CHILD (HSE_REQ_END_RESERVED+13)
  85. ;end_internal
  86. #define HSE_REQ_ABORTIVE_CLOSE (HSE_REQ_END_RESERVED+14)
  87. #define HSE_REQ_GET_CERT_INFO_EX (HSE_REQ_END_RESERVED+15)
  88. #define HSE_REQ_SEND_RESPONSE_HEADER_EX (HSE_REQ_END_RESERVED+16)
  89. #define HSE_REQ_CLOSE_CONNECTION (HSE_REQ_END_RESERVED+17)
  90. #define HSE_REQ_IS_CONNECTED (HSE_REQ_END_RESERVED+18)
  91. ;begin_internal
  92. #define HSE_REQ_GET_EXECUTE_FLAGS (HSE_REQ_END_RESERVED+19)
  93. ;end_internal
  94. ;begin_internal
  95. // Don't reuse
  96. // #define HSE_REQ_EXTENSION_TRIGGER (HSE_REQ_END_RESERVED+20)
  97. ;end_internal
  98. ;begin_internal
  99. // UNDONE: should be public after IIS 5.0 BETA 2
  100. #define HSE_REQ_GET_VIRTUAL_PATH_TOKEN (HSE_REQ_END_RESERVED+21)
  101. // This is the old vecotr send for ASP.Net's use
  102. #define HSE_REQ_VECTOR_SEND_DEPRECATED (HSE_REQ_END_RESERVED+22)
  103. ;end_internal
  104. #define HSE_REQ_MAP_UNICODE_URL_TO_PATH (HSE_REQ_END_RESERVED+23)
  105. #define HSE_REQ_MAP_UNICODE_URL_TO_PATH_EX (HSE_REQ_END_RESERVED+24)
  106. #define HSE_REQ_EXEC_UNICODE_URL (HSE_REQ_END_RESERVED+25)
  107. #define HSE_REQ_EXEC_URL (HSE_REQ_END_RESERVED+26)
  108. #define HSE_REQ_GET_EXEC_URL_STATUS (HSE_REQ_END_RESERVED+27)
  109. #define HSE_REQ_SEND_CUSTOM_ERROR (HSE_REQ_END_RESERVED+28)
  110. ;begin_internal
  111. #define HSE_REQ_GET_CUSTOM_ERROR_PAGE (HSE_REQ_END_RESERVED+29)
  112. ;end_internal
  113. #define HSE_REQ_IS_IN_PROCESS (HSE_REQ_END_RESERVED+30)
  114. ;begin_internal
  115. #define HSE_REQ_GET_UNICODE_VIRTUAL_PATH_TOKEN (HSE_REQ_END_RESERVED+31)
  116. ;end_internal
  117. #define HSE_REQ_REPORT_UNHEALTHY (HSE_REQ_END_RESERVED+32)
  118. #define HSE_REQ_NORMALIZE_URL (HSE_REQ_END_RESERVED+33)
  119. ;begin_internal
  120. #define HSE_REQ_ADD_FRAGMENT_TO_CACHE (HSE_REQ_END_RESERVED+34)
  121. #define HSE_REQ_READ_FRAGMENT_FROM_CACHE (HSE_REQ_END_RESERVED+35)
  122. #define HSE_REQ_REMOVE_FRAGMENT_FROM_CACHE (HSE_REQ_END_RESERVED+36)
  123. ;end_internal
  124. #define HSE_REQ_VECTOR_SEND (HSE_REQ_END_RESERVED+37)
  125. #define HSE_REQ_GET_ANONYMOUS_TOKEN (HSE_REQ_END_RESERVED+38)
  126. ;begin_internal
  127. #define HSE_REQ_GET_METADATA_PROPERTY (HSE_REQ_END_RESERVED+39)
  128. ;end_internal
  129. #define HSE_REQ_GET_CACHE_INVALIDATION_CALLBACK (HSE_REQ_END_RESERVED+40)
  130. #define HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN (HSE_REQ_END_RESERVED+41)
  131. //
  132. // Bit Flags for TerminateExtension
  133. //
  134. // HSE_TERM_ADVISORY_UNLOAD - Server wants to unload the extension,
  135. // extension can return TRUE if OK, FALSE if the server should not
  136. // unload the extension
  137. //
  138. // HSE_TERM_MUST_UNLOAD - Server indicating the extension is about to be
  139. // unloaded, the extension cannot refuse.
  140. //
  141. #define HSE_TERM_ADVISORY_UNLOAD 0x00000001
  142. #define HSE_TERM_MUST_UNLOAD 0x00000002
  143. //
  144. // Flags for IO Functions, supported for IO Funcs.
  145. // TF means ServerSupportFunction( HSE_REQ_TRANSMIT_FILE)
  146. //
  147. # define HSE_IO_SYNC 0x00000001 // for WriteClient
  148. # define HSE_IO_ASYNC 0x00000002 // for WriteClient/TF/EU
  149. # define HSE_IO_DISCONNECT_AFTER_SEND 0x00000004 // for TF
  150. # define HSE_IO_SEND_HEADERS 0x00000008 // for TF
  151. # define HSE_IO_NODELAY 0x00001000 // turn off nagling
  152. //
  153. // These two are only used by VectorSend
  154. //
  155. # define HSE_IO_FINAL_SEND 0x00000010
  156. # define HSE_IO_CACHE_RESPONSE 0x00000020
  157. ;begin_internal
  158. // will be public in IIS 5.0
  159. //
  160. // Flags for HSE_REQ_EXECUTE_CHILD function
  161. //
  162. # define HSE_EXEC_NO_HEADERS 0x00000001 // Don't send any
  163. // headers of child
  164. # define HSE_EXEC_REDIRECT_ONLY 0x00000002 // Don't send any
  165. // headers of child
  166. // but send redirect
  167. // message
  168. # define HSE_EXEC_COMMAND 0x00000004 // Treat as shell
  169. // command instead of
  170. // URL
  171. # define HSE_EXEC_NO_ISA_WILDCARDS 0x00000010 // Ignore wildcards in
  172. // ISAPI mapping when
  173. // executing child
  174. # define HSE_EXEC_CUSTOM_ERROR 0x00000020 // URL being sent is a
  175. // custom error
  176. ;end_internal
  177. /************************************************************
  178. * Type Definitions
  179. ************************************************************/
  180. typedef LPVOID HCONN;
  181. //
  182. // structure passed to GetExtensionVersion()
  183. //
  184. typedef struct _HSE_VERSION_INFO {
  185. DWORD dwExtensionVersion;
  186. CHAR lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN];
  187. } HSE_VERSION_INFO, *LPHSE_VERSION_INFO;
  188. //
  189. // structure passed to extension procedure on a new request
  190. //
  191. typedef struct _EXTENSION_CONTROL_BLOCK {
  192. DWORD cbSize; // size of this struct.
  193. DWORD dwVersion; // version info of this spec
  194. HCONN ConnID; // Context number not to be modified!
  195. DWORD dwHttpStatusCode; // HTTP Status code
  196. CHAR lpszLogData[HSE_LOG_BUFFER_LEN];// null terminated log info specific to this Extension DLL
  197. LPSTR lpszMethod; // REQUEST_METHOD
  198. LPSTR lpszQueryString; // QUERY_STRING
  199. LPSTR lpszPathInfo; // PATH_INFO
  200. LPSTR lpszPathTranslated; // PATH_TRANSLATED
  201. DWORD cbTotalBytes; // Total bytes indicated from client
  202. DWORD cbAvailable; // Available number of bytes
  203. LPBYTE lpbData; // pointer to cbAvailable bytes
  204. LPSTR lpszContentType; // Content type of client data
  205. BOOL (WINAPI * GetServerVariable) ( HCONN hConn,
  206. LPSTR lpszVariableName,
  207. LPVOID lpvBuffer,
  208. LPDWORD lpdwSize );
  209. BOOL (WINAPI * WriteClient) ( HCONN ConnID,
  210. LPVOID Buffer,
  211. LPDWORD lpdwBytes,
  212. DWORD dwReserved );
  213. BOOL (WINAPI * ReadClient) ( HCONN ConnID,
  214. LPVOID lpvBuffer,
  215. LPDWORD lpdwSize );
  216. BOOL (WINAPI * ServerSupportFunction)( HCONN hConn,
  217. DWORD dwHSERequest,
  218. LPVOID lpvBuffer,
  219. LPDWORD lpdwSize,
  220. LPDWORD lpdwDataType );
  221. } EXTENSION_CONTROL_BLOCK, *LPEXTENSION_CONTROL_BLOCK;
  222. //
  223. // Bit field of flags that can be on a virtual directory
  224. //
  225. #define HSE_URL_FLAGS_READ 0x00000001 // Allow for Read
  226. #define HSE_URL_FLAGS_WRITE 0x00000002 // Allow for Write
  227. #define HSE_URL_FLAGS_EXECUTE 0x00000004 // Allow for Execute
  228. #define HSE_URL_FLAGS_SSL 0x00000008 // Require SSL
  229. #define HSE_URL_FLAGS_DONT_CACHE 0x00000010 // Don't cache (vroot only)
  230. #define HSE_URL_FLAGS_NEGO_CERT 0x00000020 // Allow client SSL certs
  231. #define HSE_URL_FLAGS_REQUIRE_CERT 0x00000040 // Require client SSL certs
  232. #define HSE_URL_FLAGS_MAP_CERT 0x00000080 // Map SSL cert to NT account
  233. #define HSE_URL_FLAGS_SSL128 0x00000100 // Require 128 bit SSL
  234. #define HSE_URL_FLAGS_SCRIPT 0x00000200 // Allow for Script execution
  235. #define HSE_URL_FLAGS_MASK 0x000003ff
  236. //
  237. // Structure for extended information on a URL mapping
  238. //
  239. typedef struct _HSE_URL_MAPEX_INFO {
  240. CHAR lpszPath[MAX_PATH]; // Physical path root mapped to
  241. DWORD dwFlags; // Flags associated with this URL path
  242. DWORD cchMatchingPath; // Number of matching characters in physical path
  243. DWORD cchMatchingURL; // Number of matching characters in URL
  244. DWORD dwReserved1;
  245. DWORD dwReserved2;
  246. } HSE_URL_MAPEX_INFO, * LPHSE_URL_MAPEX_INFO;
  247. typedef struct _HSE_UNICODE_URL_MAPEX_INFO {
  248. WCHAR lpszPath[MAX_PATH]; // Physical path root mapped to
  249. DWORD dwFlags; // Flags associated with this URL path
  250. DWORD cchMatchingPath; // Number of matching characters in physical path
  251. DWORD cchMatchingURL; // Number of matching characters in URL
  252. } HSE_UNICODE_URL_MAPEX_INFO, * LPHSE_UNICODE_URL_MAPEX_INFO;
  253. //
  254. // PFN_HSE_IO_COMPLETION - callback function for the Async I/O Completion.
  255. //
  256. typedef VOID
  257. (WINAPI * PFN_HSE_IO_COMPLETION)(
  258. IN EXTENSION_CONTROL_BLOCK * pECB,
  259. IN PVOID pContext,
  260. IN DWORD cbIO,
  261. IN DWORD dwError
  262. );
  263. //
  264. // HSE_TF_INFO defines the type for HTTP SERVER EXTENSION support for
  265. // ISAPI applications to send files using TransmitFile.
  266. // A pointer to this object should be used with ServerSupportFunction()
  267. // for HSE_REQ_TRANSMIT_FILE.
  268. //
  269. typedef struct _HSE_TF_INFO {
  270. //
  271. // callback and context information
  272. // the callback function will be called when IO is completed.
  273. // the context specified will be used during such callback.
  274. //
  275. // These values (if non-NULL) will override the one set by calling
  276. // ServerSupportFunction() with HSE_REQ_IO_COMPLETION
  277. //
  278. PFN_HSE_IO_COMPLETION pfnHseIO;
  279. PVOID pContext;
  280. // file should have been opened with FILE_FLAG_SEQUENTIAL_SCAN
  281. HANDLE hFile;
  282. //
  283. // HTTP header and status code
  284. // These fields are used only if HSE_IO_SEND_HEADERS is present in dwFlags
  285. //
  286. LPCSTR pszStatusCode; // HTTP Status Code eg: "200 OK"
  287. DWORD BytesToWrite; // special value of "0" means write entire file.
  288. DWORD Offset; // offset value within the file to start from
  289. PVOID pHead; // Head buffer to be sent before file data
  290. DWORD HeadLength; // header length
  291. PVOID pTail; // Tail buffer to be sent after file data
  292. DWORD TailLength; // tail length
  293. DWORD dwFlags; // includes HSE_IO_DISCONNECT_AFTER_SEND, ...
  294. } HSE_TF_INFO, * LPHSE_TF_INFO;
  295. //
  296. // HSE_SEND_HEADER_EX_INFO allows an ISAPI application to send headers
  297. // and specify keep-alive behavior in the same call.
  298. //
  299. typedef struct _HSE_SEND_HEADER_EX_INFO {
  300. //
  301. // HTTP status code and header
  302. //
  303. LPCSTR pszStatus; // HTTP status code eg: "200 OK"
  304. LPCSTR pszHeader; // HTTP header
  305. DWORD cchStatus; // number of characters in status code
  306. DWORD cchHeader; // number of characters in header
  307. BOOL fKeepConn; // keep client connection alive?
  308. } HSE_SEND_HEADER_EX_INFO, * LPHSE_SEND_HEADER_EX_INFO;
  309. //
  310. // Flags for use with HSE_REQ_EXEC_URL
  311. //
  312. #define HSE_EXEC_URL_NO_HEADERS 0x02
  313. #define HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR 0x04
  314. ;begin_internal
  315. //#define HSE_EXEC_URL_IGNORE_APPPOOL 0x08
  316. ;end_internal
  317. #define HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE 0x10
  318. #define HSE_EXEC_URL_DISABLE_CUSTOM_ERROR 0x20
  319. #define HSE_EXEC_URL_SSI_CMD 0x40
  320. //
  321. // HSE_EXEC_URL_USER_INFO provides a new user content for use with
  322. // HSE_REQ_EXEC_URL
  323. //
  324. typedef struct _HSE_EXEC_URL_USER_INFO {
  325. HANDLE hImpersonationToken;
  326. LPSTR pszCustomUserName;
  327. LPSTR pszCustomAuthType;
  328. } HSE_EXEC_URL_USER_INFO, * LPHSE_EXEC_URL_USER_INFO;
  329. //
  330. // HSE_EXEC_URL_ENTITY_INFO describes the entity body to be provided
  331. // to the executed request using HSE_REQ_EXEC_URL
  332. //
  333. typedef struct _HSE_EXEC_URL_ENTITY_INFO {
  334. DWORD cbAvailable;
  335. LPVOID lpbData;
  336. } HSE_EXEC_URL_ENTITY_INFO, * LPHSE_EXEC_URL_ENTITY_INFO;
  337. //
  338. // HSE_EXEC_URL_STATUS provides the status of the last HSE_REQ_EXEC_URL
  339. // call
  340. //
  341. typedef struct _HSE_EXEC_URL_STATUS {
  342. USHORT uHttpStatusCode;
  343. USHORT uHttpSubStatus;
  344. DWORD dwWin32Error;
  345. } HSE_EXEC_URL_STATUS, * LPHSE_EXEC_URL_STATUS;
  346. //
  347. // HSE_EXEC_URL_INFO provides a description of the request to execute
  348. // on behalf of the ISAPI.
  349. //
  350. typedef struct _HSE_EXEC_URL_INFO {
  351. LPSTR pszUrl; // URL to execute
  352. LPSTR pszMethod; // Method
  353. LPSTR pszChildHeaders; // Request headers for child
  354. LPHSE_EXEC_URL_USER_INFO pUserInfo; // User for new request
  355. LPHSE_EXEC_URL_ENTITY_INFO pEntity; // Entity body for new request
  356. DWORD dwExecUrlFlags; // Flags
  357. } HSE_EXEC_URL_INFO, * LPHSE_EXEC_URL_INFO;
  358. //
  359. // HSE_EXEC_UNICODE_URL_USER_INFO provides a new user content for use with
  360. // HSE_REQ_EXEC_UNICODE_URL
  361. //
  362. typedef struct _HSE_EXEC_UNICODE_URL_USER_INFO {
  363. HANDLE hImpersonationToken;
  364. LPWSTR pszCustomUserName;
  365. LPSTR pszCustomAuthType;
  366. } HSE_EXEC_UNICODE_URL_USER_INFO, * LPHSE_EXEC_UNICODE_URL_USER_INFO;
  367. //
  368. // HSE_EXEC_UNICODE_URL_INFO provides a description of the request to execute
  369. // on behalf of the ISAPI.
  370. //
  371. typedef struct _HSE_EXEC_UNICODE_URL_INFO {
  372. LPWSTR pszUrl; // URL to execute
  373. LPSTR pszMethod; // Method
  374. LPSTR pszChildHeaders; // Request headers for child
  375. LPHSE_EXEC_UNICODE_URL_USER_INFO pUserInfo; // User for new request
  376. LPHSE_EXEC_URL_ENTITY_INFO pEntity; // Entity body for new request
  377. DWORD dwExecUrlFlags; // Flags
  378. } HSE_EXEC_UNICODE_URL_INFO, * LPHSE_EXEC_UNICODE_URL_INFO;
  379. //
  380. // HSE_CUSTOM_ERROR_INFO structured used in HSE_REQ_SEND_CUSTOM_ERROR
  381. //
  382. typedef struct _HSE_CUSTOM_ERROR_INFO {
  383. CHAR * pszStatus;
  384. USHORT uHttpSubError;
  385. BOOL fAsync;
  386. } HSE_CUSTOM_ERROR_INFO, * LPHSE_CUSTOM_ERROR_INFO;
  387. //
  388. // structures for the HSE_REQ_VECTOR_SEND ServerSupportFunction
  389. //
  390. ;begin_internal
  391. //
  392. // This is the deprecated structure for ASP.Net's use
  393. //
  394. //
  395. // element of the vector
  396. //
  397. typedef struct _HSE_VECTOR_ELEMENT_DEPRECATED
  398. {
  399. PVOID pBuffer; // The buffer to be sent
  400. HANDLE hFile; // The handle to read the data from
  401. // Note: both pBuffer and hFile should not be non-null
  402. ULONGLONG cbOffset; // Offset from the start of hFile
  403. ULONGLONG cbSize; // Number of bytes to send
  404. } HSE_VECTOR_ELEMENT_DEPRECATED, *LPHSE_VECTOR_ELEMENT_DEPRECATED;
  405. //
  406. // The whole vector to be passed to the ServerSupportFunction
  407. //
  408. typedef struct _HSE_RESPONSE_VECTOR_DEPRECATED
  409. {
  410. DWORD dwFlags; // combination of HSE_IO_* flags
  411. LPSTR pszStatus; // Status line to send like "200 OK"
  412. LPSTR pszHeaders; // Headers to send
  413. DWORD nElementCount; // Number of HSE_VECTOR_ELEMENT_DEPRECATED's
  414. LPHSE_VECTOR_ELEMENT_DEPRECATED lpElementArray; // Pointer to those elements
  415. } HSE_RESPONSE_VECTOR_DEPRECATED, *LPHSE_RESPONSE_VECTOR_DEPRECATED;
  416. ;end_internal
  417. //
  418. // Types of vector-elements currently supported
  419. //
  420. #define HSE_VECTOR_ELEMENT_TYPE_MEMORY_BUFFER 0
  421. #define HSE_VECTOR_ELEMENT_TYPE_FILE_HANDLE 1
  422. ;begin_internal
  423. #define HSE_VECTOR_ELEMENT_TYPE_FRAGMENT 2
  424. ;end_internal
  425. //
  426. // element of the vector
  427. //
  428. typedef struct _HSE_VECTOR_ELEMENT
  429. {
  430. DWORD ElementType; // Type of element (buffer/file/fragment etc)
  431. PVOID pvContext; // The context representing the element to be sent
  432. ULONGLONG cbOffset; // Offset from the start of hFile
  433. ULONGLONG cbSize; // Number of bytes to send
  434. } HSE_VECTOR_ELEMENT, *LPHSE_VECTOR_ELEMENT;
  435. //
  436. // The whole vector to be passed to the ServerSupportFunction
  437. //
  438. typedef struct _HSE_RESPONSE_VECTOR
  439. {
  440. DWORD dwFlags; // combination of HSE_IO_* flags
  441. LPSTR pszStatus; // Status line to send like "200 OK"
  442. LPSTR pszHeaders; // Headers to send
  443. DWORD nElementCount; // Number of HSE_VECTOR_ELEMENT's
  444. LPHSE_VECTOR_ELEMENT lpElementArray; // Pointer to those elements
  445. } HSE_RESPONSE_VECTOR, *LPHSE_RESPONSE_VECTOR;
  446. typedef HRESULT
  447. (WINAPI * PFN_HSE_CACHE_INVALIDATION_CALLBACK)(
  448. WCHAR *pszUrl);
  449. #if(_WIN32_WINNT >= 0x400)
  450. #include <wincrypt.h>
  451. //
  452. // CERT_CONTEXT_EX is passed as an an argument to
  453. // ServerSupportFunction( HSE_REQ_GET_CERT_INFO_EX )
  454. //
  455. typedef struct _CERT_CONTEXT_EX {
  456. CERT_CONTEXT CertContext;
  457. DWORD cbAllocated;
  458. DWORD dwCertificateFlags;
  459. } CERT_CONTEXT_EX;
  460. #endif
  461. ;begin_internal
  462. #include <winsock2.h>
  463. typedef struct _HSE_SEND_ENTIRE_RESPONSE_INFO {
  464. //
  465. // HTTP header info
  466. //
  467. HSE_SEND_HEADER_EX_INFO HeaderInfo;
  468. //
  469. // Buffers which will be passed to WSASend
  470. //
  471. // NOTE: To send an entire response whose data (body)
  472. // is contained in N buffers, caller must allocate N+1 buffers
  473. // and fill buffers 1 through N with its data buffers.
  474. // IIS will fill the extra buffer (buffer 0) with header info.
  475. //
  476. WSABUF * rgWsaBuf; // array of wsa buffers
  477. DWORD cWsaBuf; // count of wsa buffers
  478. //
  479. // Returned by WSASend
  480. //
  481. DWORD cbWritten;
  482. } HSE_SEND_ENTIRE_RESPONSE_INFO, * LPHSE_SEND_ENTIRE_RESPONSE_INFO;
  483. typedef struct _HSE_CUSTOM_ERROR_PAGE_INFO {
  484. //
  485. // The Error and SubError to look up
  486. //
  487. DWORD dwError;
  488. DWORD dwSubError;
  489. //
  490. // Buffer info
  491. //
  492. DWORD dwBufferSize;
  493. CHAR * pBuffer;
  494. //
  495. // On return, this contains the size of the buffer required
  496. //
  497. DWORD * pdwBufferRequired;
  498. //
  499. // If TRUE on return, then buffer contains a file name
  500. //
  501. BOOL * pfIsFileError;
  502. //
  503. // If FALSE on return, then the body of the custom error
  504. // should not be sent.
  505. //
  506. BOOL * pfSendErrorBody;
  507. } HSE_CUSTOM_ERROR_PAGE_INFO, * LPHSE_CUSTOM_ERROR_PAGE_INFO;
  508. ;end_internal
  509. //
  510. // Flags for determining application type
  511. //
  512. #define HSE_APP_FLAG_IN_PROCESS 0
  513. #define HSE_APP_FLAG_ISOLATED_OOP 1
  514. #define HSE_APP_FLAG_POOLED_OOP 2
  515. /************************************************************
  516. * Function Prototypes
  517. * o for functions exported from the ISAPI Application DLL
  518. ************************************************************/
  519. BOOL WINAPI GetExtensionVersion( HSE_VERSION_INFO *pVer );
  520. DWORD WINAPI HttpExtensionProc( EXTENSION_CONTROL_BLOCK *pECB );
  521. BOOL WINAPI TerminateExtension( DWORD dwFlags );
  522. // the following type declarations is for use in the server side
  523. typedef BOOL
  524. (WINAPI * PFN_GETEXTENSIONVERSION)( HSE_VERSION_INFO *pVer );
  525. typedef DWORD
  526. (WINAPI * PFN_HTTPEXTENSIONPROC )( EXTENSION_CONTROL_BLOCK * pECB );
  527. typedef BOOL (WINAPI * PFN_TERMINATEEXTENSION )( DWORD dwFlags );
  528. #ifdef __cplusplus
  529. }
  530. #endif
  531. ;begin_internal
  532. #endif // _IISEXTP_H_
  533. ;end_internal
  534. #endif // end definition _HTTPEXT_H_