ntdll/tests: Allow alternate results in the info test to make it pass on Vista.
[wine] / include / winhttp.h
1 /*
2  * Copyright (C) 2007 Francois Gouget
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef __WINE_WINHTTP_H
20 #define __WINE_WINHTTP_H
21
22 #define WINHTTPAPI
23 #define BOOLAPI WINHTTPAPI BOOL WINAPI
24
25
26 typedef LPVOID HINTERNET;
27 typedef HINTERNET *LPHINTERNET;
28
29 #define INTERNET_DEFAULT_PORT           0
30 #define INTERNET_DEFAULT_HTTP_PORT      80
31 #define INTERNET_DEFAULT_HTTPS_PORT     443
32 typedef WORD INTERNET_PORT;
33 typedef INTERNET_PORT *LPINTERNET_PORT;
34
35 #define INTERNET_SCHEME_HTTP            1
36 #define INTERNET_SCHEME_HTTPS           2
37 typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
38
39 /* flags for WinHttpOpen */
40 #define WINHTTP_FLAG_ASYNC                  0x10000000
41
42 /* flags for WinHttpOpenRequest */
43 #define WINHTTP_FLAG_ESCAPE_PERCENT         0x00000004
44 #define WINHTTP_FLAG_NULL_CODEPAGE          0x00000008
45 #define WINHTTP_FLAG_ESCAPE_DISABLE         0x00000040
46 #define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY   0x00000080
47 #define WINHTTP_FLAG_BYPASS_PROXY_CACHE     0x00000100
48 #define WINHTTP_FLAG_REFRESH                WINHTTP_FLAG_BYPASS_PROXY_CACHE
49 #define WINHTTP_FLAG_SECURE                 0x00800000
50
51 #define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY   0
52 #define WINHTTP_ACCESS_TYPE_NO_PROXY        1
53 #define WINHTTP_ACCESS_TYPE_NAMED_PROXY     3
54
55 #define WINHTTP_NO_PROXY_NAME               NULL
56 #define WINHTTP_NO_PROXY_BYPASS             NULL
57
58 #define WINHTTP_NO_REFERER                  NULL
59 #define WINHTTP_DEFAULT_ACCEPT_TYPES        NULL
60
61 #define WINHTTP_NO_ADDITIONAL_HEADERS       NULL
62 #define WINHTTP_NO_REQUEST_DATA             NULL
63
64 #define WINHTTP_HEADER_NAME_BY_INDEX        NULL
65 #define WINHTTP_NO_OUTPUT_BUFFER            NULL
66 #define WINHTTP_NO_HEADER_INDEX             NULL
67
68 #define WINHTTP_ADDREQ_INDEX_MASK                    0x0000FFFF
69 #define WINHTTP_ADDREQ_FLAGS_MASK                    0xFFFF0000
70 #define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW               0x10000000
71 #define WINHTTP_ADDREQ_FLAG_ADD                      0x20000000
72 #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA      0x40000000
73 #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON  0x01000000
74 #define WINHTTP_ADDREQ_FLAG_COALESCE                 WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
75 #define WINHTTP_ADDREQ_FLAG_REPLACE                  0x80000000
76
77 #define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0
78
79 /* flags for WinHttp{Set/Query}Options */
80 #define WINHTTP_FIRST_OPTION                         WINHTTP_OPTION_CALLBACK
81 #define WINHTTP_OPTION_CALLBACK                       1
82 #define WINHTTP_OPTION_RESOLVE_TIMEOUT                2
83 #define WINHTTP_OPTION_CONNECT_TIMEOUT                3
84 #define WINHTTP_OPTION_CONNECT_RETRIES                4
85 #define WINHTTP_OPTION_SEND_TIMEOUT                   5
86 #define WINHTTP_OPTION_RECEIVE_TIMEOUT                6
87 #define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT       7
88 #define WINHTTP_OPTION_HANDLE_TYPE                    9
89 #define WINHTTP_OPTION_READ_BUFFER_SIZE              12
90 #define WINHTTP_OPTION_WRITE_BUFFER_SIZE             13
91 #define WINHTTP_OPTION_PARENT_HANDLE                 21
92 #define WINHTTP_OPTION_EXTENDED_ERROR                24
93 #define WINHTTP_OPTION_SECURITY_FLAGS                31
94 #define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT   32
95 #define WINHTTP_OPTION_URL                           34
96 #define WINHTTP_OPTION_SECURITY_KEY_BITNESS          36
97 #define WINHTTP_OPTION_PROXY                         38
98 #define WINHTTP_OPTION_USER_AGENT                    41
99 #define WINHTTP_OPTION_CONTEXT_VALUE                 45
100 #define WINHTTP_OPTION_CLIENT_CERT_CONTEXT           47
101 #define WINHTTP_OPTION_REQUEST_PRIORITY              58
102 #define WINHTTP_OPTION_HTTP_VERSION                  59
103 #define WINHTTP_OPTION_DISABLE_FEATURE               63
104 #define WINHTTP_OPTION_CODEPAGE                      68
105 #define WINHTTP_OPTION_MAX_CONNS_PER_SERVER          73
106 #define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER      74
107 #define WINHTTP_OPTION_AUTOLOGON_POLICY              77
108 #define WINHTTP_OPTION_SERVER_CERT_CONTEXT           78
109 #define WINHTTP_OPTION_ENABLE_FEATURE                79
110 #define WINHTTP_OPTION_WORKER_THREAD_COUNT           80
111 #define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT      81
112 #define WINHTTP_OPTION_PASSPORT_COBRANDING_URL       82
113 #define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH       83
114 #define WINHTTP_OPTION_SECURE_PROTOCOLS              84
115 #define WINHTTP_OPTION_ENABLETRACING                 85
116 #define WINHTTP_OPTION_PASSPORT_SIGN_OUT             86
117 #define WINHTTP_OPTION_PASSPORT_RETURN_URL           87
118 #define WINHTTP_OPTION_REDIRECT_POLICY               88
119 #define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS  89
120 #define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE      90
121 #define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE      91
122 #define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE       92
123 #define WINHTTP_OPTION_CONNECTION_INFO               93
124 #define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST       94
125 #define WINHTTP_OPTION_SPN                           96
126 #define WINHTTP_OPTION_GLOBAL_PROXY_CREDS            97
127 #define WINHTTP_OPTION_GLOBAL_SERVER_CREDS           98
128 #define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT           99
129 #define WINHTTP_OPTION_REJECT_USERPWD_IN_URL         100
130 #define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101
131 #define WINHTTP_LAST_OPTION                          WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS
132 #define WINHTTP_OPTION_USERNAME                      0x1000
133 #define WINHTTP_OPTION_PASSWORD                      0x1001
134 #define WINHTTP_OPTION_PROXY_USERNAME                0x1002
135 #define WINHTTP_OPTION_PROXY_PASSWORD                0x1003
136
137 #define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF
138
139 #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM   0
140 #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW      1
141 #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH     2
142 #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT  WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM
143
144 #define WINHTTP_OPTION_REDIRECT_POLICY_NEVER                        0
145 #define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP       1
146 #define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS                       2
147 #define WINHTTP_OPTION_REDIRECT_POLICY_LAST            WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
148 #define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT         WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
149
150 #define WINHTTP_DISABLE_PASSPORT_AUTH    0x00000000
151 #define WINHTTP_ENABLE_PASSPORT_AUTH     0x10000000
152 #define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000
153 #define WINHTTP_ENABLE_PASSPORT_KEYRING  0x40000000
154
155 #define WINHTTP_DISABLE_COOKIES                   0x00000001
156 #define WINHTTP_DISABLE_REDIRECTS                 0x00000002
157 #define WINHTTP_DISABLE_AUTHENTICATION            0x00000004
158 #define WINHTTP_DISABLE_KEEP_ALIVE                0x00000008
159 #define WINHTTP_ENABLE_SSL_REVOCATION             0x00000001
160 #define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION   0x00000002
161 #define WINHTTP_DISABLE_SPN_SERVER_PORT           0x00000000
162 #define WINHTTP_ENABLE_SPN_SERVER_PORT            0x00000001
163 #define WINHTTP_OPTION_SPN_MASK                   WINHTTP_ENABLE_SPN_SERVER_PORT
164
165 /* Options for WinHttpOpenRequest */
166 #define WINHTTP_NO_REFERER             NULL
167 #define WINHTTP_DEFAULT_ACCEPT_TYPES   NULL
168
169 /* Options for WinHttpSendRequest */
170 #define WINHTTP_NO_ADDITIONAL_HEADERS   NULL
171 #define WINHTTP_NO_REQUEST_DATA         NULL
172
173 /* WinHTTP error codes */
174 #define WINHTTP_ERROR_BASE                                  12000
175 #define ERROR_WINHTTP_OUT_OF_HANDLES                        (WINHTTP_ERROR_BASE + 1)
176 #define ERROR_WINHTTP_TIMEOUT                               (WINHTTP_ERROR_BASE + 2)
177 #define ERROR_WINHTTP_INTERNAL_ERROR                        (WINHTTP_ERROR_BASE + 4)
178 #define ERROR_WINHTTP_INVALID_URL                           (WINHTTP_ERROR_BASE + 5)
179 #define ERROR_WINHTTP_UNRECOGNIZED_SCHEME                   (WINHTTP_ERROR_BASE + 6)
180 #define ERROR_WINHTTP_NAME_NOT_RESOLVED                     (WINHTTP_ERROR_BASE + 7)
181 #define ERROR_WINHTTP_INVALID_OPTION                        (WINHTTP_ERROR_BASE + 9)
182 #define ERROR_WINHTTP_OPTION_NOT_SETTABLE                   (WINHTTP_ERROR_BASE + 11)
183 #define ERROR_WINHTTP_SHUTDOWN                              (WINHTTP_ERROR_BASE + 12)
184 #define ERROR_WINHTTP_LOGIN_FAILURE                         (WINHTTP_ERROR_BASE + 15)
185 #define ERROR_WINHTTP_OPERATION_CANCELLED                   (WINHTTP_ERROR_BASE + 17)
186 #define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE                 (WINHTTP_ERROR_BASE + 18)
187 #define ERROR_WINHTTP_INCORRECT_HANDLE_STATE                (WINHTTP_ERROR_BASE + 19)
188 #define ERROR_WINHTTP_CANNOT_CONNECT                        (WINHTTP_ERROR_BASE + 29)
189 #define ERROR_WINHTTP_CONNECTION_ERROR                      (WINHTTP_ERROR_BASE + 30)
190 #define ERROR_WINHTTP_RESEND_REQUEST                        (WINHTTP_ERROR_BASE + 32)
191 #define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID              (WINHTTP_ERROR_BASE + 37)
192 #define ERROR_WINHTTP_SECURE_CERT_CN_INVALID                (WINHTTP_ERROR_BASE + 38)
193 #define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED               (WINHTTP_ERROR_BASE + 44)
194 #define ERROR_WINHTTP_SECURE_INVALID_CA                     (WINHTTP_ERROR_BASE + 45)
195 #define ERROR_WINHTTP_SECURE_CERT_REV_FAILED                (WINHTTP_ERROR_BASE + 57)
196 #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN               (WINHTTP_ERROR_BASE + 100)
197 #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND               (WINHTTP_ERROR_BASE + 101)
198 #define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND                (WINHTTP_ERROR_BASE + 102)
199 #define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN                (WINHTTP_ERROR_BASE + 103)
200 #define ERROR_WINHTTP_HEADER_NOT_FOUND                      (WINHTTP_ERROR_BASE + 150)
201 #define ERROR_WINHTTP_INVALID_SERVER_RESPONSE               (WINHTTP_ERROR_BASE + 152)
202 #define ERROR_WINHTTP_INVALID_HEADER                        (WINHTTP_ERROR_BASE + 153)
203 #define ERROR_WINHTTP_INVALID_QUERY_REQUEST                 (WINHTTP_ERROR_BASE + 154)
204 #define ERROR_WINHTTP_HEADER_ALREADY_EXISTS                 (WINHTTP_ERROR_BASE + 155)
205 #define ERROR_WINHTTP_REDIRECT_FAILED                       (WINHTTP_ERROR_BASE + 156)
206 #define ERROR_WINHTTP_SECURE_CHANNEL_ERROR                  (WINHTTP_ERROR_BASE + 157)
207 #define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT                 (WINHTTP_ERROR_BASE + 166)
208 #define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT             (WINHTTP_ERROR_BASE + 167)
209 #define ERROR_WINHTTP_SECURE_INVALID_CERT                   (WINHTTP_ERROR_BASE + 169)
210 #define ERROR_WINHTTP_SECURE_CERT_REVOKED                   (WINHTTP_ERROR_BASE + 170)
211 #define ERROR_WINHTTP_NOT_INITIALIZED                       (WINHTTP_ERROR_BASE + 172)
212 #define ERROR_WINHTTP_SECURE_FAILURE                        (WINHTTP_ERROR_BASE + 175)
213 #define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR              (WINHTTP_ERROR_BASE + 178)
214 #define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE               (WINHTTP_ERROR_BASE + 179)
215 #define ERROR_WINHTTP_AUTODETECTION_FAILED                  (WINHTTP_ERROR_BASE + 180)
216 #define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED                 (WINHTTP_ERROR_BASE + 181)
217 #define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW                  (WINHTTP_ERROR_BASE + 182)
218 #define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183)
219 #define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW               (WINHTTP_ERROR_BASE + 184)
220 #define ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY            (WINHTTP_ERROR_BASE + 185)
221 #define ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY     (WINHTTP_ERROR_BASE + 186)
222 #define WINHTTP_ERROR_LAST                                  (WINHTTP_ERROR_BASE + 186)
223
224 /* WinHttp status codes */
225 #define HTTP_STATUS_CONTINUE            100
226 #define HTTP_STATUS_SWITCH_PROTOCOLS    101
227 #define HTTP_STATUS_OK                  200
228 #define HTTP_STATUS_CREATED             201
229 #define HTTP_STATUS_ACCEPTED            202
230 #define HTTP_STATUS_PARTIAL             203
231 #define HTTP_STATUS_NO_CONTENT          204
232 #define HTTP_STATUS_RESET_CONTENT       205
233 #define HTTP_STATUS_PARTIAL_CONTENT     206
234 #define HTTP_STATUS_WEBDAV_MULTI_STATUS 207
235 #define HTTP_STATUS_AMBIGUOUS           300
236 #define HTTP_STATUS_MOVED               301
237 #define HTTP_STATUS_REDIRECT            302
238 #define HTTP_STATUS_REDIRECT_METHOD     303
239 #define HTTP_STATUS_NOT_MODIFIED        304
240 #define HTTP_STATUS_USE_PROXY           305
241 #define HTTP_STATUS_REDIRECT_KEEP_VERB  307
242 #define HTTP_STATUS_BAD_REQUEST         400
243 #define HTTP_STATUS_DENIED              401
244 #define HTTP_STATUS_PAYMENT_REQ         402
245 #define HTTP_STATUS_FORBIDDEN           403
246 #define HTTP_STATUS_NOT_FOUND           404
247 #define HTTP_STATUS_BAD_METHOD          405
248 #define HTTP_STATUS_NONE_ACCEPTABLE     406
249 #define HTTP_STATUS_PROXY_AUTH_REQ      407
250 #define HTTP_STATUS_REQUEST_TIMEOUT     408
251 #define HTTP_STATUS_CONFLICT            409
252 #define HTTP_STATUS_GONE                410
253 #define HTTP_STATUS_LENGTH_REQUIRED     411
254 #define HTTP_STATUS_PRECOND_FAILED      412
255 #define HTTP_STATUS_REQUEST_TOO_LARGE   413
256 #define HTTP_STATUS_URI_TOO_LONG        414
257 #define HTTP_STATUS_UNSUPPORTED_MEDIA   415
258 #define HTTP_STATUS_RETRY_WITH          449
259 #define HTTP_STATUS_SERVER_ERROR        500
260 #define HTTP_STATUS_NOT_SUPPORTED       501
261 #define HTTP_STATUS_BAD_GATEWAY         502
262 #define HTTP_STATUS_SERVICE_UNAVAIL     503
263 #define HTTP_STATUS_GATEWAY_TIMEOUT     504
264 #define HTTP_STATUS_VERSION_NOT_SUP     505
265 #define HTTP_STATUS_FIRST               HTTP_STATUS_CONTINUE
266 #define HTTP_STATUS_LAST                HTTP_STATUS_VERSION_NOT_SUP
267
268 #define SECURITY_FLAG_IGNORE_UNKNOWN_CA         0x00000100
269 #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID  0x00002000
270 #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID    0x00001000
271 #define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE   0x00000200
272 #define SECURITY_FLAG_SECURE                    0x00000001
273 #define SECURITY_FLAG_STRENGTH_WEAK             0x10000000
274 #define SECURITY_FLAG_STRENGTH_MEDIUM           0x40000000
275 #define SECURITY_FLAG_STRENGTH_STRONG           0x20000000
276
277 #define ICU_NO_ENCODE          0x20000000
278 #define ICU_DECODE             0x10000000
279 #define ICU_NO_META            0x08000000
280 #define ICU_ENCODE_SPACES_ONLY 0x04000000
281 #define ICU_BROWSER_MODE       0x02000000
282 #define ICU_ENCODE_PERCENT     0x00001000
283
284 /* Query flags */
285 #define WINHTTP_QUERY_MIME_VERSION                 0
286 #define WINHTTP_QUERY_CONTENT_TYPE                 1
287 #define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING    2
288 #define WINHTTP_QUERY_CONTENT_ID                   3
289 #define WINHTTP_QUERY_CONTENT_DESCRIPTION          4
290 #define WINHTTP_QUERY_CONTENT_LENGTH               5
291 #define WINHTTP_QUERY_CONTENT_LANGUAGE             6
292 #define WINHTTP_QUERY_ALLOW                        7
293 #define WINHTTP_QUERY_PUBLIC                       8
294 #define WINHTTP_QUERY_DATE                         9
295 #define WINHTTP_QUERY_EXPIRES                      10
296 #define WINHTTP_QUERY_LAST_MODIFIED                11
297 #define WINHTTP_QUERY_MESSAGE_ID                   12
298 #define WINHTTP_QUERY_URI                          13
299 #define WINHTTP_QUERY_DERIVED_FROM                 14
300 #define WINHTTP_QUERY_COST                         15
301 #define WINHTTP_QUERY_LINK                         16
302 #define WINHTTP_QUERY_PRAGMA                       17
303 #define WINHTTP_QUERY_VERSION                      18
304 #define WINHTTP_QUERY_STATUS_CODE                  19
305 #define WINHTTP_QUERY_STATUS_TEXT                  20
306 #define WINHTTP_QUERY_RAW_HEADERS                  21
307 #define WINHTTP_QUERY_RAW_HEADERS_CRLF             22
308 #define WINHTTP_QUERY_CONNECTION                   23
309 #define WINHTTP_QUERY_ACCEPT                       24
310 #define WINHTTP_QUERY_ACCEPT_CHARSET               25
311 #define WINHTTP_QUERY_ACCEPT_ENCODING              26
312 #define WINHTTP_QUERY_ACCEPT_LANGUAGE              27
313 #define WINHTTP_QUERY_AUTHORIZATION                28
314 #define WINHTTP_QUERY_CONTENT_ENCODING             29
315 #define WINHTTP_QUERY_FORWARDED                    30
316 #define WINHTTP_QUERY_FROM                         31
317 #define WINHTTP_QUERY_IF_MODIFIED_SINCE            32
318 #define WINHTTP_QUERY_LOCATION                     33
319 #define WINHTTP_QUERY_ORIG_URI                     34
320 #define WINHTTP_QUERY_REFERER                      35
321 #define WINHTTP_QUERY_RETRY_AFTER                  36
322 #define WINHTTP_QUERY_SERVER                       37
323 #define WINHTTP_QUERY_TITLE                        38
324 #define WINHTTP_QUERY_USER_AGENT                   39
325 #define WINHTTP_QUERY_WWW_AUTHENTICATE             40
326 #define WINHTTP_QUERY_PROXY_AUTHENTICATE           41
327 #define WINHTTP_QUERY_ACCEPT_RANGES                42
328 #define WINHTTP_QUERY_SET_COOKIE                   43
329 #define WINHTTP_QUERY_COOKIE                       44
330 #define WINHTTP_QUERY_REQUEST_METHOD               45
331 #define WINHTTP_QUERY_REFRESH                      46
332 #define WINHTTP_QUERY_CONTENT_DISPOSITION          47
333 #define WINHTTP_QUERY_AGE                          48
334 #define WINHTTP_QUERY_CACHE_CONTROL                49
335 #define WINHTTP_QUERY_CONTENT_BASE                 50
336 #define WINHTTP_QUERY_CONTENT_LOCATION             51
337 #define WINHTTP_QUERY_CONTENT_MD5                  52
338 #define WINHTTP_QUERY_CONTENT_RANGE                53
339 #define WINHTTP_QUERY_ETAG                         54
340 #define WINHTTP_QUERY_HOST                         55
341 #define WINHTTP_QUERY_IF_MATCH                     56
342 #define WINHTTP_QUERY_IF_NONE_MATCH                57
343 #define WINHTTP_QUERY_IF_RANGE                     58
344 #define WINHTTP_QUERY_IF_UNMODIFIED_SINCE          59
345 #define WINHTTP_QUERY_MAX_FORWARDS                 60
346 #define WINHTTP_QUERY_PROXY_AUTHORIZATION          61
347 #define WINHTTP_QUERY_RANGE                        62
348 #define WINHTTP_QUERY_TRANSFER_ENCODING            63
349 #define WINHTTP_QUERY_UPGRADE                      64
350 #define WINHTTP_QUERY_VARY                         65
351 #define WINHTTP_QUERY_VIA                          66
352 #define WINHTTP_QUERY_WARNING                      67
353 #define WINHTTP_QUERY_EXPECT                       68
354 #define WINHTTP_QUERY_PROXY_CONNECTION             69
355 #define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE        70
356 #define WINHTTP_QUERY_PROXY_SUPPORT                75
357 #define WINHTTP_QUERY_AUTHENTICATION_INFO          76
358 #define WINHTTP_QUERY_PASSPORT_URLS                77
359 #define WINHTTP_QUERY_PASSPORT_CONFIG              78
360 #define WINHTTP_QUERY_MAX                          78
361 #define WINHTTP_QUERY_CUSTOM                       65535
362 #define WINHTTP_QUERY_FLAG_REQUEST_HEADERS         0x80000000
363 #define WINHTTP_QUERY_FLAG_SYSTEMTIME              0x40000000
364 #define WINHTTP_QUERY_FLAG_NUMBER                  0x20000000
365
366 /* Callback options */
367 #define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME          0x00000001
368 #define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED           0x00000002
369 #define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER    0x00000004
370 #define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER     0x00000008
371 #define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST         0x00000010
372 #define WINHTTP_CALLBACK_STATUS_REQUEST_SENT            0x00000020
373 #define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE      0x00000040
374 #define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED       0x00000080
375 #define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION      0x00000100
376 #define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED       0x00000200
377 #define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED          0x00000400
378 #define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING          0x00000800
379 #define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY         0x00001000
380 #define WINHTTP_CALLBACK_STATUS_REDIRECT                0x00004000
381 #define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE   0x00008000
382 #define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE          0x00010000
383 #define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE       0x00020000
384 #define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE          0x00040000
385 #define WINHTTP_CALLBACK_STATUS_READ_COMPLETE           0x00080000
386 #define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE          0x00100000
387 #define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR           0x00200000
388 #define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE    0x00400000
389 #define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME              (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED)
390 #define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER         (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER)
391 #define WINHTTP_CALLBACK_FLAG_SEND_REQUEST              (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT)
392 #define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE          (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED)
393 #define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION          (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED)
394 #define WINHTTP_CALLBACK_FLAG_HANDLES                   (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)
395 #define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY           WINHTTP_CALLBACK_STATUS_DETECTING_PROXY
396 #define WINHTTP_CALLBACK_FLAG_REDIRECT                  WINHTTP_CALLBACK_STATUS_REDIRECT
397 #define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE     WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE
398 #define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE            WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
399 #define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE      WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE
400 #define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE         WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE
401 #define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE            WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE
402 #define WINHTTP_CALLBACK_FLAG_READ_COMPLETE             WINHTTP_CALLBACK_STATUS_READ_COMPLETE
403 #define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE            WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE
404 #define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR             WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
405 #define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS           (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \
406                                                         | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE | WINHTTP_CALLBACK_STATUS_READ_COMPLETE          \
407                                                         | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR)
408 #define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS         0xffffffff
409 #define WINHTTP_INVALID_STATUS_CALLBACK                 ((WINHTTP_STATUS_CALLBACK)(-1L))
410
411 #define API_RECEIVE_RESPONSE          (1)
412 #define API_QUERY_DATA_AVAILABLE      (2)
413 #define API_READ_DATA                 (3)
414 #define API_WRITE_DATA                (4)
415 #define API_SEND_REQUEST              (5)
416
417 #define WINHTTP_HANDLE_TYPE_SESSION                  1
418 #define WINHTTP_HANDLE_TYPE_CONNECT                  2
419 #define WINHTTP_HANDLE_TYPE_REQUEST                  3
420
421 #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED         0x00000001
422 #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT            0x00000002
423 #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED            0x00000004
424 #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA              0x00000008
425 #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID         0x00000010
426 #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID       0x00000020
427 #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE        0x00000040
428 #define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR  0x80000000
429
430 #define WINHTTP_AUTH_SCHEME_BASIC      0x00000001
431 #define WINHTTP_AUTH_SCHEME_NTLM       0x00000002
432 #define WINHTTP_AUTH_SCHEME_PASSPORT   0x00000004
433 #define WINHTTP_AUTH_SCHEME_DIGEST     0x00000008
434 #define WINHTTP_AUTH_SCHEME_NEGOTIATE  0x00000010
435
436 #define WINHTTP_AUTH_TARGET_SERVER     0x00000000
437 #define WINHTTP_AUTH_TARGET_PROXY      0x00000001
438
439 #define WINHTTP_TIME_FORMAT_BUFSIZE    62
440
441 typedef struct
442 {
443     DWORD   dwStructSize;
444     LPWSTR  lpszScheme;
445     DWORD   dwSchemeLength;
446     INTERNET_SCHEME nScheme;
447     LPWSTR  lpszHostName;
448     DWORD   dwHostNameLength;
449     INTERNET_PORT nPort;
450     LPWSTR  lpszUserName;
451     DWORD   dwUserNameLength;
452     LPWSTR  lpszPassword;
453     DWORD   dwPasswordLength;
454     LPWSTR  lpszUrlPath;
455     DWORD   dwUrlPathLength;
456     LPWSTR  lpszExtraInfo;
457     DWORD   dwExtraInfoLength;
458 } URL_COMPONENTS, *LPURL_COMPONENTS;
459 typedef URL_COMPONENTS URL_COMPONENTSW;
460 typedef LPURL_COMPONENTS LPURL_COMPONENTSW;
461
462 typedef struct
463 {
464     DWORD_PTR dwResult;
465     DWORD dwError;
466 } WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT;
467
468 typedef struct
469 {
470     FILETIME ftExpiry;
471     FILETIME ftStart;
472     LPWSTR lpszSubjectInfo;
473     LPWSTR lpszIssuerInfo;
474     LPWSTR lpszProtocolName;
475     LPWSTR lpszSignatureAlgName;
476     LPWSTR lpszEncryptionAlgName;
477     DWORD dwKeySize;
478 } WINHTTP_CERTIFICATE_INFO;
479
480 typedef struct
481 {
482     DWORD dwAccessType;
483     LPCWSTR lpszProxy;
484     LPCWSTR lpszProxyBypass;
485 } WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO;
486 typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW;
487 typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW;
488
489 typedef struct
490 {
491     BOOL   fAutoDetect;
492     LPWSTR lpszAutoConfigUrl;
493     LPWSTR lpszProxy;
494     LPWSTR lpszProxyBypass;
495 } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
496
497 typedef VOID (CALLBACK *WINHTTP_STATUS_CALLBACK)(HINTERNET,DWORD_PTR,DWORD,LPVOID,DWORD);
498
499 typedef struct
500 {
501     DWORD dwFlags;
502     DWORD dwAutoDetectFlags;
503     LPCWSTR lpszAutoConfigUrl;
504     LPVOID lpvReserved;
505     DWORD dwReserved;
506     BOOL fAutoLogonIfChallenged;
507 } WINHTTP_AUTOPROXY_OPTIONS;
508
509 typedef struct
510 {
511     DWORD dwMajorVersion;
512     DWORD dwMinorVersion;
513 } HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO;
514
515
516 #ifdef __cplusplus
517 extern "C" {
518 #endif
519
520 BOOL        WINAPI WinHttpAddRequestHeaders(HINTERNET,LPCWSTR,DWORD,DWORD);
521 BOOL        WINAPI WinHttpDetectAutoProxyConfigUrl(DWORD,LPWSTR*);
522 BOOL        WINAPI WinHttpCheckPlatform(void);
523 BOOL        WINAPI WinHttpCloseHandle(HINTERNET);
524 HINTERNET   WINAPI WinHttpConnect(HINTERNET,LPCWSTR,INTERNET_PORT,DWORD);
525 BOOL        WINAPI WinHttpCrackUrl(LPCWSTR,DWORD,DWORD,LPURL_COMPONENTS);
526 BOOL        WINAPI WinHttpCreateUrl(LPURL_COMPONENTS,DWORD,LPWSTR,LPDWORD);
527 BOOL        WINAPI WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*);
528 BOOL        WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*);
529 BOOL        WINAPI WinHttpGetProxyForUrl(HINTERNET,LPCWSTR,WINHTTP_AUTOPROXY_OPTIONS*,WINHTTP_PROXY_INFO*);
530 HINTERNET   WINAPI WinHttpOpen(LPCWSTR,DWORD,LPCWSTR,LPCWSTR,DWORD);
531 HINTERNET   WINAPI WinHttpOpenRequest(HINTERNET,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR*,DWORD);
532 BOOL        WINAPI WinHttpQueryAuthParams(HINTERNET,DWORD,LPVOID*);
533 BOOL        WINAPI WinHttpQueryAuthSchemes(HINTERNET,LPDWORD,LPDWORD,LPDWORD);
534 BOOL        WINAPI WinHttpQueryDataAvailable(HINTERNET,LPDWORD);
535 BOOL        WINAPI WinHttpQueryHeaders(HINTERNET,DWORD,LPCWSTR,LPVOID,LPDWORD,LPDWORD);
536 BOOL        WINAPI WinHttpQueryOption(HINTERNET,DWORD,LPVOID,LPDWORD);
537 BOOL        WINAPI WinHttpReadData(HINTERNET,LPVOID,DWORD,LPDWORD);
538 BOOL        WINAPI WinHttpReceiveResponse(HINTERNET,LPVOID);
539 BOOL        WINAPI WinHttpSendRequest(HINTERNET,LPCWSTR,DWORD,LPVOID,DWORD,DWORD,DWORD_PTR);
540 BOOL        WINAPI WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*);
541 BOOL        WINAPI WinHttpSetCredentials(HINTERNET,DWORD,DWORD,LPCWSTR,LPCWSTR,LPVOID);
542 BOOL        WINAPI WinHttpSetOption(HINTERNET,DWORD,LPVOID,DWORD);
543 WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback(HINTERNET,WINHTTP_STATUS_CALLBACK,DWORD,DWORD_PTR);
544 BOOL        WINAPI WinHttpSetTimeouts(HINTERNET,int,int,int,int);
545 BOOL        WINAPI WinHttpTimeFromSystemTime(CONST SYSTEMTIME *,LPWSTR);
546 BOOL        WINAPI WinHttpTimeToSystemTime(LPCWSTR,SYSTEMTIME*);
547 BOOL        WINAPI WinHttpWriteData(HINTERNET,LPCVOID,DWORD,LPDWORD);
548
549 #ifdef __cplusplus
550 }
551 #endif
552
553 #endif  /* __WINE_WINHTTP_H */