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.

466 lines
8.4 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. httpapi.h
  5. Abstract:
  6. This module defines the public HTTP stack (Universal Listener and
  7. Universal Client) interface.
  8. Contains everything a user of HTTPAPI.DLL would need.
  9. Author:
  10. Keith Moore (keithmo) 29-Jul-1998
  11. Revision History:
  12. Chun Ye (chunye) 27-Sep-2000
  13. Renamed UL_* to HTTP_*.
  14. --*/
  15. #ifndef _HTTPAPI_H_
  16. #define _HTTPAPI_H_
  17. #include <httpdef.h>
  18. //
  19. // Define our API linkage.
  20. //
  21. #if !defined(HTTPAPI_LINKAGE)
  22. #define HTTPAPI_LINKAGE DECLSPEC_IMPORT
  23. #endif // !HTTPAPI_LINKAGE
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif // __cplusplus
  27. //
  28. // Initialize/terminate APIs.
  29. //
  30. HTTPAPI_LINKAGE
  31. ULONG
  32. WINAPI
  33. HttpInitialize(
  34. IN ULONG Reserved // must be zero
  35. );
  36. HTTPAPI_LINKAGE
  37. VOID
  38. WINAPI
  39. HttpTerminate(
  40. VOID
  41. );
  42. //
  43. // Control channel APIs.
  44. //
  45. HTTPAPI_LINKAGE
  46. ULONG
  47. WINAPI
  48. HttpOpenControlChannel(
  49. OUT PHANDLE pControlChannelHandle,
  50. IN ULONG Options
  51. );
  52. HTTPAPI_LINKAGE
  53. ULONG
  54. WINAPI
  55. HttpQueryControlChannelInformation(
  56. IN HANDLE ControlChannelHandle,
  57. IN HTTP_CONTROL_CHANNEL_INFORMATION_CLASS InformationClass,
  58. OUT PVOID pControlChannelInformation,
  59. IN ULONG Length,
  60. OUT PULONG pReturnLength OPTIONAL
  61. );
  62. HTTPAPI_LINKAGE
  63. ULONG
  64. WINAPI
  65. HttpSetControlChannelInformation(
  66. IN HANDLE ControlChannelHandle,
  67. IN HTTP_CONTROL_CHANNEL_INFORMATION_CLASS InformationClass,
  68. IN PVOID pControlChannelInformation,
  69. IN ULONG Length
  70. );
  71. //
  72. // Configuration Group APIs.
  73. //
  74. HTTPAPI_LINKAGE
  75. ULONG
  76. WINAPI
  77. HttpCreateConfigGroup(
  78. IN HANDLE ControlChannelHandle,
  79. OUT PHTTP_CONFIG_GROUP_ID pConfigGroupId
  80. );
  81. HTTPAPI_LINKAGE
  82. ULONG
  83. WINAPI
  84. HttpDeleteConfigGroup(
  85. IN HANDLE ControlChannelHandle,
  86. IN HTTP_CONFIG_GROUP_ID ConfigGroupId
  87. );
  88. HTTPAPI_LINKAGE
  89. ULONG
  90. WINAPI
  91. HttpAddUrlToConfigGroup(
  92. IN HANDLE ControlChannelHandle,
  93. IN HTTP_CONFIG_GROUP_ID ConfigGroupId,
  94. IN PCWSTR pFullyQualifiedUrl,
  95. IN HTTP_URL_CONTEXT UrlContext
  96. );
  97. HTTPAPI_LINKAGE
  98. ULONG
  99. WINAPI
  100. HttpRemoveUrlFromConfigGroup(
  101. IN HANDLE ControlChannelHandle,
  102. IN HTTP_CONFIG_GROUP_ID ConfigGroupId,
  103. IN PCWSTR pFullyQualifiedUrl
  104. );
  105. HTTPAPI_LINKAGE
  106. ULONG
  107. WINAPI
  108. HttpRemoveAllUrlsFromConfigGroup(
  109. IN HANDLE ControlChannelHandle,
  110. IN HTTP_CONFIG_GROUP_ID ConfigGroupId
  111. );
  112. HTTPAPI_LINKAGE
  113. ULONG
  114. WINAPI
  115. HttpQueryConfigGroupInformation(
  116. IN HANDLE ControlChannelHandle,
  117. IN HTTP_CONFIG_GROUP_ID ConfigGroupId,
  118. IN HTTP_CONFIG_GROUP_INFORMATION_CLASS InformationClass,
  119. OUT PVOID pConfigGroupInformation,
  120. IN ULONG Length,
  121. OUT PULONG pReturnLength OPTIONAL
  122. );
  123. HTTPAPI_LINKAGE
  124. ULONG
  125. WINAPI
  126. HttpSetConfigGroupInformation(
  127. IN HANDLE ControlChannelHandle,
  128. IN HTTP_CONFIG_GROUP_ID ConfigGroupId,
  129. IN HTTP_CONFIG_GROUP_INFORMATION_CLASS InformationClass,
  130. IN PVOID pConfigGroupInformation,
  131. IN ULONG Length
  132. );
  133. //
  134. // Application Pool manipulation APIs.
  135. //
  136. HTTPAPI_LINKAGE
  137. ULONG
  138. WINAPI
  139. HttpCreateAppPool(
  140. OUT PHANDLE pAppPoolHandle,
  141. IN PCWSTR pAppPoolName,
  142. IN LPSECURITY_ATTRIBUTES pSecurityAttributes OPTIONAL,
  143. IN ULONG Options
  144. );
  145. HTTPAPI_LINKAGE
  146. ULONG
  147. WINAPI
  148. HttpOpenAppPool(
  149. OUT PHANDLE pAppPoolHandle,
  150. IN PCWSTR pAppPoolName,
  151. IN ULONG Options
  152. );
  153. HTTPAPI_LINKAGE
  154. ULONG
  155. WINAPI
  156. HttpQueryAppPoolInformation(
  157. IN HANDLE AppPoolHandle,
  158. IN HTTP_APP_POOL_INFORMATION_CLASS InformationClass,
  159. OUT PVOID pAppPoolInformation,
  160. IN ULONG Length,
  161. OUT PULONG pReturnLength OPTIONAL
  162. );
  163. HTTPAPI_LINKAGE
  164. ULONG
  165. WINAPI
  166. HttpSetAppPoolInformation(
  167. IN HANDLE AppPoolHandle,
  168. IN HTTP_APP_POOL_INFORMATION_CLASS InformationClass,
  169. IN PVOID pAppPoolInformation,
  170. IN ULONG Length
  171. );
  172. HTTPAPI_LINKAGE
  173. ULONG
  174. WINAPI
  175. HttpAddTransientUrl(
  176. IN HANDLE AppPoolHandle,
  177. IN PCWSTR pFullyQualifiedUrl
  178. );
  179. HTTPAPI_LINKAGE
  180. ULONG
  181. WINAPI
  182. HttpRemoveTransientUrl(
  183. IN HANDLE AppPoolHandle,
  184. IN PCWSTR pFullyQualifiedUrl
  185. );
  186. //
  187. // HTTP I/O APIs.
  188. //
  189. HTTPAPI_LINKAGE
  190. ULONG
  191. WINAPI
  192. HttpReceiveHttpRequest(
  193. IN HANDLE AppPoolHandle,
  194. IN HTTP_REQUEST_ID RequestId,
  195. IN ULONG Flags,
  196. OUT PHTTP_REQUEST pRequestBuffer,
  197. IN ULONG RequestBufferLength,
  198. OUT PULONG pBytesReceived OPTIONAL,
  199. IN LPOVERLAPPED pOverlapped OPTIONAL
  200. );
  201. HTTPAPI_LINKAGE
  202. ULONG
  203. WINAPI
  204. HttpReceiveEntityBody(
  205. IN HANDLE AppPoolHandle,
  206. IN HTTP_REQUEST_ID RequestId,
  207. IN ULONG Flags,
  208. OUT PVOID pBuffer,
  209. IN ULONG BufferLength,
  210. OUT PULONG pBytesReceived OPTIONAL,
  211. IN LPOVERLAPPED pOverlapped OPTIONAL
  212. );
  213. HTTPAPI_LINKAGE
  214. ULONG
  215. WINAPI
  216. HttpSendHttpResponse(
  217. IN HANDLE AppPoolHandle,
  218. IN HTTP_REQUEST_ID RequestId,
  219. IN ULONG Flags,
  220. IN PHTTP_RESPONSE pHttpResponse,
  221. IN PHTTP_CACHE_POLICY pCachePolicy OPTIONAL,
  222. OUT PULONG pBytesSent OPTIONAL,
  223. IN LPOVERLAPPED pOverlapped OPTIONAL,
  224. IN PHTTP_LOG_FIELDS_DATA pLogData OPTIONAL
  225. );
  226. HTTPAPI_LINKAGE
  227. ULONG
  228. WINAPI
  229. HttpSendEntityBody(
  230. IN HANDLE AppPoolHandle,
  231. IN HTTP_REQUEST_ID RequestId,
  232. IN ULONG Flags,
  233. IN ULONG EntityChunkCount OPTIONAL,
  234. IN PHTTP_DATA_CHUNK pEntityChunks OPTIONAL,
  235. OUT PULONG pBytesSent OPTIONAL,
  236. IN LPOVERLAPPED pOverlapped OPTIONAL,
  237. IN PHTTP_LOG_FIELDS_DATA pLogData OPTIONAL
  238. );
  239. HTTPAPI_LINKAGE
  240. ULONG
  241. WINAPI
  242. HttpWaitForDisconnect(
  243. IN HANDLE AppPoolHandle,
  244. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  245. IN LPOVERLAPPED pOverlapped OPTIONAL
  246. );
  247. //
  248. // Response cache manipulation APIs.
  249. //
  250. HTTPAPI_LINKAGE
  251. ULONG
  252. WINAPI
  253. HttpFlushResponseCache(
  254. IN HANDLE AppPoolHandle,
  255. IN PCWSTR pFullyQualifiedUrl,
  256. IN ULONG Flags,
  257. IN LPOVERLAPPED pOverlapped OPTIONAL
  258. );
  259. //
  260. // Demand start notifications.
  261. //
  262. HTTPAPI_LINKAGE
  263. ULONG
  264. WINAPI
  265. HttpWaitForDemandStart(
  266. IN HANDLE AppPoolHandle,
  267. IN OUT PVOID pBuffer OPTIONAL,
  268. IN ULONG BufferLength OPTIONAL,
  269. IN PULONG pBytesReceived OPTIONAL,
  270. IN LPOVERLAPPED pOverlapped OPTIONAL
  271. );
  272. //
  273. // API calls for SSL/Filter helper process
  274. //
  275. HTTPAPI_LINKAGE
  276. ULONG
  277. WINAPI
  278. HttpCreateFilter(
  279. OUT PHANDLE pFilterHandle,
  280. IN PCWSTR pFilterName,
  281. IN LPSECURITY_ATTRIBUTES pSecurityAttributes OPTIONAL,
  282. IN ULONG Options
  283. );
  284. HTTPAPI_LINKAGE
  285. ULONG
  286. WINAPI
  287. HttpOpenFilter(
  288. OUT PHANDLE pFilterHandle,
  289. IN PCWSTR pFilterName,
  290. IN ULONG Options
  291. );
  292. HTTPAPI_LINKAGE
  293. ULONG
  294. WINAPI
  295. HttpFilterAccept(
  296. IN HANDLE FilterHandle,
  297. OUT PHTTP_RAW_CONNECTION_INFO pRawConnectionInfo,
  298. IN ULONG RawConnectionInfoSize,
  299. OUT PULONG pBytesReceived OPTIONAL,
  300. IN LPOVERLAPPED pOverlapped OPTIONAL
  301. );
  302. HTTPAPI_LINKAGE
  303. ULONG
  304. WINAPI
  305. HttpFilterClose(
  306. IN HANDLE FilterHandle,
  307. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  308. IN LPOVERLAPPED pOverlapped OPTIONAL
  309. );
  310. HTTPAPI_LINKAGE
  311. ULONG
  312. WINAPI
  313. HttpFilterRawRead(
  314. IN HANDLE FilterHandle,
  315. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  316. OUT PVOID pBuffer,
  317. IN ULONG BufferSize,
  318. OUT PULONG pBytesReceived OPTIONAL,
  319. IN LPOVERLAPPED pOverlapped OPTIONAL
  320. );
  321. HTTPAPI_LINKAGE
  322. ULONG
  323. WINAPI
  324. HttpFilterRawWrite(
  325. IN HANDLE FilterHandle,
  326. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  327. IN PVOID pBuffer,
  328. IN ULONG BufferSize,
  329. OUT PULONG pBytesReceived OPTIONAL,
  330. IN LPOVERLAPPED pOverlapped OPTIONAL
  331. );
  332. HTTPAPI_LINKAGE
  333. ULONG
  334. WINAPI
  335. HttpFilterAppRead(
  336. IN HANDLE FilterHandle,
  337. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  338. OUT PHTTP_FILTER_BUFFER pBuffer,
  339. IN ULONG BufferSize,
  340. OUT PULONG pBytesReceived OPTIONAL,
  341. IN LPOVERLAPPED pOverlapped OPTIONAL
  342. );
  343. HTTPAPI_LINKAGE
  344. ULONG
  345. WINAPI
  346. HttpFilterAppWrite(
  347. IN HANDLE FilterHandle,
  348. IN HTTP_RAW_CONNECTION_ID ConnectionId,
  349. IN PHTTP_FILTER_BUFFER pBuffer,
  350. IN ULONG BufferSize,
  351. OUT PULONG pBytesReceived OPTIONAL,
  352. IN LPOVERLAPPED pOverlapped OPTIONAL
  353. );
  354. //
  355. // Application pool calls for SSL
  356. //
  357. HTTPAPI_LINKAGE
  358. ULONG
  359. WINAPI
  360. HttpReceiveClientCertificate(
  361. IN HANDLE AppPoolHandle,
  362. IN HTTP_CONNECTION_ID ConnectionId,
  363. IN ULONG Flags,
  364. OUT PHTTP_SSL_CLIENT_CERT_INFO pSslClientCertInfo,
  365. IN ULONG SslClientCertInfoSize,
  366. OUT PULONG pBytesReceived OPTIONAL,
  367. IN LPOVERLAPPED pOverlapped
  368. );
  369. //
  370. // Counter Group APIs.
  371. //
  372. HTTPAPI_LINKAGE
  373. ULONG
  374. WINAPI
  375. HttpGetCounters(
  376. IN HANDLE ControlChannelHandle,
  377. IN HTTP_COUNTER_GROUP CounterGroup,
  378. IN OUT PULONG pCounterBlockSize,
  379. IN OUT PVOID pCounterBlocks,
  380. OUT PULONG pNumInstances OPTIONAL
  381. );
  382. #ifdef __cplusplus
  383. } // extern "C"
  384. #endif // __cplusplus
  385. #endif // _ULAPI_H_