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.

1582 lines
55 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winhttp.h
  5. Abstract:
  6. Contains manifests, macros, types and prototypes for Windows HTTP Services
  7. --*/
  8. #if !defined(_WINHTTPX_)
  9. #define _WINHTTPX_
  10. ;begin_internal
  11. #if !defined(_WINHTTPXEX_)
  12. #define _WINHTTPXEX_
  13. ;end_internal
  14. /*
  15. * Set up Structure Packing to be 4 bytes for all winhttp structures
  16. */
  17. #if defined(_WIN64)
  18. #include <pshpack8.h>
  19. #else
  20. #include <pshpack4.h>
  21. #endif
  22. ;begin_both
  23. #if defined(__cplusplus)
  24. extern "C" {
  25. #endif
  26. ;end_both
  27. #if !defined(_WINHTTP_INTERNAL_)
  28. #define WINHTTPAPI DECLSPEC_IMPORT
  29. #else
  30. ;begin_internal
  31. #define INTERNETAPI
  32. ;end_internal
  33. #define WINHTTPAPI
  34. #endif
  35. #define BOOLAPI WINHTTPAPI BOOL WINAPI
  36. //
  37. // types
  38. //
  39. typedef LPVOID HINTERNET;
  40. typedef HINTERNET * LPHINTERNET;
  41. typedef WORD INTERNET_PORT;
  42. typedef INTERNET_PORT * LPINTERNET_PORT;
  43. //
  44. // manifests
  45. //
  46. #define INTERNET_DEFAULT_PORT 0 // use the protocol-specific default
  47. #define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP "
  48. #define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS "
  49. // flags for WinHttpOpen():
  50. #define WINHTTP_FLAG_ASYNC 0x10000000 // this session is asynchronous (where supported)
  51. // flags for WinHttpOpenRequest():
  52. #define WINHTTP_FLAG_SECURE 0x00800000 // use SSL if applicable (HTTPS)
  53. #define WINHTTP_FLAG_ESCAPE_PERCENT 0x00000004 // if escaping enabled, escape percent as well
  54. #define WINHTTP_FLAG_NULL_CODEPAGE 0x00000008 // assume all symbols are ASCII, use fast convertion
  55. #define WINHTTP_FLAG_BYPASS_PROXY_CACHE 0x00000100 // add "pragma: no-cache" request header
  56. #define WINHTTP_FLAG_REFRESH WINHTTP_FLAG_BYPASS_PROXY_CACHE
  57. #define WINHTTP_FLAG_ESCAPE_DISABLE 0x00000040 // disable escaping
  58. #define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY 0x00000080 // if escaping enabled escape path part, but do not escape query
  59. ;begin_internal
  60. // url-parsing flags added internally
  61. //#define WINHTTP_FLAG_DEFAULT_ESCAPE 0x00000010 //obloete because of WIHHTTP_FLAG_ESCAPE_DISABLE
  62. #define WINHTTP_FLAG_VALID_HOSTNAME 0x00000020 //only for server name; fast conversion is performed, no escaping
  63. // These flags are superseded by WINHTTP_OPTION_DISABLE_FEATURE
  64. #define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 // use keep-alive semantics
  65. #define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 // don't handle redirections automatically
  66. #define INTERNET_FLAG_NO_COOKIES 0x00080000 // no automatic cookie handling
  67. #define INTERNET_FLAG_NO_AUTH 0x00040000 // no automatic authentication handling
  68. ;end_internal
  69. #define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100
  70. #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 // expired X509 Cert.
  71. #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 // bad common name in X509 Cert.
  72. #define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE 0x00000200
  73. ;begin_internal
  74. // WARNING: these flags may become unsupported or done in a different way.
  75. // Security Ignore Flags, Allow HttpOpenRequest to overide
  76. // Secure Channel (SSL) failures of the following types.
  77. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 // ex: https:// to http://
  78. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 // ex: http:// to https://
  79. #define SECURITY_INTERNET_MASK (SECURITY_FLAG_IGNORE_CERT_CN_INVALID | \
  80. SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | \
  81. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | \
  82. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | \
  83. SECURITY_FLAG_IGNORE_UNKNOWN_CA | \
  84. SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)
  85. ;end_internal
  86. ;begin_internal
  87. // parameter validation masks
  88. #define WINHTTP_OPEN_FLAGS_MASK (WINHTTP_FLAG_ASYNC) // valid flags mask
  89. #define WINHTTP_CONNECT_FLAG_NO_INDICATION 0x00000001
  90. #define WINHTTP_CONNECT_FLAGS_MASK WINHTTP_CONNECT_FLAG_NO_INDICATION
  91. #define WINHTTP_OPEN_REQUEST_FLAGS_MASK (WINHTTP_FLAG_SECURE | \
  92. WINHTTP_FLAG_ESCAPE_PERCENT | \
  93. WINHTTP_FLAG_NULL_CODEPAGE | \
  94. WINHTTP_FLAG_BYPASS_PROXY_CACHE | \
  95. WINHTTP_FLAG_ESCAPE_DISABLE | \
  96. WINHTTP_FLAG_ESCAPE_DISABLE_QUERY)
  97. ;end_internal
  98. //
  99. // WINHTTP_ASYNC_RESULT - this structure is returned to the application via
  100. // the callback with WINHTTP_CALLBACK_STATUS_REQUEST_COMPLETE. It is not sufficient to
  101. // just return the result of the async operation. If the API failed then the
  102. // app cannot call GetLastError() because the thread context will be incorrect.
  103. // Both the value returned by the async API and any resultant error code are
  104. // made available. The app need not check dwError if dwResult indicates that
  105. // the API succeeded (in this case dwError will be ERROR_SUCCESS)
  106. //
  107. typedef struct
  108. {
  109. DWORD_PTR dwResult; // indicates which async API has encountered an error
  110. DWORD dwError; // the error code if the API failed
  111. }
  112. WINHTTP_ASYNC_RESULT, * LPWINHTTP_ASYNC_RESULT;
  113. //
  114. // HTTP_VERSION_INFO - query or set global HTTP version (1.0 or 1.1)
  115. //
  116. typedef struct
  117. {
  118. DWORD dwMajorVersion;
  119. DWORD dwMinorVersion;
  120. }
  121. HTTP_VERSION_INFO, * LPHTTP_VERSION_INFO;
  122. //
  123. // INTERNET_SCHEME - URL scheme type
  124. //
  125. typedef int INTERNET_SCHEME, * LPINTERNET_SCHEME;
  126. #define INTERNET_SCHEME_HTTP (1)
  127. #define INTERNET_SCHEME_HTTPS (2)
  128. ;begin_internal
  129. #define INTERNET_SCHEME_PARTIAL (-2)
  130. #define INTERNET_SCHEME_UNKNOWN (-1)
  131. #define INTERNET_SCHEME_DEFAULT (0)
  132. #define INTERNET_SCHEME_SOCKS (3)
  133. #define INTERNET_SCHEME_FIRST (INTERNET_SCHEME_HTTP)
  134. #define INTERNET_SCHEME_LAST (INTERNET_SCHEME_SOCKS)
  135. ;end_internal
  136. //
  137. // URL_COMPONENTS - the constituent parts of an URL. Used in WinHttpCrackUrl()
  138. // and WinHttpCreateUrl()
  139. //
  140. // For WinHttpCrackUrl(), if a pointer field and its corresponding length field
  141. // are both 0 then that component is not returned. If the pointer field is NULL
  142. // but the length field is not zero, then both the pointer and length fields are
  143. // returned if both pointer and corresponding length fields are non-zero then
  144. // the pointer field points to a buffer where the component is copied. The
  145. // component may be un-escaped, depending on dwFlags
  146. //
  147. // For WinHttpCreateUrl(), the pointer fields should be NULL if the component
  148. // is not required. If the corresponding length field is zero then the pointer
  149. // field is the address of a zero-terminated string. If the length field is not
  150. // zero then it is the string length of the corresponding pointer field
  151. //
  152. #pragma warning( disable : 4121 ) // disable alignment warning
  153. typedef struct
  154. {
  155. DWORD dwStructSize; // size of this structure. Used in version check
  156. LPWSTR lpszScheme; // pointer to scheme name
  157. DWORD dwSchemeLength; // length of scheme name
  158. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  159. LPWSTR lpszHostName; // pointer to host name
  160. DWORD dwHostNameLength; // length of host name
  161. INTERNET_PORT nPort; // converted port number
  162. LPWSTR lpszUserName; // pointer to user name
  163. DWORD dwUserNameLength; // length of user name
  164. LPWSTR lpszPassword; // pointer to password
  165. DWORD dwPasswordLength; // length of password
  166. LPWSTR lpszUrlPath; // pointer to URL-path
  167. DWORD dwUrlPathLength; // length of URL-path
  168. LPWSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  169. DWORD dwExtraInfoLength; // length of extra information
  170. }
  171. URL_COMPONENTS, * LPURL_COMPONENTS;
  172. typedef URL_COMPONENTS URL_COMPONENTSW;
  173. typedef LPURL_COMPONENTS LPURL_COMPONENTSW;
  174. #pragma warning( default : 4121 ) // restore alignment warning
  175. //
  176. // WINHTTP_PROXY_INFO - structure supplied with WINHTTP_OPTION_PROXY to get/
  177. // set proxy information on a WinHttpOpen() handle
  178. //
  179. typedef struct
  180. {
  181. DWORD dwAccessType; // see WINHTTP_ACCESS_* types below
  182. LPWSTR lpszProxy; // proxy server list
  183. LPWSTR lpszProxyBypass; // proxy bypass list
  184. }
  185. WINHTTP_PROXY_INFO, * LPWINHTTP_PROXY_INFO;
  186. typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW;
  187. typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW;
  188. typedef struct
  189. {
  190. DWORD dwFlags;
  191. DWORD dwAutoDetectFlags;
  192. LPCWSTR lpszAutoConfigUrl;
  193. LPVOID lpvReserved;
  194. DWORD dwReserved;
  195. BOOL fAutoLogonIfChallenged;
  196. }
  197. WINHTTP_AUTOPROXY_OPTIONS;
  198. #define WINHTTP_AUTOPROXY_AUTO_DETECT 0x00000001
  199. #define WINHTTP_AUTOPROXY_CONFIG_URL 0x00000002
  200. #define WINHTTP_AUTOPROXY_RUN_INPROCESS 0x00010000
  201. #define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY 0x00020000
  202. //
  203. // Flags for dwAutoDetectFlags
  204. //
  205. #define WINHTTP_AUTO_DETECT_TYPE_DHCP 0x00000001
  206. #define WINHTTP_AUTO_DETECT_TYPE_DNS_A 0x00000002
  207. //
  208. // WINHTTP_CERTIFICATE_INFO lpBuffer - contains the certificate returned from
  209. // the server
  210. //
  211. typedef struct
  212. {
  213. //
  214. // ftExpiry - date the certificate expires.
  215. //
  216. FILETIME ftExpiry;
  217. //
  218. // ftStart - date the certificate becomes valid.
  219. //
  220. FILETIME ftStart;
  221. //
  222. // lpszSubjectInfo - the name of organization, site, and server
  223. // the cert. was issued for.
  224. //
  225. LPWSTR lpszSubjectInfo;
  226. //
  227. // lpszIssuerInfo - the name of orgainzation, site, and server
  228. // the cert was issues by.
  229. //
  230. LPWSTR lpszIssuerInfo;
  231. //
  232. // lpszProtocolName - the name of the protocol used to provide the secure
  233. // connection.
  234. //
  235. LPWSTR lpszProtocolName;
  236. //
  237. // lpszSignatureAlgName - the name of the algorithm used for signing
  238. // the certificate.
  239. //
  240. LPWSTR lpszSignatureAlgName;
  241. //
  242. // lpszEncryptionAlgName - the name of the algorithm used for
  243. // doing encryption over the secure channel (SSL) connection.
  244. //
  245. LPWSTR lpszEncryptionAlgName;
  246. //
  247. // dwKeySize - size of the key.
  248. //
  249. DWORD dwKeySize;
  250. }
  251. WINHTTP_CERTIFICATE_INFO;
  252. //
  253. // prototypes
  254. //
  255. BOOLAPI
  256. WinHttpTimeFromSystemTime
  257. (
  258. IN CONST SYSTEMTIME *pst, // input GMT time
  259. OUT LPWSTR pwszTime // output string buffer
  260. );
  261. //
  262. // constants for WinHttpTimeFromSystemTime
  263. //
  264. #define WINHTTP_TIME_FORMAT_BUFSIZE 62
  265. BOOLAPI
  266. WinHttpTimeToSystemTime
  267. (
  268. IN LPCWSTR pwszTime, // NULL terminated string
  269. OUT SYSTEMTIME *pst // output in GMT time
  270. );
  271. //
  272. // flags for CrackUrl() and CombineUrl()
  273. //
  274. #define ICU_NO_ENCODE 0x20000000 // Don't convert unsafe characters to escape sequence
  275. #define ICU_DECODE 0x10000000 // Convert %XX escape sequences to characters
  276. #define ICU_NO_META 0x08000000 // Don't convert .. etc. meta path sequences
  277. #define ICU_ENCODE_SPACES_ONLY 0x04000000 // Encode spaces only
  278. #define ICU_BROWSER_MODE 0x02000000 // Special encode/decode rules for browser
  279. #define ICU_ENCODE_PERCENT 0x00001000 // Encode any percent (ASCII25)
  280. // signs encountered, default is to not encode percent.
  281. BOOLAPI
  282. WinHttpCrackUrl
  283. (
  284. IN LPCWSTR pwszUrl,
  285. IN DWORD dwUrlLength,
  286. IN DWORD dwFlags,
  287. IN OUT LPURL_COMPONENTS lpUrlComponents
  288. );
  289. BOOLAPI
  290. WinHttpCreateUrl
  291. (
  292. IN LPURL_COMPONENTS lpUrlComponents,
  293. IN DWORD dwFlags,
  294. OUT LPWSTR pwszUrl,
  295. IN OUT LPDWORD lpdwUrlLength
  296. );
  297. //
  298. // flags for WinHttpCrackUrl() and WinHttpCreateUrl()
  299. //
  300. #define ICU_ESCAPE 0x80000000 // (un)escape URL characters
  301. BOOLAPI
  302. WinHttpCheckPlatform(void);
  303. WINHTTPAPI BOOL WINAPI WinHttpGetDefaultProxyConfiguration( IN OUT WINHTTP_PROXY_INFO * pProxyInfo);
  304. WINHTTPAPI BOOL WINAPI WinHttpSetDefaultProxyConfiguration( IN WINHTTP_PROXY_INFO * pProxyInfo);
  305. WINHTTPAPI
  306. HINTERNET
  307. WINAPI
  308. WinHttpOpen
  309. (
  310. IN LPCWSTR pwszUserAgent,
  311. IN DWORD dwAccessType,
  312. IN LPCWSTR pwszProxyName OPTIONAL,
  313. IN LPCWSTR pwszProxyBypass OPTIONAL,
  314. IN DWORD dwFlags
  315. );
  316. // WinHttpOpen dwAccessType values (also for WINHTTP_PROXY_INFO::dwAccessType)
  317. #define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0
  318. #define WINHTTP_ACCESS_TYPE_NO_PROXY 1
  319. #define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3
  320. // WinHttpOpen prettifiers for optional parameters
  321. #define WINHTTP_NO_PROXY_NAME NULL
  322. #define WINHTTP_NO_PROXY_BYPASS NULL
  323. BOOLAPI
  324. WinHttpCloseHandle
  325. (
  326. IN HINTERNET hInternet
  327. );
  328. WINHTTPAPI
  329. HINTERNET
  330. WINAPI
  331. WinHttpConnect
  332. (
  333. IN HINTERNET hSession,
  334. IN LPCWSTR pswzServerName,
  335. IN INTERNET_PORT nServerPort,
  336. IN DWORD dwReserved
  337. );
  338. BOOLAPI
  339. WinHttpReadData
  340. (
  341. IN HINTERNET hRequest,
  342. IN LPVOID lpBuffer,
  343. IN DWORD dwNumberOfBytesToRead,
  344. OUT LPDWORD lpdwNumberOfBytesRead
  345. );
  346. BOOLAPI
  347. WinHttpWriteData
  348. (
  349. IN HINTERNET hRequest,
  350. IN LPCVOID lpBuffer,
  351. IN DWORD dwNumberOfBytesToWrite,
  352. OUT LPDWORD lpdwNumberOfBytesWritten
  353. );
  354. BOOLAPI
  355. WinHttpQueryDataAvailable
  356. (
  357. IN HINTERNET hRequest,
  358. OUT LPDWORD lpdwNumberOfBytesAvailable OPTIONAL
  359. );
  360. BOOLAPI
  361. WinHttpQueryOption
  362. (
  363. IN HINTERNET hInternet,
  364. IN DWORD dwOption,
  365. OUT LPVOID lpBuffer OPTIONAL,
  366. IN OUT LPDWORD lpdwBufferLength
  367. );
  368. BOOLAPI
  369. WinHttpSetOption
  370. (
  371. IN HINTERNET hInternet,
  372. IN DWORD dwOption,
  373. IN LPVOID lpBuffer,
  374. IN DWORD dwBufferLength
  375. );
  376. BOOLAPI
  377. WinHttpSetTimeouts
  378. (
  379. IN HINTERNET hInternet, // Session/Request handle.
  380. IN int nResolveTimeout,
  381. IN int nConnectTimeout,
  382. IN int nSendTimeout,
  383. IN int nReceiveTimeout
  384. );
  385. //
  386. // options manifests for WinHttp{Query|Set}Option
  387. //
  388. #define WINHTTP_FIRST_OPTION WINHTTP_OPTION_CALLBACK
  389. #define WINHTTP_OPTION_CALLBACK 1
  390. #define WINHTTP_OPTION_RESOLVE_TIMEOUT 2
  391. #define WINHTTP_OPTION_CONNECT_TIMEOUT 3
  392. #define WINHTTP_OPTION_CONNECT_RETRIES 4
  393. #define WINHTTP_OPTION_SEND_TIMEOUT 5
  394. #define WINHTTP_OPTION_RECEIVE_TIMEOUT 6
  395. #define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT 7
  396. #define WINHTTP_OPTION_HANDLE_TYPE 9
  397. #define WINHTTP_OPTION_READ_BUFFER_SIZE 12
  398. #define WINHTTP_OPTION_WRITE_BUFFER_SIZE 13
  399. #define WINHTTP_OPTION_PARENT_HANDLE 21
  400. #define WINHTTP_OPTION_EXTENDED_ERROR 24
  401. #define WINHTTP_OPTION_SECURITY_FLAGS 31
  402. #define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT 32
  403. #define WINHTTP_OPTION_URL 34
  404. #define WINHTTP_OPTION_SECURITY_KEY_BITNESS 36
  405. #define WINHTTP_OPTION_PROXY 38
  406. ;begin_internal
  407. // WINHTTP_OPTION_VERSION is confusing, so we are killing it.
  408. #define WINHTTP_OPTION_VERSION 40
  409. ;end_internal
  410. #define WINHTTP_OPTION_USER_AGENT 41
  411. #define WINHTTP_OPTION_CONTEXT_VALUE 45
  412. #define WINHTTP_OPTION_CLIENT_CERT_CONTEXT 47
  413. #define WINHTTP_OPTION_REQUEST_PRIORITY 58
  414. #define WINHTTP_OPTION_HTTP_VERSION 59
  415. ;begin_internal
  416. #define WINHTTP_OPTION_ERROR_MASK 62
  417. ;end_internal
  418. #define WINHTTP_OPTION_DISABLE_FEATURE 63
  419. ;begin_internal
  420. // Pass in pointer to INTERNET_SECURITY_CONNECTION_INFO to be filled in.
  421. #define WINHTTP_OPTION_SECURITY_CONNECTION_INFO 66
  422. ;end_internal
  423. #define WINHTTP_OPTION_CODEPAGE 68
  424. #define WINHTTP_OPTION_MAX_CONNS_PER_SERVER 73
  425. #define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER 74
  426. #define WINHTTP_OPTION_AUTOLOGON_POLICY 77
  427. #define WINHTTP_OPTION_SERVER_CERT_CONTEXT 78
  428. #define WINHTTP_OPTION_ENABLE_FEATURE 79
  429. #define WINHTTP_OPTION_WORKER_THREAD_COUNT 80
  430. #define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT 81
  431. #define WINHTTP_OPTION_PASSPORT_COBRANDING_URL 82
  432. #define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH 83
  433. #define WINHTTP_OPTION_SECURE_PROTOCOLS 84
  434. #define WINHTTP_OPTION_ENABLETRACING 85
  435. #define WINHTTP_OPTION_PASSPORT_SIGN_OUT 86
  436. #define WINHTTP_OPTION_PASSPORT_RETURN_URL 87
  437. #define WINHTTP_OPTION_REDIRECT_POLICY 88
  438. #define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS 89
  439. #define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE 90
  440. #define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE 91
  441. #define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE 92
  442. #define WINHTTP_LAST_OPTION WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE
  443. #define WINHTTP_OPTION_USERNAME 0x1000
  444. #define WINHTTP_OPTION_PASSWORD 0x1001
  445. #define WINHTTP_OPTION_PROXY_USERNAME 0x1002
  446. #define WINHTTP_OPTION_PROXY_PASSWORD 0x1003
  447. ;begin_internal
  448. #define WINHTTP_LAST_OPTION_INTERNAL WINHTTP_LAST_OPTION
  449. #define WINHTTP_OPTION_MASK 0x0fff
  450. #define MAX_INTERNET_STRING_OPTION (WINHTTP_OPTION_PROXY_PASSWORD & WINHTTP_OPTION_MASK)
  451. #define NUM_INTERNET_STRING_OPTION (MAX_INTERNET_STRING_OPTION + 1)
  452. ;end_internal
  453. // manifest value for WINHTTP_OPTION_MAX_CONNS_PER_SERVER and WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER
  454. #define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF
  455. // values for WINHTTP_OPTION_AUTOLOGON_POLICY
  456. #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM 0
  457. #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW 1
  458. #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH 2
  459. #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM
  460. // values for WINHTTP_OPTION_REDIRECT_POLICY
  461. #define WINHTTP_OPTION_REDIRECT_POLICY_NEVER 0
  462. #define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP 1
  463. #define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS 2
  464. #define WINHTTP_OPTION_REDIRECT_POLICY_LAST WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
  465. #define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
  466. #define WINHTTP_DISABLE_PASSPORT_AUTH 0x00000000
  467. #define WINHTTP_ENABLE_PASSPORT_AUTH 0x10000000
  468. #define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000
  469. #define WINHTTP_ENABLE_PASSPORT_KEYRING 0x40000000
  470. ;begin_internal
  471. // values for WINHTTP_OPTION_ERROR_MASK
  472. #define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2
  473. ;end_internal
  474. // values for WINHTTP_OPTION_DISABLE_FEATURE
  475. #define WINHTTP_DISABLE_COOKIES 0x00000001
  476. #define WINHTTP_DISABLE_REDIRECTS 0x00000002
  477. #define WINHTTP_DISABLE_AUTHENTICATION 0x00000004
  478. #define WINHTTP_DISABLE_KEEP_ALIVE 0x00000008
  479. // values for WINHTTP_OPTION_ENABLE_FEATURE
  480. #define WINHTTP_ENABLE_SSL_REVOCATION 0x00000001
  481. #define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION 0x00000002
  482. //
  483. // winhttp handle types
  484. //
  485. #define WINHTTP_HANDLE_TYPE_SESSION 1
  486. #define WINHTTP_HANDLE_TYPE_CONNECT 2
  487. #define WINHTTP_HANDLE_TYPE_REQUEST 3
  488. //
  489. // values for auth schemes
  490. //
  491. #define WINHTTP_AUTH_SCHEME_BASIC 0x00000001
  492. #define WINHTTP_AUTH_SCHEME_NTLM 0x00000002
  493. #define WINHTTP_AUTH_SCHEME_PASSPORT 0x00000004
  494. #define WINHTTP_AUTH_SCHEME_DIGEST 0x00000008
  495. #define WINHTTP_AUTH_SCHEME_NEGOTIATE 0x00000010
  496. ;begin_internal
  497. #define WINHTTP_AUTH_SCHEME_KERBEROS 0x00000020
  498. ;end_internal
  499. // WinHttp supported Authentication Targets
  500. #define WINHTTP_AUTH_TARGET_SERVER 0x00000000
  501. #define WINHTTP_AUTH_TARGET_PROXY 0x00000001
  502. //
  503. // values for WINHTTP_OPTION_SECURITY_FLAGS
  504. //
  505. // query only
  506. #define SECURITY_FLAG_SECURE 0x00000001 // can query only
  507. #define SECURITY_FLAG_STRENGTH_WEAK 0x10000000
  508. #define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000
  509. #define SECURITY_FLAG_STRENGTH_STRONG 0x20000000
  510. ;begin_internal
  511. // setable flags
  512. #define SECURITY_FLAG_CHECK_REVOCATION 0x00020000
  513. ;end_internal
  514. // Secure connection error status flags
  515. #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED 0x00000001
  516. #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT 0x00000002
  517. #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED 0x00000004
  518. #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA 0x00000008
  519. #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID 0x00000010
  520. #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID 0x00000020
  521. #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040
  522. #define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000
  523. ;begin_internal
  524. // Other than the define for all supported secure protocols in winhttp,
  525. // the single bit flags map directly to the SP_PROT_*_CLIENT flags
  526. // defined in schannel.h
  527. ;end_internal
  528. #define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008
  529. #define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020
  530. #define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080
  531. #define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | \
  532. WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | \
  533. WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)
  534. //
  535. // callback function for WinHttpSetStatusCallback
  536. //
  537. typedef
  538. VOID
  539. (CALLBACK * WINHTTP_STATUS_CALLBACK)(
  540. IN HINTERNET hInternet,
  541. IN DWORD_PTR dwContext,
  542. IN DWORD dwInternetStatus,
  543. IN LPVOID lpvStatusInformation OPTIONAL,
  544. IN DWORD dwStatusInformationLength
  545. );
  546. typedef WINHTTP_STATUS_CALLBACK * LPWINHTTP_STATUS_CALLBACK;
  547. WINHTTPAPI
  548. WINHTTP_STATUS_CALLBACK
  549. WINAPI
  550. WinHttpSetStatusCallback
  551. (
  552. IN HINTERNET hInternet,
  553. IN WINHTTP_STATUS_CALLBACK lpfnInternetCallback,
  554. IN DWORD dwNotificationFlags,
  555. IN DWORD_PTR dwReserved
  556. );
  557. //
  558. // status manifests for WinHttp status callback
  559. //
  560. #define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME 0x00000001
  561. #define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED 0x00000002
  562. #define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER 0x00000004
  563. #define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER 0x00000008
  564. #define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST 0x00000010
  565. #define WINHTTP_CALLBACK_STATUS_REQUEST_SENT 0x00000020
  566. #define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE 0x00000040
  567. #define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED 0x00000080
  568. #define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION 0x00000100
  569. #define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED 0x00000200
  570. #define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED 0x00000400
  571. #define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING 0x00000800
  572. #define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY 0x00001000
  573. #define WINHTTP_CALLBACK_STATUS_REDIRECT 0x00004000
  574. #define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE 0x00008000
  575. #define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE 0x00010000
  576. #define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE 0x00020000
  577. #define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE 0x00040000
  578. #define WINHTTP_CALLBACK_STATUS_READ_COMPLETE 0x00080000
  579. #define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE 0x00100000
  580. #define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR 0x00200000
  581. #define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE 0x00400000
  582. ;begin_internal
  583. #define WINHTTP_CALLBACK_STATUS_BEGIN_PROXY_SCRIPT_RUN 0x00800000
  584. ;end_internal
  585. // API Enums for WINHTTP_CALLBACK_STATUS_REQUEST_ERROR:
  586. #define API_RECEIVE_RESPONSE (1)
  587. #define API_QUERY_DATA_AVAILABLE (2)
  588. #define API_READ_DATA (3)
  589. #define API_WRITE_DATA (4)
  590. #define API_SEND_REQUEST (5)
  591. #define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED)
  592. #define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER)
  593. #define WINHTTP_CALLBACK_FLAG_SEND_REQUEST (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT)
  594. #define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED)
  595. #define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED)
  596. #define WINHTTP_CALLBACK_FLAG_HANDLES (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)
  597. #define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY WINHTTP_CALLBACK_STATUS_DETECTING_PROXY
  598. #define WINHTTP_CALLBACK_FLAG_REDIRECT WINHTTP_CALLBACK_STATUS_REDIRECT
  599. #define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE
  600. #define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
  601. #define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE
  602. #define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE
  603. #define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE
  604. #define WINHTTP_CALLBACK_FLAG_READ_COMPLETE WINHTTP_CALLBACK_STATUS_READ_COMPLETE
  605. #define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE
  606. #define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
  607. ;begin_internal
  608. #define WINHTTP_CALLBACK_FLAG_BEGIN_PROXY_SCRIPT_RUN WINHTTP_CALLBACK_STATUS_BEGIN_PROXY_SCRIPT_RUN
  609. ;end_internal
  610. #define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE \
  611. | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \
  612. | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE \
  613. | WINHTTP_CALLBACK_STATUS_READ_COMPLETE \
  614. | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE \
  615. | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR)
  616. ;begin_internal
  617. //ensure that WINHTTP_CALLBACK_FLAG_ALL always matches OR of all the CALLBACKFLAGS
  618. ;end_internal
  619. #define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS 0xffffffff
  620. //
  621. // if the following value is returned by WinHttpSetStatusCallback, then
  622. // probably an invalid (non-code) address was supplied for the callback
  623. //
  624. #define WINHTTP_INVALID_STATUS_CALLBACK ((WINHTTP_STATUS_CALLBACK)(-1L))
  625. //
  626. // WinHttpQueryHeaders info levels. Generally, there is one info level
  627. // for each potential RFC822/HTTP/MIME header that an HTTP server
  628. // may send as part of a request response.
  629. //
  630. // The WINHTTP_QUERY_RAW_HEADERS info level is provided for clients
  631. // that choose to perform their own header parsing.
  632. //
  633. ;begin_internal
  634. //
  635. // Note that adding any WINHTTP_QUERY_* codes here must be followed
  636. // by an equivlent line in wininet\http\hashgen\hashgen.cpp
  637. // please see that file for further information regarding
  638. // the addition of new HTTP headers
  639. //
  640. ;end_internal
  641. #define WINHTTP_QUERY_MIME_VERSION 0
  642. #define WINHTTP_QUERY_CONTENT_TYPE 1
  643. #define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING 2
  644. #define WINHTTP_QUERY_CONTENT_ID 3
  645. #define WINHTTP_QUERY_CONTENT_DESCRIPTION 4
  646. #define WINHTTP_QUERY_CONTENT_LENGTH 5
  647. #define WINHTTP_QUERY_CONTENT_LANGUAGE 6
  648. #define WINHTTP_QUERY_ALLOW 7
  649. #define WINHTTP_QUERY_PUBLIC 8
  650. #define WINHTTP_QUERY_DATE 9
  651. #define WINHTTP_QUERY_EXPIRES 10
  652. #define WINHTTP_QUERY_LAST_MODIFIED 11
  653. #define WINHTTP_QUERY_MESSAGE_ID 12
  654. #define WINHTTP_QUERY_URI 13
  655. #define WINHTTP_QUERY_DERIVED_FROM 14
  656. #define WINHTTP_QUERY_COST 15
  657. #define WINHTTP_QUERY_LINK 16
  658. #define WINHTTP_QUERY_PRAGMA 17
  659. #define WINHTTP_QUERY_VERSION 18 // special: part of status line
  660. #define WINHTTP_QUERY_STATUS_CODE 19 // special: part of status line
  661. #define WINHTTP_QUERY_STATUS_TEXT 20 // special: part of status line
  662. #define WINHTTP_QUERY_RAW_HEADERS 21 // special: all headers as ASCIIZ
  663. #define WINHTTP_QUERY_RAW_HEADERS_CRLF 22 // special: all headers
  664. #define WINHTTP_QUERY_CONNECTION 23
  665. #define WINHTTP_QUERY_ACCEPT 24
  666. #define WINHTTP_QUERY_ACCEPT_CHARSET 25
  667. #define WINHTTP_QUERY_ACCEPT_ENCODING 26
  668. #define WINHTTP_QUERY_ACCEPT_LANGUAGE 27
  669. #define WINHTTP_QUERY_AUTHORIZATION 28
  670. #define WINHTTP_QUERY_CONTENT_ENCODING 29
  671. #define WINHTTP_QUERY_FORWARDED 30
  672. #define WINHTTP_QUERY_FROM 31
  673. #define WINHTTP_QUERY_IF_MODIFIED_SINCE 32
  674. #define WINHTTP_QUERY_LOCATION 33
  675. #define WINHTTP_QUERY_ORIG_URI 34
  676. #define WINHTTP_QUERY_REFERER 35
  677. #define WINHTTP_QUERY_RETRY_AFTER 36
  678. #define WINHTTP_QUERY_SERVER 37
  679. #define WINHTTP_QUERY_TITLE 38
  680. #define WINHTTP_QUERY_USER_AGENT 39
  681. #define WINHTTP_QUERY_WWW_AUTHENTICATE 40
  682. #define WINHTTP_QUERY_PROXY_AUTHENTICATE 41
  683. #define WINHTTP_QUERY_ACCEPT_RANGES 42
  684. #define WINHTTP_QUERY_SET_COOKIE 43
  685. #define WINHTTP_QUERY_COOKIE 44
  686. #define WINHTTP_QUERY_REQUEST_METHOD 45 // special: GET/POST etc.
  687. #define WINHTTP_QUERY_REFRESH 46
  688. #define WINHTTP_QUERY_CONTENT_DISPOSITION 47
  689. //
  690. // HTTP 1.1 defined headers
  691. //
  692. #define WINHTTP_QUERY_AGE 48
  693. #define WINHTTP_QUERY_CACHE_CONTROL 49
  694. #define WINHTTP_QUERY_CONTENT_BASE 50
  695. #define WINHTTP_QUERY_CONTENT_LOCATION 51
  696. #define WINHTTP_QUERY_CONTENT_MD5 52
  697. #define WINHTTP_QUERY_CONTENT_RANGE 53
  698. #define WINHTTP_QUERY_ETAG 54
  699. #define WINHTTP_QUERY_HOST 55
  700. #define WINHTTP_QUERY_IF_MATCH 56
  701. #define WINHTTP_QUERY_IF_NONE_MATCH 57
  702. #define WINHTTP_QUERY_IF_RANGE 58
  703. #define WINHTTP_QUERY_IF_UNMODIFIED_SINCE 59
  704. #define WINHTTP_QUERY_MAX_FORWARDS 60
  705. #define WINHTTP_QUERY_PROXY_AUTHORIZATION 61
  706. #define WINHTTP_QUERY_RANGE 62
  707. #define WINHTTP_QUERY_TRANSFER_ENCODING 63
  708. #define WINHTTP_QUERY_UPGRADE 64
  709. #define WINHTTP_QUERY_VARY 65
  710. #define WINHTTP_QUERY_VIA 66
  711. #define WINHTTP_QUERY_WARNING 67
  712. #define WINHTTP_QUERY_EXPECT 68
  713. #define WINHTTP_QUERY_PROXY_CONNECTION 69
  714. #define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE 70
  715. ;begin_internal
  716. // These are not part of HTTP 1.1 yet. We will propose these to the
  717. // HTTP extensions working group. These are required for the client-caps support
  718. // we are doing in conjuntion with IIS.
  719. #define WINHTTP_QUERY_ECHO_REQUEST 71
  720. #define WINHTTP_QUERY_ECHO_REPLY 72
  721. // These are the set of headers that should be added back to a request when
  722. // re-doing a request after a RETRY_WITH response.
  723. #define WINHTTP_QUERY_ECHO_HEADERS 73
  724. #define WINHTTP_QUERY_ECHO_HEADERS_CRLF 74
  725. ;end_internal
  726. #define WINHTTP_QUERY_PROXY_SUPPORT 75
  727. #define WINHTTP_QUERY_AUTHENTICATION_INFO 76
  728. #define WINHTTP_QUERY_PASSPORT_URLS 77
  729. #define WINHTTP_QUERY_PASSPORT_CONFIG 78
  730. #define WINHTTP_QUERY_MAX 78
  731. //
  732. // WINHTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel
  733. // parameter of WinHttpQueryHeaders() then the lpBuffer parameter contains the name
  734. // of the header we are to query
  735. //
  736. #define WINHTTP_QUERY_CUSTOM 65535
  737. //
  738. // WINHTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel
  739. // parameter of WinHttpQueryHeaders() then the request headers will be queried for the
  740. // request information
  741. //
  742. #define WINHTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000
  743. //
  744. // WINHTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter
  745. // of WinHttpQueryHeaders() AND the header being queried contains date information,
  746. // e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure
  747. // containing the date and time information converted from the header string
  748. //
  749. #define WINHTTP_QUERY_FLAG_SYSTEMTIME 0x40000000
  750. //
  751. // WINHTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of
  752. // HttpQueryHeader(), then the value of the header will be converted to a number
  753. // before being returned to the caller, if applicable
  754. //
  755. #define WINHTTP_QUERY_FLAG_NUMBER 0x20000000
  756. ;begin_internal
  757. #define HTTP_QUERY_MODIFIER_FLAGS_MASK (WINHTTP_QUERY_FLAG_REQUEST_HEADERS \
  758. | WINHTTP_QUERY_FLAG_SYSTEMTIME \
  759. | WINHTTP_QUERY_FLAG_NUMBER \
  760. )
  761. #define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
  762. ;end_internal
  763. //
  764. // HTTP Response Status Codes:
  765. //
  766. #define HTTP_STATUS_CONTINUE 100 // OK to continue with request
  767. #define HTTP_STATUS_SWITCH_PROTOCOLS 101 // server has switched protocols in upgrade header
  768. #define HTTP_STATUS_OK 200 // request completed
  769. #define HTTP_STATUS_CREATED 201 // object created, reason = new URI
  770. #define HTTP_STATUS_ACCEPTED 202 // async completion (TBS)
  771. #define HTTP_STATUS_PARTIAL 203 // partial completion
  772. #define HTTP_STATUS_NO_CONTENT 204 // no info to return
  773. #define HTTP_STATUS_RESET_CONTENT 205 // request completed, but clear form
  774. #define HTTP_STATUS_PARTIAL_CONTENT 206 // partial GET fulfilled
  775. #define HTTP_STATUS_WEBDAV_MULTI_STATUS 207 // WebDAV Multi-Status
  776. #define HTTP_STATUS_AMBIGUOUS 300 // server couldn't decide what to return
  777. #define HTTP_STATUS_MOVED 301 // object permanently moved
  778. #define HTTP_STATUS_REDIRECT 302 // object temporarily moved
  779. #define HTTP_STATUS_REDIRECT_METHOD 303 // redirection w/ new access method
  780. #define HTTP_STATUS_NOT_MODIFIED 304 // if-modified-since was not modified
  781. #define HTTP_STATUS_USE_PROXY 305 // redirection to proxy, location header specifies proxy to use
  782. #define HTTP_STATUS_REDIRECT_KEEP_VERB 307 // HTTP/1.1: keep same verb
  783. #define HTTP_STATUS_BAD_REQUEST 400 // invalid syntax
  784. #define HTTP_STATUS_DENIED 401 // access denied
  785. #define HTTP_STATUS_PAYMENT_REQ 402 // payment required
  786. #define HTTP_STATUS_FORBIDDEN 403 // request forbidden
  787. #define HTTP_STATUS_NOT_FOUND 404 // object not found
  788. #define HTTP_STATUS_BAD_METHOD 405 // method is not allowed
  789. #define HTTP_STATUS_NONE_ACCEPTABLE 406 // no response acceptable to client found
  790. #define HTTP_STATUS_PROXY_AUTH_REQ 407 // proxy authentication required
  791. #define HTTP_STATUS_REQUEST_TIMEOUT 408 // server timed out waiting for request
  792. #define HTTP_STATUS_CONFLICT 409 // user should resubmit with more info
  793. #define HTTP_STATUS_GONE 410 // the resource is no longer available
  794. #define HTTP_STATUS_LENGTH_REQUIRED 411 // the server refused to accept request w/o a length
  795. #define HTTP_STATUS_PRECOND_FAILED 412 // precondition given in request failed
  796. #define HTTP_STATUS_REQUEST_TOO_LARGE 413 // request entity was too large
  797. #define HTTP_STATUS_URI_TOO_LONG 414 // request URI too long
  798. #define HTTP_STATUS_UNSUPPORTED_MEDIA 415 // unsupported media type
  799. #define HTTP_STATUS_RETRY_WITH 449 // retry after doing the appropriate action.
  800. #define HTTP_STATUS_SERVER_ERROR 500 // internal server error
  801. #define HTTP_STATUS_NOT_SUPPORTED 501 // required not supported
  802. #define HTTP_STATUS_BAD_GATEWAY 502 // error response received from gateway
  803. #define HTTP_STATUS_SERVICE_UNAVAIL 503 // temporarily overloaded
  804. #define HTTP_STATUS_GATEWAY_TIMEOUT 504 // timed out waiting for gateway
  805. #define HTTP_STATUS_VERSION_NOT_SUP 505 // HTTP version not supported
  806. #define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE
  807. #define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP
  808. //
  809. // prototypes
  810. //
  811. WINHTTPAPI
  812. HINTERNET
  813. WINAPI
  814. WinHttpOpenRequest
  815. (
  816. IN HINTERNET hConnect,
  817. IN LPCWSTR pwszVerb,
  818. IN LPCWSTR pwszObjectName,
  819. IN LPCWSTR pwszVersion,
  820. IN LPCWSTR pwszReferrer OPTIONAL,
  821. IN LPCWSTR FAR * ppwszAcceptTypes OPTIONAL,
  822. IN DWORD dwFlags
  823. );
  824. // WinHttpOpenRequest prettifers for optional parameters
  825. #define WINHTTP_NO_REFERER NULL
  826. #define WINHTTP_DEFAULT_ACCEPT_TYPES NULL
  827. BOOLAPI
  828. WinHttpAddRequestHeaders
  829. (
  830. IN HINTERNET hRequest,
  831. IN LPCWSTR pwszHeaders,
  832. IN DWORD dwHeadersLength,
  833. IN DWORD dwModifiers
  834. );
  835. //
  836. // values for dwModifiers parameter of WinHttpAddRequestHeaders()
  837. //
  838. #define WINHTTP_ADDREQ_INDEX_MASK 0x0000FFFF
  839. #define WINHTTP_ADDREQ_FLAGS_MASK 0xFFFF0000
  840. //
  841. // WINHTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't
  842. // already exist
  843. //
  844. #define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
  845. //
  846. // WINHTTP_ADDREQ_FLAG_ADD - if WINHTTP_ADDREQ_FLAG_REPLACE is set but the header is
  847. // not found then if this flag is set, the header is added anyway, so long as
  848. // there is a valid header-value
  849. //
  850. #define WINHTTP_ADDREQ_FLAG_ADD 0x20000000
  851. //
  852. // WINHTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  853. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  854. // header: "Accept: text/*, audio/*"
  855. //
  856. #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000
  857. #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
  858. #define WINHTTP_ADDREQ_FLAG_COALESCE WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  859. //
  860. // WINHTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can
  861. // be supplied in the buffer. If the header to be replaced is not the first
  862. // in a list of headers with the same name, then the relative index should be
  863. // supplied in the low 8 bits of the dwModifiers parameter. If the header-value
  864. // part is missing, then the header is removed
  865. //
  866. #define WINHTTP_ADDREQ_FLAG_REPLACE 0x80000000
  867. BOOLAPI
  868. WinHttpSendRequest
  869. (
  870. IN HINTERNET hRequest,
  871. IN LPCWSTR pwszHeaders OPTIONAL,
  872. IN DWORD dwHeadersLength,
  873. IN LPVOID lpOptional OPTIONAL,
  874. IN DWORD dwOptionalLength,
  875. IN DWORD dwTotalLength,
  876. IN DWORD_PTR dwContext
  877. );
  878. // WinHttpSendRequest prettifiers for optional parameters.
  879. #define WINHTTP_NO_ADDITIONAL_HEADERS NULL
  880. #define WINHTTP_NO_REQUEST_DATA NULL
  881. ;begin_internal
  882. //
  883. // AR_TYPE - Asynchronous Request Type designator. Used as index into array of
  884. // ARB sizes, hence must start at 0
  885. //
  886. typedef enum {
  887. AR_INTERNET_CONNECT = 0, // 0
  888. AR_INTERNET_OPEN_URL, // 1
  889. AR_INTERNET_READ_FILE, // 2
  890. AR_INTERNET_WRITE_FILE, // 3
  891. AR_INTERNET_QUERY_DATA_AVAILABLE, // 4
  892. AR_INTERNET_FIND_NEXT_FILE, // 5
  893. AR_FTP_FIND_FIRST_FILE, // 6
  894. AR_FTP_GET_FILE, // 7
  895. AR_FTP_PUT_FILE, // 8
  896. AR_FTP_DELETE_FILE, // 9
  897. AR_FTP_RENAME_FILE, // 10
  898. AR_FTP_OPEN_FILE, // 11
  899. AR_FTP_CREATE_DIRECTORY, // 12
  900. AR_FTP_REMOVE_DIRECTORY, // 13
  901. AR_FTP_SET_CURRENT_DIRECTORY, // 14
  902. AR_FTP_GET_CURRENT_DIRECTORY, // 15
  903. AR_GOPHER_FIND_FIRST_FILE, // 16
  904. AR_GOPHER_OPEN_FILE, // 17
  905. AR_GOPHER_GET_ATTRIBUTE, // 18
  906. AR_HTTP_SEND_REQUEST, // 19
  907. AR_HTTP_BEGIN_SEND_REQUEST, // 20
  908. AR_HTTP_END_SEND_REQUEST, // 21
  909. AR_READ_PREFETCH, // 22
  910. AR_SYNC_EVENT, // 23
  911. AR_TIMER_EVENT, // 24
  912. AR_HTTP_REQUEST1, // 25
  913. AR_FILE_IO, // 26
  914. AR_INTERNET_READ_FILE_EX, // 27
  915. AR_MAX_REQUEST_TYPE
  916. } AR_TYPE;
  917. ;end_internal
  918. BOOLAPI WinHttpSetCredentials
  919. (
  920. IN HINTERNET hRequest, // HINTERNET handle returned by WinHttpOpenRequest.
  921. IN DWORD AuthTargets, // Only WINHTTP_AUTH_TARGET_SERVER and
  922. // WINHTTP_AUTH_TARGET_PROXY are supported
  923. // in this version and they are mutually
  924. // exclusive
  925. IN DWORD AuthScheme, // must be one of the supported Auth Schemes
  926. // returned from WinHttpQueryAuthSchemes()
  927. IN LPCWSTR pwszUserName, // 1) NULL if default creds is to be used, in
  928. // which case pszPassword will be ignored
  929. IN LPCWSTR pwszPassword, // 1) "" == Blank Password; 2)Parameter ignored
  930. // if pszUserName is NULL; 3) Invalid to pass in
  931. // NULL if pszUserName is not NULL
  932. IN LPVOID pAuthParams
  933. );
  934. BOOLAPI WinHttpQueryAuthSchemes
  935. (
  936. IN HINTERNET hRequest, // HINTERNET handle returned by WinHttpOpenRequest
  937. OUT LPDWORD lpdwSupportedSchemes, // a bitmap of available Authentication Schemes
  938. OUT LPDWORD lpdwFirstScheme, // returns the first auth scheme returned by the server
  939. OUT LPDWORD pdwAuthTarget
  940. );
  941. BOOLAPI WinHttpQueryAuthParams(
  942. IN HINTERNET hRequest, // HINTERNET handle returned by WinHttpOpenRequest
  943. IN DWORD AuthScheme,
  944. OUT LPVOID* pAuthParams // Scheme-specific Advanced auth parameters
  945. );
  946. WINHTTPAPI
  947. BOOL
  948. WINAPI
  949. WinHttpReceiveResponse
  950. (
  951. IN HINTERNET hRequest,
  952. IN LPVOID lpReserved
  953. );
  954. BOOLAPI
  955. WinHttpQueryHeaders
  956. (
  957. IN HINTERNET hRequest,
  958. IN DWORD dwInfoLevel,
  959. IN LPCWSTR pwszName OPTIONAL,
  960. OUT LPVOID lpBuffer OPTIONAL,
  961. IN OUT LPDWORD lpdwBufferLength,
  962. IN OUT LPDWORD lpdwIndex OPTIONAL
  963. );
  964. // WinHttpQueryHeaders prettifiers for optional parameters.
  965. #define WINHTTP_HEADER_NAME_BY_INDEX NULL
  966. #define WINHTTP_NO_OUTPUT_BUFFER NULL
  967. #define WINHTTP_NO_HEADER_INDEX NULL
  968. BOOLAPI
  969. WinHttpDetectAutoProxyConfigUrl
  970. (
  971. IN DWORD dwAutoDetectFlags,
  972. OUT LPWSTR * ppwszAutoConfigUrl
  973. );
  974. BOOLAPI
  975. WinHttpGetProxyForUrl
  976. (
  977. IN HINTERNET hSession,
  978. IN LPCWSTR lpcwszUrl,
  979. IN WINHTTP_AUTOPROXY_OPTIONS * pAutoProxyOptions,
  980. OUT WINHTTP_PROXY_INFO * pProxyInfo
  981. );
  982. typedef struct
  983. {
  984. BOOL fAutoDetect;
  985. LPWSTR lpszAutoConfigUrl;
  986. LPWSTR lpszProxy;
  987. LPWSTR lpszProxyBypass;
  988. } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
  989. BOOLAPI
  990. WinHttpGetIEProxyConfigForCurrentUser
  991. (
  992. IN OUT WINHTTP_CURRENT_USER_IE_PROXY_CONFIG * pProxyConfig
  993. );
  994. //#if !defined(_WINERROR_)
  995. //
  996. // WinHttp API error returns
  997. //
  998. #define WINHTTP_ERROR_BASE 12000
  999. #define ERROR_WINHTTP_OUT_OF_HANDLES (WINHTTP_ERROR_BASE + 1)
  1000. #define ERROR_WINHTTP_TIMEOUT (WINHTTP_ERROR_BASE + 2)
  1001. #define ERROR_WINHTTP_INTERNAL_ERROR (WINHTTP_ERROR_BASE + 4)
  1002. #define ERROR_WINHTTP_INVALID_URL (WINHTTP_ERROR_BASE + 5)
  1003. #define ERROR_WINHTTP_UNRECOGNIZED_SCHEME (WINHTTP_ERROR_BASE + 6)
  1004. #define ERROR_WINHTTP_NAME_NOT_RESOLVED (WINHTTP_ERROR_BASE + 7)
  1005. #define ERROR_WINHTTP_INVALID_OPTION (WINHTTP_ERROR_BASE + 9)
  1006. #define ERROR_WINHTTP_OPTION_NOT_SETTABLE (WINHTTP_ERROR_BASE + 11)
  1007. #define ERROR_WINHTTP_SHUTDOWN (WINHTTP_ERROR_BASE + 12)
  1008. ;begin_internal
  1009. #define ERROR_WINHTTP_INCORRECT_PASSWORD (WINHTTP_ERROR_BASE + 14)
  1010. ;end_internal
  1011. #define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15)
  1012. #define ERROR_WINHTTP_OPERATION_CANCELLED (WINHTTP_ERROR_BASE + 17)
  1013. #define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE (WINHTTP_ERROR_BASE + 18)
  1014. #define ERROR_WINHTTP_INCORRECT_HANDLE_STATE (WINHTTP_ERROR_BASE + 19)
  1015. #define ERROR_WINHTTP_CANNOT_CONNECT (WINHTTP_ERROR_BASE + 29)
  1016. #define ERROR_WINHTTP_CONNECTION_ERROR (WINHTTP_ERROR_BASE + 30)
  1017. #define ERROR_WINHTTP_RESEND_REQUEST (WINHTTP_ERROR_BASE + 32)
  1018. #define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED (WINHTTP_ERROR_BASE + 44)
  1019. //
  1020. // WinHttpRequest Component errors
  1021. //
  1022. #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN (WINHTTP_ERROR_BASE + 100)
  1023. #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND (WINHTTP_ERROR_BASE + 101)
  1024. #define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND (WINHTTP_ERROR_BASE + 102)
  1025. #define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN (WINHTTP_ERROR_BASE + 103)
  1026. //
  1027. // HTTP API errors
  1028. //
  1029. #define ERROR_WINHTTP_HEADER_NOT_FOUND (WINHTTP_ERROR_BASE + 150)
  1030. #define ERROR_WINHTTP_INVALID_SERVER_RESPONSE (WINHTTP_ERROR_BASE + 152)
  1031. #define ERROR_WINHTTP_INVALID_QUERY_REQUEST (WINHTTP_ERROR_BASE + 154)
  1032. #define ERROR_WINHTTP_HEADER_ALREADY_EXISTS (WINHTTP_ERROR_BASE + 155)
  1033. #define ERROR_WINHTTP_REDIRECT_FAILED (WINHTTP_ERROR_BASE + 156)
  1034. ;begin_internal
  1035. #define ERROR_WINHTTP_NOT_REDIRECTED (WINHTTP_ERROR_BASE + 160)
  1036. ;end_internal
  1037. //
  1038. // additional WinHttp API error codes
  1039. //
  1040. //
  1041. // additional WinHttp API error codes
  1042. //
  1043. #define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR (WINHTTP_ERROR_BASE + 178)
  1044. #define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT (WINHTTP_ERROR_BASE + 166)
  1045. #define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167)
  1046. #define ERROR_WINHTTP_NOT_INITIALIZED (WINHTTP_ERROR_BASE + 172)
  1047. #define ERROR_WINHTTP_SECURE_FAILURE (WINHTTP_ERROR_BASE + 175)
  1048. //
  1049. // Certificate security errors. These are raised only by the WinHttpRequest
  1050. // component. The WinHTTP Win32 API will return ERROR_WINHTTP_SECURE_FAILE and
  1051. // provide additional information via the WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
  1052. // callback notification.
  1053. //
  1054. #define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID (WINHTTP_ERROR_BASE + 37)
  1055. #define ERROR_WINHTTP_SECURE_CERT_CN_INVALID (WINHTTP_ERROR_BASE + 38)
  1056. #define ERROR_WINHTTP_SECURE_INVALID_CA (WINHTTP_ERROR_BASE + 45)
  1057. #define ERROR_WINHTTP_SECURE_CERT_REV_FAILED (WINHTTP_ERROR_BASE + 57)
  1058. #define ERROR_WINHTTP_SECURE_CHANNEL_ERROR (WINHTTP_ERROR_BASE + 157)
  1059. #define ERROR_WINHTTP_SECURE_INVALID_CERT (WINHTTP_ERROR_BASE + 169)
  1060. #define ERROR_WINHTTP_SECURE_CERT_REVOKED (WINHTTP_ERROR_BASE + 170)
  1061. #define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE (WINHTTP_ERROR_BASE + 179)
  1062. #define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180)
  1063. #define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED (WINHTTP_ERROR_BASE + 181)
  1064. #define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 182)
  1065. #define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183)
  1066. #define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW (WINHTTP_ERROR_BASE + 184)
  1067. #define WINHTTP_ERROR_LAST (WINHTTP_ERROR_BASE + 184)
  1068. //#endif // !defined(_WINERROR_)
  1069. ;begin_internal
  1070. // WinHttp Auto-Proxy Svc event messages
  1071. #define WINHTTP_AUTOPROXY_SVC_MSG_BASE (WINHTTP_ERROR_BASE + 500)
  1072. #define MSG_WINHTTP_AUTOPROXY_SVC_DATA_CORRUPT (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 1)
  1073. #define MSG_WINHTTP_AUTOPROXY_SVC_IDLE_TIMEOUT (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 3)
  1074. #define MSG_WINHTTP_AUTOPROXY_SVC_WIN32_ERROR (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 6)
  1075. #define MSG_WINHTTP_AUTOPROXY_SVC_FAILED_ALLOCATE_RESOURCE (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 7)
  1076. #define MSG_WINHTTP_AUTOPROXY_SVC_NON_LRPC_REQUEST (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 9)
  1077. #define MSG_WINHTTP_AUTOPROXY_SVC_TIMEOUT_GRACEFUL_SHUTDOWN (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 11)
  1078. #define MSG_WINHTTP_AUTOPROXY_SVC_INVALID_PARAMETER (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 12)
  1079. #define MSG_WINHTTP_AUTOPROXY_SVC_NOT_IN_SERVICE (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 13)
  1080. #define MSG_WINHTTP_AUTOPROXY_SVC_WINHTTP_EXCEPTED (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 14)
  1081. #define MSG_WINHTTP_AUTOPROXY_SVC_RETRY_REQUEST (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 16)
  1082. #define MSG_WINHTTP_AUTOPROXY_SVC_SUSPEND_OPERATION (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 17)
  1083. #define MSG_WINHTTP_AUTOPROXY_SVC_RESUME_OPERATION (WINHTTP_AUTOPROXY_SVC_MSG_BASE + 18)
  1084. ;end_internal
  1085. ;begin_internal
  1086. #if defined(INCLUDE_CACHE)
  1087. // Cache control flags
  1088. // Control expiry behaviour
  1089. #define CACHE_FLAG_SYNC_MODE_AUTOMATIC 0x00000010
  1090. #define CACHE_FLAG_SYNC_MODE_ALWAYS 0x00000020
  1091. #define CACHE_FLAG_SYNC_MODE_ONCE_PER_SESSION 0x00000040
  1092. #define CACHE_FLAG_SYNC_MODE_NEVER 0x00000080
  1093. #define CACHE_FLAG_BGUPDATE 0x00000100
  1094. #define CACHE_FLAG_ALWAYS_RESYNCHRONIZE 0x00000200
  1095. #define CACHE_FLAG_DISABLE_CACHE_WRITE 0x00000400
  1096. #define CACHE_FLAG_DISABLE_CACHE_READ 0x00000800
  1097. #define CACHE_FLAG_DISABLE_SSL_CACHING 0x00001000
  1098. #define CACHE_FLAG_MAKE_PERSISTENT 0x00002000
  1099. #define CACHE_FLAG_FWD_BACK 0x00004000
  1100. #define CACHE_FLAG_OFFLINE_BROWSING CACHE_FLAG_DISABLE_CACHE_READ | CACHE_FLAG_DISABLE_CACHE_WRITE
  1101. #define CACHE_FLAG_DEFAULT_SETTING CACHE_FLAG_SYNC_MODE_AUTOMATIC
  1102. #define WINHTTP_CACHE_FLAGS_MASK ( CACHE_FLAG_SYNC_MODE_AUTOMATIC | \
  1103. CACHE_FLAG_SYNC_MODE_ALWAYS | \
  1104. CACHE_FLAG_SYNC_MODE_ONCE_PER_SESSION | \
  1105. CACHE_FLAG_SYNC_MODE_NEVER | \
  1106. CACHE_FLAG_BGUPDATE | \
  1107. CACHE_FLAG_ALWAYS_RESYNCHRONIZE | \
  1108. CACHE_FLAG_DISABLE_CACHE_WRITE | \
  1109. CACHE_FLAG_DISABLE_CACHE_READ | \
  1110. CACHE_FLAG_MAKE_PERSISTENT | \
  1111. CACHE_FLAG_FWD_BACK | \
  1112. CACHE_FLAG_OFFLINE_BROWSING | \
  1113. CACHE_FLAG_DEFAULT_SETTING)
  1114. #undef WINHTTP_OPEN_FLAGS_MASK
  1115. #define WINHTTP_OPEN_FLAGS_MASK (WINHTTP_CACHE_FLAGS_MASK | \
  1116. WINHTTP_FLAG_ASYNC)
  1117. WINHTTPAPI
  1118. HINTERNET
  1119. WINAPI
  1120. WinHttpCacheOpen(
  1121. IN LPCWSTR pszAgentW,
  1122. IN DWORD dwAccessType,
  1123. IN LPCWSTR pszProxyW OPTIONAL,
  1124. IN LPCWSTR pszProxyBypassW OPTIONAL,
  1125. IN DWORD dwFlags
  1126. );
  1127. WINHTTPAPI
  1128. HINTERNET
  1129. WINAPI
  1130. WinHttpCacheConnect(
  1131. HINTERNET hSession,
  1132. LPCWSTR pswzServerName,
  1133. INTERNET_PORT nServerPort,
  1134. DWORD dwReserved
  1135. );
  1136. WINHTTPAPI
  1137. HINTERNET
  1138. WINAPI
  1139. WinHttpCacheOpenRequest(
  1140. IN HINTERNET hConnect,
  1141. IN LPCWSTR lpszVerb,
  1142. IN LPCWSTR lpszObjectName,
  1143. IN LPCWSTR lpszVersion,
  1144. IN LPCWSTR lpszReferrer OPTIONAL,
  1145. IN LPCWSTR FAR * lplpszAcceptTypes OPTIONAL,
  1146. IN DWORD dwFlags
  1147. );
  1148. BOOLAPI
  1149. WinHttpCacheSendRequest(
  1150. IN HINTERNET hRequest,
  1151. IN LPCWSTR lpszHeaders,
  1152. IN DWORD dwHeadersLength,
  1153. IN LPVOID lpOptional,
  1154. IN DWORD dwOptionalLength,
  1155. IN DWORD dwTotalLength,
  1156. IN DWORD_PTR dwContext
  1157. );
  1158. BOOLAPI
  1159. WinHttpCacheReceiveResponse(
  1160. IN HINTERNET hRequest,
  1161. IN LPVOID lpBuffersOut
  1162. );
  1163. BOOLAPI
  1164. WinHttpCacheQueryDataAvailable(
  1165. IN HINTERNET hRequest,
  1166. OUT LPDWORD lpdwNumberOfBytesAvailable
  1167. );
  1168. BOOLAPI
  1169. WinHttpCacheReadData(
  1170. IN HINTERNET hRequest,
  1171. IN LPVOID lpBuffer,
  1172. IN DWORD dwNumberOfBytesToRead,
  1173. OUT LPDWORD lpdwNumberOfBytesRead
  1174. );
  1175. BOOLAPI
  1176. WinHttpCacheCloseHandle(
  1177. IN HINTERNET hInternet
  1178. );
  1179. BOOL
  1180. WINAPI
  1181. WinHttpCacheQueryOption(
  1182. HINTERNET hInternet,
  1183. DWORD dwOption,
  1184. LPVOID lpBuffer,
  1185. LPDWORD lpdwBufferLength
  1186. );
  1187. BOOL
  1188. WINAPI
  1189. WinHttpCacheSetOption(
  1190. HINTERNET hInternet,
  1191. DWORD dwOption,
  1192. LPVOID lpBuffer,
  1193. DWORD dwBufferLength
  1194. );
  1195. BOOL
  1196. WINAPI
  1197. WinHttpCacheQueryHeaders(
  1198. IN HINTERNET hRequest,
  1199. IN DWORD dwInfoLevel,
  1200. IN LPCWSTR lpszName OPTIONAL,
  1201. OUT LPVOID lpBuffer OPTIONAL,
  1202. IN OUT LPDWORD lpdwBufferLength,
  1203. IN OUT LPDWORD lpdwIndex OPTIONAL
  1204. );
  1205. BOOL
  1206. WINAPI
  1207. WinHttpCacheAddRequestHeaders(
  1208. IN HINTERNET hRequest,
  1209. IN LPCWSTR lpszHeaders,
  1210. IN DWORD dwHeadersLength,
  1211. IN DWORD dwModifiers
  1212. );
  1213. BOOL
  1214. WINAPI
  1215. WinHttpCacheQueryAuthSchemes(
  1216. IN HINTERNET hRequest,
  1217. OUT LPDWORD lpdwSupportedSchemes,
  1218. OUT LPDWORD lpdwFirstScheme,
  1219. OUT LPDWORD pdwAuthTarget
  1220. );
  1221. BOOL
  1222. WINAPI
  1223. WinHttpCacheSetCredentials(
  1224. IN HINTERNET hRequest,
  1225. IN DWORD AuthTargets,
  1226. IN DWORD AuthScheme,
  1227. IN LPCWSTR pwszUserName,
  1228. IN LPCWSTR pwszPassword,
  1229. IN LPVOID pAuthParams
  1230. );
  1231. BOOL
  1232. WINAPI
  1233. WinCacheHttpSetTimeouts(
  1234. IN HINTERNET hInternet,
  1235. IN int nResolveTimeout,
  1236. IN int nConnectTimeout,
  1237. IN int nSendTimeout,
  1238. IN int nReceiveTimeout
  1239. );
  1240. BOOL
  1241. WINAPI
  1242. WinCacheHttpWriteData(
  1243. IN HINTERNET hFile,
  1244. IN LPCVOID lpBuffer,
  1245. IN DWORD dwNumberOfBytesToWrite,
  1246. OUT LPDWORD lpdwNumberOfBytesWritten
  1247. );
  1248. WINHTTP_STATUS_CALLBACK
  1249. WINAPI
  1250. WinHttpCacheSetStatusCallback(
  1251. IN HINTERNET hInternet,
  1252. IN WINHTTP_STATUS_CALLBACK lpfnInternetCallback,
  1253. IN DWORD dwNotificationFlags,
  1254. IN DWORD_PTR dwReserved
  1255. );
  1256. VOID
  1257. WinHttpCacheStatusCallback(
  1258. HINTERNET hInternet,
  1259. DWORD_PTR dwContext,
  1260. DWORD dwInternetStatus,
  1261. LPVOID lpvStatusInformation,
  1262. DWORD dwStatusInformationLength
  1263. );
  1264. #endif
  1265. ;end_internal
  1266. ;begin_both
  1267. #if defined(__cplusplus)
  1268. }
  1269. #endif
  1270. ;end_both
  1271. /*
  1272. * Return packing to whatever it was before we
  1273. * entered this file
  1274. */
  1275. #include <poppack.h>
  1276. ;begin_internal
  1277. #endif // !define(_WINHTTPXEX_)
  1278. ;end_internal
  1279. #endif // !defined(_WINHTTPX_)