Source code of Windows XP (NT5)
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.

451 lines
14 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. http.h
  5. Abstract:
  6. Contains structures and declarations shared between
  7. HTTP.SYS and HTTPAPI.DLL. Users of the httpapi should include
  8. httpapi.h and not this file.
  9. Author:
  10. Keith Moore (keithmo) 10-Jun-1998
  11. Revision History:
  12. Chun Ye (chunye) 27-Sep-2000
  13. Renamed UL_* to HTTP_*.
  14. --*/
  15. #ifndef _HTTP_H_
  16. #define _HTTP_H_
  17. #include <httpdef.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif // __cplusplus
  21. //
  22. // Names of the object directory, devices, driver, and service.
  23. //
  24. #define HTTP_DIRECTORY_NAME L"\\Device\\Http"
  25. #define HTTP_CONTROL_DEVICE_NAME L"\\Device\\Http\\Control"
  26. #define HTTP_APP_POOL_DEVICE_NAME L"\\Device\\Http\\AppPool"
  27. #define HTTP_FILTER_DEVICE_NAME L"\\Device\\Http\\Filter"
  28. #define HTTP_DRIVER_NAME L"HTTP.SYS"
  29. #define HTTP_SERVICE_NAME L"HTTP"
  30. //
  31. // Names of the filters.
  32. //
  33. #define HTTP_SSL_SERVER_FILTER_CHANNEL_NAME L"SSLFilterChannel"
  34. #define HTTP_SSL_SERVER_FILTER_CHANNEL_NAME_LENGTH \
  35. (sizeof(HTTP_SSL_SERVER_FILTER_CHANNEL_NAME)-sizeof(WCHAR))
  36. #define HTTP_SSL_CLIENT_FILTER_CHANNEL_NAME L"SSLClientFilterChannel"
  37. #define HTTP_SSL_CLIENT_FILTER_CHANNEL_NAME_LENGTH \
  38. (sizeof(HTTP_SSL_CLIENT_FILTER_CHANNEL_NAME)-sizeof(WCHAR))
  39. //
  40. // The current interface version number. This version number must be
  41. // updated after any significant changes to the interface (especially
  42. // structure changes).
  43. //
  44. #define HTTP_INTERFACE_VERSION_MAJOR 0x0001
  45. #define HTTP_INTERFACE_VERSION_MINOR 0x0000
  46. //
  47. // The name of the EA (Extended Attribute) passed to NtCreateFile(). This
  48. // allows us to pass version information at the time the driver is opened,
  49. // allowing UL.SYS to immediately fail open requests with invalid version
  50. // numbers.
  51. //
  52. // N.B. The EA name (including the terminator) must be a multiple of eight
  53. // to ensure natural alignment of the HTTP_OPEN_PACKET structure used as
  54. // the EA value.
  55. //
  56. // 7654321076543210
  57. #define HTTP_OPEN_PACKET_NAME "UlOpenPacket000"
  58. #define HTTP_OPEN_PACKET_NAME_LENGTH (sizeof(HTTP_OPEN_PACKET_NAME) - 1)
  59. C_ASSERT( ((HTTP_OPEN_PACKET_NAME_LENGTH + 1) & 7) == 0 );
  60. //
  61. // The following structure is used as the value for the EA named above.
  62. //
  63. typedef struct HTTP_OPEN_PACKET
  64. {
  65. USHORT MajorVersion;
  66. USHORT MinorVersion;
  67. } HTTP_OPEN_PACKET, *PHTTP_OPEN_PACKET;
  68. //
  69. // Structures for IOCTL_HTTP_QUERY_CONTROL_CHANNEL and
  70. // IOCTL_HTTP_SET_CONTROL_CHANNEL.
  71. //
  72. typedef struct _HTTP_CONTROL_CHANNEL_INFO
  73. {
  74. HTTP_CONTROL_CHANNEL_INFORMATION_CLASS InformationClass;
  75. } HTTP_CONTROL_CHANNEL_INFO, *PHTTP_CONTROL_CHANNEL_INFO;
  76. //
  77. // Structures for IOCTL_HTTP_CREATE_CONFIG_GROUP,
  78. // IOCTL_HTTP_DELETE_CONFIG_GROUP, IOCTL_HTTP_QUERY_CONFIG_GROUP,
  79. // and IOCTL_HTTP_SET_CONFIG_GROUP.
  80. //
  81. typedef struct _HTTP_CONFIG_GROUP_INFO
  82. {
  83. HTTP_CONFIG_GROUP_ID ConfigGroupId;
  84. HTTP_CONFIG_GROUP_INFORMATION_CLASS InformationClass;
  85. } HTTP_CONFIG_GROUP_INFO, *PHTTP_CONFIG_GROUP_INFO;
  86. //
  87. // Structures for IOCTL_HTTP_ADD_URL_TO_CONFIG_GROUP and
  88. // IOCTL_HTTP_REMOVE_URL_FROM_CONFIG_GROUP.
  89. //
  90. typedef struct _HTTP_CONFIG_GROUP_URL_INFO
  91. {
  92. HTTP_CONFIG_GROUP_ID ConfigGroupId;
  93. HTTP_URL_CONTEXT UrlContext;
  94. UNICODE_STRING FullyQualifiedUrl;
  95. } HTTP_CONFIG_GROUP_URL_INFO, *PHTTP_CONFIG_GROUP_URL_INFO;
  96. //
  97. // Structures for IOCTL_HTTP_REMOVE_ALL_URLS_FROM_CONFIG_GROUP.
  98. //
  99. typedef struct _HTTP_REMOVE_ALL_URLS_INFO
  100. {
  101. HTTP_CONFIG_GROUP_ID ConfigGroupId;
  102. } HTTP_REMOVE_ALL_URLS_INFO, *PHTTP_REMOVE_ALL_URLS_INFO;
  103. //
  104. // Structures for IOCTL_HTTP_CREATE_APP_POOL.
  105. //
  106. typedef struct _HTTP_CREATE_APP_POOL_INFO
  107. {
  108. UNICODE_STRING AppPoolName;
  109. } HTTP_CREATE_APP_POOL_INFO, *PHTTP_CREATE_APP_POOL_INFO;
  110. //
  111. // Structures for IOCTL_HTTP_QUERY_APP_POOL_INFORMATION and
  112. // IOCTL_HTTP_SET_APP_POOL_INFORMATION.
  113. //
  114. typedef struct _HTTP_APP_POOL_INFO
  115. {
  116. HTTP_APP_POOL_INFORMATION_CLASS InformationClass;
  117. } HTTP_APP_POOL_INFO, *PHTTP_APP_POOL_INFO;
  118. //
  119. // Structures for IOCTL_HTTP_ADD_TRANSIENT_URL and
  120. // IOCTL_HTTP_REMOVE_TRANSIENT_URL.
  121. //
  122. typedef struct _HTTP_TRANSIENT_URL_INFO
  123. {
  124. UNICODE_STRING FullyQualifiedUrl;
  125. } HTTP_TRANSIENT_URL_INFO, *PHTTP_TRANSIENT_URL_INFO;
  126. //
  127. // Structures for IOCTL_HTTP_RECEIVE_HTTP_REQUEST and
  128. // IOCTL_HTTP_RECEIVE_ENTITY_BODY.
  129. //
  130. typedef struct _HTTP_RECEIVE_REQUEST_INFO
  131. {
  132. HTTP_REQUEST_ID RequestId;
  133. ULONG Flags;
  134. } HTTP_RECEIVE_REQUEST_INFO, *PHTTP_RECEIVE_REQUEST_INFO;
  135. //
  136. // Structures for IOCTL_HTTP_SEND_HTTP_RESPONSE.
  137. //
  138. typedef struct _HTTP_SEND_HTTP_RESPONSE_INFO
  139. {
  140. PHTTP_RESPONSE pHttpResponse;
  141. ULONG EntityChunkCount;
  142. PHTTP_DATA_CHUNK pEntityChunks;
  143. HTTP_CACHE_POLICY CachePolicy;
  144. HTTP_REQUEST_ID RequestId;
  145. ULONG Flags;
  146. PHTTP_LOG_FIELDS_DATA pLogData;
  147. } HTTP_SEND_HTTP_RESPONSE_INFO, *PHTTP_SEND_HTTP_RESPONSE_INFO;
  148. //
  149. // Structures for IOCTL_HTTP_FLUSH_RESPONSE_CACHE.
  150. //
  151. typedef struct _HTTP_FLUSH_RESPONSE_CACHE_INFO
  152. {
  153. UNICODE_STRING FullyQualifiedUrl;
  154. ULONG Flags;
  155. } HTTP_FLUSH_RESPONSE_CACHE_INFO, *PHTTP_FLUSH_RESPONSE_CACHE_INFO;
  156. //
  157. // Structures for IOCTL_HTTP_WAIT_FOR_DISCONNECT.
  158. //
  159. typedef struct _HTTP_WAIT_FOR_DISCONNECT_INFO
  160. {
  161. HTTP_CONNECTION_ID ConnectionId;
  162. } HTTP_WAIT_FOR_DISCONNECT_INFO, *PHTTP_WAIT_FOR_DISCONNECT_INFO;
  163. //
  164. // Structures for IOCTL_HTTP_FILTER_RECEIVE_CLIENT_CERT
  165. //
  166. typedef struct _HTTP_FILTER_RECEIVE_CLIENT_CERT_INFO
  167. {
  168. HTTP_CONNECTION_ID ConnectionId;
  169. ULONG Flags;
  170. } HTTP_FILTER_RECEIVE_CLIENT_CERT_INFO, *PHTTP_FILTER_RECEIVE_CLIENT_CERT_INFO;
  171. //
  172. // HTTP IOCTL code definitions.
  173. //
  174. // N.B. To ensure the efficient of the code generated by HTTP's
  175. // IOCTL dispatcher, these IOCTL codes should be contiguous
  176. // (no gaps).
  177. //
  178. // N.B. If new IOCTLs are added here, update the lookup table in
  179. // devctrl.c.
  180. //
  181. #define _HTTP_CTL_CODE(request, method, access) \
  182. CTL_CODE( FILE_DEVICE_NETWORK, request, method, access )
  183. #define _HTTP_REQUEST(ioctl) \
  184. ((((ULONG)(ioctl)) >> 2) & 0x03FF)
  185. #define HTTP_QUERY_CONTROL_CHANNEL 0
  186. #define HTTP_SET_CONTROL_CHANNEL 1
  187. #define HTTP_CREATE_CONFIG_GROUP 2
  188. #define HTTP_DELETE_CONFIG_GROUP 3
  189. #define HTTP_QUERY_CONFIG_GROUP 4
  190. #define HTTP_SET_CONFIG_GROUP 5
  191. #define HTTP_ADD_URL_TO_CONFIG_GROUP 6
  192. #define HTTP_REMOVE_URL_FROM_CONFIG_GROUP 7
  193. #define HTTP_QUERY_APP_POOL_INFORMATION 8
  194. #define HTTP_SET_APP_POOL_INFORMATION 9
  195. #define HTTP_RECEIVE_HTTP_REQUEST 10
  196. #define HTTP_RECEIVE_ENTITY_BODY 11
  197. #define HTTP_SEND_HTTP_RESPONSE 12
  198. #define HTTP_SEND_ENTITY_BODY 13
  199. #define HTTP_FLUSH_RESPONSE_CACHE 14
  200. #define HTTP_WAIT_FOR_DEMAND_START 15
  201. #define HTTP_WAIT_FOR_DISCONNECT 16
  202. #define HTTP_REMOVE_ALL_URLS_FROM_CONFIG_GROUP 17
  203. #define HTTP_ADD_TRANSIENT_URL 18
  204. #define HTTP_REMOVE_TRANSIENT_URL 19
  205. #define HTTP_FILTER_ACCEPT 20
  206. #define HTTP_FILTER_CLOSE 21
  207. #define HTTP_FILTER_RAW_READ 22
  208. #define HTTP_FILTER_RAW_WRITE 23
  209. #define HTTP_FILTER_APP_READ 24
  210. #define HTTP_FILTER_APP_WRITE 25
  211. #define HTTP_FILTER_RECEIVE_CLIENT_CERT 26
  212. #define HTTP_GET_COUNTERS 27
  213. #define HTTP_NUM_IOCTLS 28
  214. #define IOCTL_HTTP_QUERY_CONTROL_CHANNEL \
  215. _HTTP_CTL_CODE( HTTP_QUERY_CONTROL_CHANNEL, \
  216. METHOD_OUT_DIRECT, \
  217. FILE_READ_ACCESS )
  218. #define IOCTL_HTTP_SET_CONTROL_CHANNEL \
  219. _HTTP_CTL_CODE( HTTP_SET_CONTROL_CHANNEL, \
  220. METHOD_IN_DIRECT, \
  221. FILE_WRITE_ACCESS )
  222. #define IOCTL_HTTP_CREATE_CONFIG_GROUP \
  223. _HTTP_CTL_CODE( HTTP_CREATE_CONFIG_GROUP, \
  224. METHOD_BUFFERED, \
  225. FILE_WRITE_ACCESS )
  226. #define IOCTL_HTTP_DELETE_CONFIG_GROUP \
  227. _HTTP_CTL_CODE( HTTP_DELETE_CONFIG_GROUP, \
  228. METHOD_BUFFERED, \
  229. FILE_WRITE_ACCESS )
  230. #define IOCTL_HTTP_QUERY_CONFIG_GROUP \
  231. _HTTP_CTL_CODE( HTTP_QUERY_CONFIG_GROUP, \
  232. METHOD_OUT_DIRECT, \
  233. FILE_READ_ACCESS )
  234. #define IOCTL_HTTP_SET_CONFIG_GROUP \
  235. _HTTP_CTL_CODE( HTTP_SET_CONFIG_GROUP, \
  236. METHOD_IN_DIRECT, \
  237. FILE_WRITE_ACCESS )
  238. #define IOCTL_HTTP_ADD_URL_TO_CONFIG_GROUP \
  239. _HTTP_CTL_CODE( HTTP_ADD_URL_TO_CONFIG_GROUP, \
  240. METHOD_BUFFERED, \
  241. FILE_WRITE_ACCESS )
  242. #define IOCTL_HTTP_REMOVE_URL_FROM_CONFIG_GROUP \
  243. _HTTP_CTL_CODE( HTTP_REMOVE_URL_FROM_CONFIG_GROUP, \
  244. METHOD_BUFFERED, \
  245. FILE_WRITE_ACCESS )
  246. #define IOCTL_HTTP_QUERY_APP_POOL_INFORMATION \
  247. _HTTP_CTL_CODE( HTTP_QUERY_APP_POOL_INFORMATION, \
  248. METHOD_OUT_DIRECT, \
  249. FILE_READ_ACCESS )
  250. #define IOCTL_HTTP_SET_APP_POOL_INFORMATION \
  251. _HTTP_CTL_CODE( HTTP_SET_APP_POOL_INFORMATION, \
  252. METHOD_IN_DIRECT, \
  253. FILE_WRITE_ACCESS )
  254. #define IOCTL_HTTP_RECEIVE_HTTP_REQUEST \
  255. _HTTP_CTL_CODE( HTTP_RECEIVE_HTTP_REQUEST, \
  256. METHOD_OUT_DIRECT, \
  257. FILE_READ_ACCESS )
  258. #define IOCTL_HTTP_RECEIVE_ENTITY_BODY \
  259. _HTTP_CTL_CODE( HTTP_RECEIVE_ENTITY_BODY, \
  260. METHOD_OUT_DIRECT, \
  261. FILE_READ_ACCESS )
  262. #define IOCTL_HTTP_SEND_HTTP_RESPONSE \
  263. _HTTP_CTL_CODE( HTTP_SEND_HTTP_RESPONSE, \
  264. METHOD_NEITHER, \
  265. FILE_READ_ACCESS )
  266. #define IOCTL_HTTP_SEND_ENTITY_BODY \
  267. _HTTP_CTL_CODE( HTTP_SEND_ENTITY_BODY, \
  268. METHOD_NEITHER, \
  269. FILE_READ_ACCESS )
  270. #define IOCTL_HTTP_FLUSH_RESPONSE_CACHE \
  271. _HTTP_CTL_CODE( HTTP_FLUSH_RESPONSE_CACHE, \
  272. METHOD_BUFFERED, \
  273. FILE_READ_ACCESS )
  274. #define IOCTL_HTTP_WAIT_FOR_DEMAND_START \
  275. _HTTP_CTL_CODE( HTTP_WAIT_FOR_DEMAND_START, \
  276. METHOD_BUFFERED, \
  277. FILE_WRITE_ACCESS )
  278. #define IOCTL_HTTP_WAIT_FOR_DISCONNECT \
  279. _HTTP_CTL_CODE( HTTP_WAIT_FOR_DISCONNECT, \
  280. METHOD_BUFFERED, \
  281. FILE_READ_ACCESS )
  282. #define IOCTL_HTTP_REMOVE_ALL_URLS_FROM_CONFIG_GROUP \
  283. _HTTP_CTL_CODE( HTTP_REMOVE_ALL_URLS_FROM_CONFIG_GROUP, \
  284. METHOD_BUFFERED, \
  285. FILE_WRITE_ACCESS )
  286. #define IOCTL_HTTP_ADD_TRANSIENT_URL \
  287. _HTTP_CTL_CODE( HTTP_ADD_TRANSIENT_URL, \
  288. METHOD_BUFFERED, \
  289. FILE_WRITE_ACCESS )
  290. #define IOCTL_HTTP_REMOVE_TRANSIENT_URL \
  291. _HTTP_CTL_CODE( HTTP_REMOVE_TRANSIENT_URL, \
  292. METHOD_BUFFERED, \
  293. FILE_WRITE_ACCESS )
  294. #define IOCTL_HTTP_FILTER_ACCEPT \
  295. _HTTP_CTL_CODE( HTTP_FILTER_ACCEPT, \
  296. METHOD_OUT_DIRECT, \
  297. FILE_READ_ACCESS )
  298. #define IOCTL_HTTP_FILTER_CLOSE \
  299. _HTTP_CTL_CODE( HTTP_FILTER_CLOSE, \
  300. METHOD_BUFFERED, \
  301. FILE_READ_ACCESS )
  302. #define IOCTL_HTTP_FILTER_RAW_READ \
  303. _HTTP_CTL_CODE( HTTP_FILTER_RAW_READ, \
  304. METHOD_OUT_DIRECT, \
  305. FILE_READ_ACCESS )
  306. #define IOCTL_HTTP_FILTER_RAW_WRITE \
  307. _HTTP_CTL_CODE( HTTP_FILTER_RAW_WRITE, \
  308. METHOD_IN_DIRECT, \
  309. FILE_READ_ACCESS )
  310. #define IOCTL_HTTP_FILTER_APP_READ \
  311. _HTTP_CTL_CODE( HTTP_FILTER_APP_READ, \
  312. METHOD_OUT_DIRECT, \
  313. FILE_READ_ACCESS )
  314. #define IOCTL_HTTP_FILTER_APP_WRITE \
  315. _HTTP_CTL_CODE( HTTP_FILTER_APP_WRITE, \
  316. METHOD_IN_DIRECT, \
  317. FILE_READ_ACCESS )
  318. #define IOCTL_HTTP_FILTER_RECEIVE_CLIENT_CERT \
  319. _HTTP_CTL_CODE( HTTP_FILTER_RECEIVE_CLIENT_CERT, \
  320. METHOD_OUT_DIRECT, \
  321. FILE_READ_ACCESS )
  322. #define IOCTL_HTTP_GET_COUNTERS \
  323. _HTTP_CTL_CODE( HTTP_GET_COUNTERS, \
  324. METHOD_OUT_DIRECT, \
  325. FILE_READ_ACCESS )
  326. #ifdef __cplusplus
  327. } // extern "C"
  328. #endif // __cplusplus
  329. #endif // _HTTP_H_