xref: /reactos/sdk/include/psdk/winhttp.h (revision 4f825146)
1c2c66affSColin Finck /*
2c2c66affSColin Finck  * Copyright (C) 2007 Francois Gouget
3c2c66affSColin Finck  *
4c2c66affSColin Finck  * This library is free software; you can redistribute it and/or
5c2c66affSColin Finck  * modify it under the terms of the GNU Lesser General Public
6c2c66affSColin Finck  * License as published by the Free Software Foundation; either
7c2c66affSColin Finck  * version 2.1 of the License, or (at your option) any later version.
8c2c66affSColin Finck  *
9c2c66affSColin Finck  * This library is distributed in the hope that it will be useful,
10c2c66affSColin Finck  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12c2c66affSColin Finck  * Lesser General Public License for more details.
13c2c66affSColin Finck  *
14c2c66affSColin Finck  * You should have received a copy of the GNU Lesser General Public
15c2c66affSColin Finck  * License along with this library; if not, write to the Free Software
16c2c66affSColin Finck  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17c2c66affSColin Finck  */
18c2c66affSColin Finck 
19c2c66affSColin Finck #ifndef __WINE_WINHTTP_H
20c2c66affSColin Finck #define __WINE_WINHTTP_H
21c2c66affSColin Finck 
22c2c66affSColin Finck #ifdef _WIN64
23c2c66affSColin Finck #include <pshpack8.h>
24c2c66affSColin Finck #else
25c2c66affSColin Finck #include <pshpack4.h>
26c2c66affSColin Finck #endif
27c2c66affSColin Finck 
28c2c66affSColin Finck #define WINHTTPAPI
29c2c66affSColin Finck #define BOOLAPI WINHTTPAPI BOOL WINAPI
30c2c66affSColin Finck 
31c2c66affSColin Finck 
32c2c66affSColin Finck typedef LPVOID HINTERNET;
33c2c66affSColin Finck typedef HINTERNET *LPHINTERNET;
34c2c66affSColin Finck 
35c2c66affSColin Finck #define INTERNET_DEFAULT_PORT           0
36c2c66affSColin Finck #define INTERNET_DEFAULT_HTTP_PORT      80
37c2c66affSColin Finck #define INTERNET_DEFAULT_HTTPS_PORT     443
38c2c66affSColin Finck typedef WORD INTERNET_PORT;
39c2c66affSColin Finck typedef INTERNET_PORT *LPINTERNET_PORT;
40c2c66affSColin Finck 
41c2c66affSColin Finck /* Yes, these values contradict wininet.h */
42c2c66affSColin Finck #define INTERNET_SCHEME_HTTP            1
43c2c66affSColin Finck #define INTERNET_SCHEME_HTTPS           2
44c2c66affSColin Finck #define INTERNET_SCHEME_FTP             3
45c2c66affSColin Finck #define INTERNET_SCHEME_SOCKS           4
46c2c66affSColin Finck typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
47c2c66affSColin Finck 
48c2c66affSColin Finck #define ICU_ESCAPE  0x80000000
49c2c66affSColin Finck 
50c2c66affSColin Finck /* flags for WinHttpOpen */
51c2c66affSColin Finck #define WINHTTP_FLAG_ASYNC                  0x10000000
52c2c66affSColin Finck 
53c2c66affSColin Finck /* flags for WinHttpOpenRequest */
54c2c66affSColin Finck #define WINHTTP_FLAG_ESCAPE_PERCENT         0x00000004
55c2c66affSColin Finck #define WINHTTP_FLAG_NULL_CODEPAGE          0x00000008
56c2c66affSColin Finck #define WINHTTP_FLAG_ESCAPE_DISABLE         0x00000040
57c2c66affSColin Finck #define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY   0x00000080
58c2c66affSColin Finck #define WINHTTP_FLAG_BYPASS_PROXY_CACHE     0x00000100
59c2c66affSColin Finck #define WINHTTP_FLAG_REFRESH                WINHTTP_FLAG_BYPASS_PROXY_CACHE
60c2c66affSColin Finck #define WINHTTP_FLAG_SECURE                 0x00800000
61c2c66affSColin Finck 
62c2c66affSColin Finck #define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY   0
63c2c66affSColin Finck #define WINHTTP_ACCESS_TYPE_NO_PROXY        1
64c2c66affSColin Finck #define WINHTTP_ACCESS_TYPE_NAMED_PROXY     3
65c2c66affSColin Finck 
66c2c66affSColin Finck #define WINHTTP_NO_PROXY_NAME               NULL
67c2c66affSColin Finck #define WINHTTP_NO_PROXY_BYPASS             NULL
68c2c66affSColin Finck 
69c2c66affSColin Finck #define WINHTTP_NO_CLIENT_CERT_CONTEXT      NULL
70c2c66affSColin Finck 
71c2c66affSColin Finck #define WINHTTP_NO_REFERER                  NULL
72c2c66affSColin Finck #define WINHTTP_DEFAULT_ACCEPT_TYPES        NULL
73c2c66affSColin Finck 
74c2c66affSColin Finck #define WINHTTP_NO_ADDITIONAL_HEADERS       NULL
75c2c66affSColin Finck #define WINHTTP_NO_REQUEST_DATA             NULL
76c2c66affSColin Finck 
77c2c66affSColin Finck #define WINHTTP_HEADER_NAME_BY_INDEX        NULL
78c2c66affSColin Finck #define WINHTTP_NO_OUTPUT_BUFFER            NULL
79c2c66affSColin Finck #define WINHTTP_NO_HEADER_INDEX             NULL
80c2c66affSColin Finck 
81c2c66affSColin Finck #define WINHTTP_ADDREQ_INDEX_MASK                    0x0000FFFF
82c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAGS_MASK                    0xFFFF0000
83c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW               0x10000000
84c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_ADD                      0x20000000
85c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA      0x40000000
86c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON  0x01000000
87c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_COALESCE                 WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
88c2c66affSColin Finck #define WINHTTP_ADDREQ_FLAG_REPLACE                  0x80000000
89c2c66affSColin Finck 
90c2c66affSColin Finck #define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0
91c2c66affSColin Finck 
92c2c66affSColin Finck /* flags for WinHttp{Set/Query}Options */
93c2c66affSColin Finck #define WINHTTP_FIRST_OPTION                         WINHTTP_OPTION_CALLBACK
94c2c66affSColin Finck #define WINHTTP_OPTION_CALLBACK                       1
95c2c66affSColin Finck #define WINHTTP_OPTION_RESOLVE_TIMEOUT                2
96c2c66affSColin Finck #define WINHTTP_OPTION_CONNECT_TIMEOUT                3
97c2c66affSColin Finck #define WINHTTP_OPTION_CONNECT_RETRIES                4
98c2c66affSColin Finck #define WINHTTP_OPTION_SEND_TIMEOUT                   5
99c2c66affSColin Finck #define WINHTTP_OPTION_RECEIVE_TIMEOUT                6
100c2c66affSColin Finck #define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT       7
101c2c66affSColin Finck #define WINHTTP_OPTION_HANDLE_TYPE                    9
102c2c66affSColin Finck #define WINHTTP_OPTION_READ_BUFFER_SIZE              12
103c2c66affSColin Finck #define WINHTTP_OPTION_WRITE_BUFFER_SIZE             13
104c2c66affSColin Finck #define WINHTTP_OPTION_PARENT_HANDLE                 21
105c2c66affSColin Finck #define WINHTTP_OPTION_EXTENDED_ERROR                24
106c2c66affSColin Finck #define WINHTTP_OPTION_SECURITY_FLAGS                31
107c2c66affSColin Finck #define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT   32
108c2c66affSColin Finck #define WINHTTP_OPTION_URL                           34
109c2c66affSColin Finck #define WINHTTP_OPTION_SECURITY_KEY_BITNESS          36
110c2c66affSColin Finck #define WINHTTP_OPTION_PROXY                         38
111c2c66affSColin Finck #define WINHTTP_OPTION_USER_AGENT                    41
112c2c66affSColin Finck #define WINHTTP_OPTION_CONTEXT_VALUE                 45
113c2c66affSColin Finck #define WINHTTP_OPTION_CLIENT_CERT_CONTEXT           47
114c2c66affSColin Finck #define WINHTTP_OPTION_REQUEST_PRIORITY              58
115c2c66affSColin Finck #define WINHTTP_OPTION_HTTP_VERSION                  59
116c2c66affSColin Finck #define WINHTTP_OPTION_DISABLE_FEATURE               63
117c2c66affSColin Finck #define WINHTTP_OPTION_CODEPAGE                      68
118c2c66affSColin Finck #define WINHTTP_OPTION_MAX_CONNS_PER_SERVER          73
119c2c66affSColin Finck #define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER      74
120c2c66affSColin Finck #define WINHTTP_OPTION_AUTOLOGON_POLICY              77
121c2c66affSColin Finck #define WINHTTP_OPTION_SERVER_CERT_CONTEXT           78
122c2c66affSColin Finck #define WINHTTP_OPTION_ENABLE_FEATURE                79
123c2c66affSColin Finck #define WINHTTP_OPTION_WORKER_THREAD_COUNT           80
124c2c66affSColin Finck #define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT      81
125c2c66affSColin Finck #define WINHTTP_OPTION_PASSPORT_COBRANDING_URL       82
126c2c66affSColin Finck #define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH       83
127c2c66affSColin Finck #define WINHTTP_OPTION_SECURE_PROTOCOLS              84
128c2c66affSColin Finck #define WINHTTP_OPTION_ENABLETRACING                 85
129c2c66affSColin Finck #define WINHTTP_OPTION_PASSPORT_SIGN_OUT             86
130c2c66affSColin Finck #define WINHTTP_OPTION_PASSPORT_RETURN_URL           87
131c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY               88
132c2c66affSColin Finck #define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS  89
133c2c66affSColin Finck #define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE      90
134c2c66affSColin Finck #define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE      91
135c2c66affSColin Finck #define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE       92
136c2c66affSColin Finck #define WINHTTP_OPTION_CONNECTION_INFO               93
137c2c66affSColin Finck #define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST       94
138c2c66affSColin Finck #define WINHTTP_OPTION_SPN                           96
139c2c66affSColin Finck #define WINHTTP_OPTION_GLOBAL_PROXY_CREDS            97
140c2c66affSColin Finck #define WINHTTP_OPTION_GLOBAL_SERVER_CREDS           98
141c2c66affSColin Finck #define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT           99
142c2c66affSColin Finck #define WINHTTP_OPTION_REJECT_USERPWD_IN_URL         100
143c2c66affSColin Finck #define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101
144c2c66affSColin Finck #define WINHTTP_LAST_OPTION                          WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS
145c2c66affSColin Finck #define WINHTTP_OPTION_USERNAME                      0x1000
146c2c66affSColin Finck #define WINHTTP_OPTION_PASSWORD                      0x1001
147c2c66affSColin Finck #define WINHTTP_OPTION_PROXY_USERNAME                0x1002
148c2c66affSColin Finck #define WINHTTP_OPTION_PROXY_PASSWORD                0x1003
149c2c66affSColin Finck 
150c2c66affSColin Finck #define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF
151c2c66affSColin Finck 
152c2c66affSColin Finck #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM   0
153c2c66affSColin Finck #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW      1
154c2c66affSColin Finck #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH     2
155c2c66affSColin Finck #define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT  WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM
156c2c66affSColin Finck 
157c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY_NEVER                        0
158c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP       1
159c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS                       2
160c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY_LAST            WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS
161c2c66affSColin Finck #define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT         WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
162c2c66affSColin Finck 
163c2c66affSColin Finck #define WINHTTP_DISABLE_PASSPORT_AUTH    0x00000000
164c2c66affSColin Finck #define WINHTTP_ENABLE_PASSPORT_AUTH     0x10000000
165c2c66affSColin Finck #define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000
166c2c66affSColin Finck #define WINHTTP_ENABLE_PASSPORT_KEYRING  0x40000000
167c2c66affSColin Finck 
168c2c66affSColin Finck #define WINHTTP_DISABLE_COOKIES                   0x00000001
169c2c66affSColin Finck #define WINHTTP_DISABLE_REDIRECTS                 0x00000002
170c2c66affSColin Finck #define WINHTTP_DISABLE_AUTHENTICATION            0x00000004
171c2c66affSColin Finck #define WINHTTP_DISABLE_KEEP_ALIVE                0x00000008
172c2c66affSColin Finck #define WINHTTP_ENABLE_SSL_REVOCATION             0x00000001
173c2c66affSColin Finck #define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION   0x00000002
174c2c66affSColin Finck #define WINHTTP_DISABLE_SPN_SERVER_PORT           0x00000000
175c2c66affSColin Finck #define WINHTTP_ENABLE_SPN_SERVER_PORT            0x00000001
176c2c66affSColin Finck #define WINHTTP_OPTION_SPN_MASK                   WINHTTP_ENABLE_SPN_SERVER_PORT
177c2c66affSColin Finck 
178c2c66affSColin Finck /* Options for WinHttpOpenRequest */
179c2c66affSColin Finck #define WINHTTP_NO_REFERER             NULL
180c2c66affSColin Finck #define WINHTTP_DEFAULT_ACCEPT_TYPES   NULL
181c2c66affSColin Finck 
182c2c66affSColin Finck /* Options for WinHttpSendRequest */
183c2c66affSColin Finck #define WINHTTP_NO_ADDITIONAL_HEADERS   NULL
184c2c66affSColin Finck #define WINHTTP_NO_REQUEST_DATA         NULL
185c2c66affSColin Finck 
186c2c66affSColin Finck /* WinHTTP error codes */
187c2c66affSColin Finck #define WINHTTP_ERROR_BASE                                  12000
188c2c66affSColin Finck #define ERROR_WINHTTP_OUT_OF_HANDLES                        (WINHTTP_ERROR_BASE + 1)
189c2c66affSColin Finck #define ERROR_WINHTTP_TIMEOUT                               (WINHTTP_ERROR_BASE + 2)
190c2c66affSColin Finck #define ERROR_WINHTTP_INTERNAL_ERROR                        (WINHTTP_ERROR_BASE + 4)
191c2c66affSColin Finck #define ERROR_WINHTTP_INVALID_URL                           (WINHTTP_ERROR_BASE + 5)
192c2c66affSColin Finck #define ERROR_WINHTTP_UNRECOGNIZED_SCHEME                   (WINHTTP_ERROR_BASE + 6)
193c2c66affSColin Finck #define ERROR_WINHTTP_NAME_NOT_RESOLVED                     (WINHTTP_ERROR_BASE + 7)
194c2c66affSColin Finck #define ERROR_WINHTTP_INVALID_OPTION                        (WINHTTP_ERROR_BASE + 9)
195c2c66affSColin Finck #define ERROR_WINHTTP_OPTION_NOT_SETTABLE                   (WINHTTP_ERROR_BASE + 11)
196c2c66affSColin Finck #define ERROR_WINHTTP_SHUTDOWN                              (WINHTTP_ERROR_BASE + 12)
197c2c66affSColin Finck #define ERROR_WINHTTP_LOGIN_FAILURE                         (WINHTTP_ERROR_BASE + 15)
198c2c66affSColin Finck #define ERROR_WINHTTP_OPERATION_CANCELLED                   (WINHTTP_ERROR_BASE + 17)
199c2c66affSColin Finck #define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE                 (WINHTTP_ERROR_BASE + 18)
200c2c66affSColin Finck #define ERROR_WINHTTP_INCORRECT_HANDLE_STATE                (WINHTTP_ERROR_BASE + 19)
201c2c66affSColin Finck #define ERROR_WINHTTP_CANNOT_CONNECT                        (WINHTTP_ERROR_BASE + 29)
202c2c66affSColin Finck #define ERROR_WINHTTP_CONNECTION_ERROR                      (WINHTTP_ERROR_BASE + 30)
203c2c66affSColin Finck #define ERROR_WINHTTP_RESEND_REQUEST                        (WINHTTP_ERROR_BASE + 32)
204c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID              (WINHTTP_ERROR_BASE + 37)
205c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CERT_CN_INVALID                (WINHTTP_ERROR_BASE + 38)
206c2c66affSColin Finck #define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED               (WINHTTP_ERROR_BASE + 44)
207c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_INVALID_CA                     (WINHTTP_ERROR_BASE + 45)
208c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CERT_REV_FAILED                (WINHTTP_ERROR_BASE + 57)
209c2c66affSColin Finck #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN               (WINHTTP_ERROR_BASE + 100)
210c2c66affSColin Finck #define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND               (WINHTTP_ERROR_BASE + 101)
211c2c66affSColin Finck #define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND                (WINHTTP_ERROR_BASE + 102)
212c2c66affSColin Finck #define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN                (WINHTTP_ERROR_BASE + 103)
213c2c66affSColin Finck #define ERROR_WINHTTP_HEADER_NOT_FOUND                      (WINHTTP_ERROR_BASE + 150)
214c2c66affSColin Finck #define ERROR_WINHTTP_INVALID_SERVER_RESPONSE               (WINHTTP_ERROR_BASE + 152)
215c2c66affSColin Finck #define ERROR_WINHTTP_INVALID_HEADER                        (WINHTTP_ERROR_BASE + 153)
216c2c66affSColin Finck #define ERROR_WINHTTP_INVALID_QUERY_REQUEST                 (WINHTTP_ERROR_BASE + 154)
217c2c66affSColin Finck #define ERROR_WINHTTP_HEADER_ALREADY_EXISTS                 (WINHTTP_ERROR_BASE + 155)
218c2c66affSColin Finck #define ERROR_WINHTTP_REDIRECT_FAILED                       (WINHTTP_ERROR_BASE + 156)
219c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CHANNEL_ERROR                  (WINHTTP_ERROR_BASE + 157)
220c2c66affSColin Finck #define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT                 (WINHTTP_ERROR_BASE + 166)
221c2c66affSColin Finck #define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT             (WINHTTP_ERROR_BASE + 167)
222c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_INVALID_CERT                   (WINHTTP_ERROR_BASE + 169)
223c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CERT_REVOKED                   (WINHTTP_ERROR_BASE + 170)
224c2c66affSColin Finck #define ERROR_WINHTTP_NOT_INITIALIZED                       (WINHTTP_ERROR_BASE + 172)
225c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_FAILURE                        (WINHTTP_ERROR_BASE + 175)
226c2c66affSColin Finck #define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR              (WINHTTP_ERROR_BASE + 178)
227c2c66affSColin Finck #define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE               (WINHTTP_ERROR_BASE + 179)
228c2c66affSColin Finck #define ERROR_WINHTTP_AUTODETECTION_FAILED                  (WINHTTP_ERROR_BASE + 180)
229c2c66affSColin Finck #define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED                 (WINHTTP_ERROR_BASE + 181)
230c2c66affSColin Finck #define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW                  (WINHTTP_ERROR_BASE + 182)
231c2c66affSColin Finck #define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183)
232c2c66affSColin Finck #define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW               (WINHTTP_ERROR_BASE + 184)
233c2c66affSColin Finck #define ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY            (WINHTTP_ERROR_BASE + 185)
234c2c66affSColin Finck #define ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY     (WINHTTP_ERROR_BASE + 186)
235c2c66affSColin Finck #define WINHTTP_ERROR_LAST                                  (WINHTTP_ERROR_BASE + 186)
236c2c66affSColin Finck 
237c2c66affSColin Finck /* WinHttp status codes */
238c2c66affSColin Finck #define HTTP_STATUS_CONTINUE            100
239c2c66affSColin Finck #define HTTP_STATUS_SWITCH_PROTOCOLS    101
240c2c66affSColin Finck #define HTTP_STATUS_OK                  200
241c2c66affSColin Finck #define HTTP_STATUS_CREATED             201
242c2c66affSColin Finck #define HTTP_STATUS_ACCEPTED            202
243c2c66affSColin Finck #define HTTP_STATUS_PARTIAL             203
244c2c66affSColin Finck #define HTTP_STATUS_NO_CONTENT          204
245c2c66affSColin Finck #define HTTP_STATUS_RESET_CONTENT       205
246c2c66affSColin Finck #define HTTP_STATUS_PARTIAL_CONTENT     206
247c2c66affSColin Finck #define HTTP_STATUS_WEBDAV_MULTI_STATUS 207
248c2c66affSColin Finck #define HTTP_STATUS_AMBIGUOUS           300
249c2c66affSColin Finck #define HTTP_STATUS_MOVED               301
250c2c66affSColin Finck #define HTTP_STATUS_REDIRECT            302
251c2c66affSColin Finck #define HTTP_STATUS_REDIRECT_METHOD     303
252c2c66affSColin Finck #define HTTP_STATUS_NOT_MODIFIED        304
253c2c66affSColin Finck #define HTTP_STATUS_USE_PROXY           305
254c2c66affSColin Finck #define HTTP_STATUS_REDIRECT_KEEP_VERB  307
255c2c66affSColin Finck #define HTTP_STATUS_BAD_REQUEST         400
256c2c66affSColin Finck #define HTTP_STATUS_DENIED              401
257c2c66affSColin Finck #define HTTP_STATUS_PAYMENT_REQ         402
258c2c66affSColin Finck #define HTTP_STATUS_FORBIDDEN           403
259c2c66affSColin Finck #define HTTP_STATUS_NOT_FOUND           404
260c2c66affSColin Finck #define HTTP_STATUS_BAD_METHOD          405
261c2c66affSColin Finck #define HTTP_STATUS_NONE_ACCEPTABLE     406
262c2c66affSColin Finck #define HTTP_STATUS_PROXY_AUTH_REQ      407
263c2c66affSColin Finck #define HTTP_STATUS_REQUEST_TIMEOUT     408
264c2c66affSColin Finck #define HTTP_STATUS_CONFLICT            409
265c2c66affSColin Finck #define HTTP_STATUS_GONE                410
266c2c66affSColin Finck #define HTTP_STATUS_LENGTH_REQUIRED     411
267c2c66affSColin Finck #define HTTP_STATUS_PRECOND_FAILED      412
268c2c66affSColin Finck #define HTTP_STATUS_REQUEST_TOO_LARGE   413
269c2c66affSColin Finck #define HTTP_STATUS_URI_TOO_LONG        414
270c2c66affSColin Finck #define HTTP_STATUS_UNSUPPORTED_MEDIA   415
271c2c66affSColin Finck #define HTTP_STATUS_RETRY_WITH          449
272c2c66affSColin Finck #define HTTP_STATUS_SERVER_ERROR        500
273c2c66affSColin Finck #define HTTP_STATUS_NOT_SUPPORTED       501
274c2c66affSColin Finck #define HTTP_STATUS_BAD_GATEWAY         502
275c2c66affSColin Finck #define HTTP_STATUS_SERVICE_UNAVAIL     503
276c2c66affSColin Finck #define HTTP_STATUS_GATEWAY_TIMEOUT     504
277c2c66affSColin Finck #define HTTP_STATUS_VERSION_NOT_SUP     505
278c2c66affSColin Finck #define HTTP_STATUS_FIRST               HTTP_STATUS_CONTINUE
279c2c66affSColin Finck #define HTTP_STATUS_LAST                HTTP_STATUS_VERSION_NOT_SUP
280c2c66affSColin Finck 
281c2c66affSColin Finck #define SECURITY_FLAG_IGNORE_UNKNOWN_CA         0x00000100
282c2c66affSColin Finck #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID  0x00002000
283c2c66affSColin Finck #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID    0x00001000
284c2c66affSColin Finck #define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE   0x00000200
285c2c66affSColin Finck #define SECURITY_FLAG_SECURE                    0x00000001
286c2c66affSColin Finck #define SECURITY_FLAG_STRENGTH_WEAK             0x10000000
287c2c66affSColin Finck #define SECURITY_FLAG_STRENGTH_MEDIUM           0x40000000
288c2c66affSColin Finck #define SECURITY_FLAG_STRENGTH_STRONG           0x20000000
289c2c66affSColin Finck 
290c2c66affSColin Finck #define ICU_NO_ENCODE          0x20000000
291c2c66affSColin Finck #define ICU_DECODE             0x10000000
292c2c66affSColin Finck #define ICU_NO_META            0x08000000
293c2c66affSColin Finck #define ICU_ENCODE_SPACES_ONLY 0x04000000
294c2c66affSColin Finck #define ICU_BROWSER_MODE       0x02000000
295c2c66affSColin Finck #define ICU_ENCODE_PERCENT     0x00001000
296c2c66affSColin Finck 
297c2c66affSColin Finck /* Query flags */
298c2c66affSColin Finck #define WINHTTP_QUERY_MIME_VERSION                 0
299c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_TYPE                 1
300c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING    2
301c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_ID                   3
302c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_DESCRIPTION          4
303c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_LENGTH               5
304c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_LANGUAGE             6
305c2c66affSColin Finck #define WINHTTP_QUERY_ALLOW                        7
306c2c66affSColin Finck #define WINHTTP_QUERY_PUBLIC                       8
307c2c66affSColin Finck #define WINHTTP_QUERY_DATE                         9
308c2c66affSColin Finck #define WINHTTP_QUERY_EXPIRES                      10
309c2c66affSColin Finck #define WINHTTP_QUERY_LAST_MODIFIED                11
310c2c66affSColin Finck #define WINHTTP_QUERY_MESSAGE_ID                   12
311c2c66affSColin Finck #define WINHTTP_QUERY_URI                          13
312c2c66affSColin Finck #define WINHTTP_QUERY_DERIVED_FROM                 14
313c2c66affSColin Finck #define WINHTTP_QUERY_COST                         15
314c2c66affSColin Finck #define WINHTTP_QUERY_LINK                         16
315c2c66affSColin Finck #define WINHTTP_QUERY_PRAGMA                       17
316c2c66affSColin Finck #define WINHTTP_QUERY_VERSION                      18
317c2c66affSColin Finck #define WINHTTP_QUERY_STATUS_CODE                  19
318c2c66affSColin Finck #define WINHTTP_QUERY_STATUS_TEXT                  20
319c2c66affSColin Finck #define WINHTTP_QUERY_RAW_HEADERS                  21
320c2c66affSColin Finck #define WINHTTP_QUERY_RAW_HEADERS_CRLF             22
321c2c66affSColin Finck #define WINHTTP_QUERY_CONNECTION                   23
322c2c66affSColin Finck #define WINHTTP_QUERY_ACCEPT                       24
323c2c66affSColin Finck #define WINHTTP_QUERY_ACCEPT_CHARSET               25
324c2c66affSColin Finck #define WINHTTP_QUERY_ACCEPT_ENCODING              26
325c2c66affSColin Finck #define WINHTTP_QUERY_ACCEPT_LANGUAGE              27
326c2c66affSColin Finck #define WINHTTP_QUERY_AUTHORIZATION                28
327c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_ENCODING             29
328c2c66affSColin Finck #define WINHTTP_QUERY_FORWARDED                    30
329c2c66affSColin Finck #define WINHTTP_QUERY_FROM                         31
330c2c66affSColin Finck #define WINHTTP_QUERY_IF_MODIFIED_SINCE            32
331c2c66affSColin Finck #define WINHTTP_QUERY_LOCATION                     33
332c2c66affSColin Finck #define WINHTTP_QUERY_ORIG_URI                     34
333c2c66affSColin Finck #define WINHTTP_QUERY_REFERER                      35
334c2c66affSColin Finck #define WINHTTP_QUERY_RETRY_AFTER                  36
335c2c66affSColin Finck #define WINHTTP_QUERY_SERVER                       37
336c2c66affSColin Finck #define WINHTTP_QUERY_TITLE                        38
337c2c66affSColin Finck #define WINHTTP_QUERY_USER_AGENT                   39
338c2c66affSColin Finck #define WINHTTP_QUERY_WWW_AUTHENTICATE             40
339c2c66affSColin Finck #define WINHTTP_QUERY_PROXY_AUTHENTICATE           41
340c2c66affSColin Finck #define WINHTTP_QUERY_ACCEPT_RANGES                42
341c2c66affSColin Finck #define WINHTTP_QUERY_SET_COOKIE                   43
342c2c66affSColin Finck #define WINHTTP_QUERY_COOKIE                       44
343c2c66affSColin Finck #define WINHTTP_QUERY_REQUEST_METHOD               45
344c2c66affSColin Finck #define WINHTTP_QUERY_REFRESH                      46
345c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_DISPOSITION          47
346c2c66affSColin Finck #define WINHTTP_QUERY_AGE                          48
347c2c66affSColin Finck #define WINHTTP_QUERY_CACHE_CONTROL                49
348c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_BASE                 50
349c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_LOCATION             51
350c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_MD5                  52
351c2c66affSColin Finck #define WINHTTP_QUERY_CONTENT_RANGE                53
352c2c66affSColin Finck #define WINHTTP_QUERY_ETAG                         54
353c2c66affSColin Finck #define WINHTTP_QUERY_HOST                         55
354c2c66affSColin Finck #define WINHTTP_QUERY_IF_MATCH                     56
355c2c66affSColin Finck #define WINHTTP_QUERY_IF_NONE_MATCH                57
356c2c66affSColin Finck #define WINHTTP_QUERY_IF_RANGE                     58
357c2c66affSColin Finck #define WINHTTP_QUERY_IF_UNMODIFIED_SINCE          59
358c2c66affSColin Finck #define WINHTTP_QUERY_MAX_FORWARDS                 60
359c2c66affSColin Finck #define WINHTTP_QUERY_PROXY_AUTHORIZATION          61
360c2c66affSColin Finck #define WINHTTP_QUERY_RANGE                        62
361c2c66affSColin Finck #define WINHTTP_QUERY_TRANSFER_ENCODING            63
362c2c66affSColin Finck #define WINHTTP_QUERY_UPGRADE                      64
363c2c66affSColin Finck #define WINHTTP_QUERY_VARY                         65
364c2c66affSColin Finck #define WINHTTP_QUERY_VIA                          66
365c2c66affSColin Finck #define WINHTTP_QUERY_WARNING                      67
366c2c66affSColin Finck #define WINHTTP_QUERY_EXPECT                       68
367c2c66affSColin Finck #define WINHTTP_QUERY_PROXY_CONNECTION             69
368c2c66affSColin Finck #define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE        70
369c2c66affSColin Finck #define WINHTTP_QUERY_PROXY_SUPPORT                75
370c2c66affSColin Finck #define WINHTTP_QUERY_AUTHENTICATION_INFO          76
371c2c66affSColin Finck #define WINHTTP_QUERY_PASSPORT_URLS                77
372c2c66affSColin Finck #define WINHTTP_QUERY_PASSPORT_CONFIG              78
373c2c66affSColin Finck #define WINHTTP_QUERY_MAX                          78
374c2c66affSColin Finck #define WINHTTP_QUERY_CUSTOM                       65535
375c2c66affSColin Finck #define WINHTTP_QUERY_FLAG_REQUEST_HEADERS         0x80000000
376c2c66affSColin Finck #define WINHTTP_QUERY_FLAG_SYSTEMTIME              0x40000000
377c2c66affSColin Finck #define WINHTTP_QUERY_FLAG_NUMBER                  0x20000000
378c2c66affSColin Finck 
379c2c66affSColin Finck /* Callback options */
380c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME          0x00000001
381c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED           0x00000002
382c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER    0x00000004
383c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER     0x00000008
384c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST         0x00000010
385c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_REQUEST_SENT            0x00000020
386c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE      0x00000040
387c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED       0x00000080
388c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION      0x00000100
389c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED       0x00000200
390c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED          0x00000400
391c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING          0x00000800
392c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY         0x00001000
393c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_REDIRECT                0x00004000
394c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE   0x00008000
395c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE          0x00010000
396c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE       0x00020000
397c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE          0x00040000
398c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_READ_COMPLETE           0x00080000
399c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE          0x00100000
400c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR           0x00200000
401c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE    0x00400000
402c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME              (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED)
403c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER         (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER)
404c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_SEND_REQUEST              (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT)
405c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE          (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED)
406c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION          (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED)
407c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_HANDLES                   (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)
408c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY           WINHTTP_CALLBACK_STATUS_DETECTING_PROXY
409c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_REDIRECT                  WINHTTP_CALLBACK_STATUS_REDIRECT
410c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE     WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE
411c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE            WINHTTP_CALLBACK_STATUS_SECURE_FAILURE
412c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE      WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE
413c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE         WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE
414c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE            WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE
415c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_READ_COMPLETE             WINHTTP_CALLBACK_STATUS_READ_COMPLETE
416c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE            WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE
417c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR             WINHTTP_CALLBACK_STATUS_REQUEST_ERROR
418c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS           (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \
419c2c66affSColin Finck                                                         | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE | WINHTTP_CALLBACK_STATUS_READ_COMPLETE          \
420c2c66affSColin Finck                                                         | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR)
421c2c66affSColin Finck #define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS         0xffffffff
422c2c66affSColin Finck #define WINHTTP_INVALID_STATUS_CALLBACK                 ((WINHTTP_STATUS_CALLBACK)(-1))
423c2c66affSColin Finck 
424c2c66affSColin Finck #define API_RECEIVE_RESPONSE          (1)
425c2c66affSColin Finck #define API_QUERY_DATA_AVAILABLE      (2)
426c2c66affSColin Finck #define API_READ_DATA                 (3)
427c2c66affSColin Finck #define API_WRITE_DATA                (4)
428c2c66affSColin Finck #define API_SEND_REQUEST              (5)
429c2c66affSColin Finck 
430c2c66affSColin Finck #define WINHTTP_HANDLE_TYPE_SESSION                  1
431c2c66affSColin Finck #define WINHTTP_HANDLE_TYPE_CONNECT                  2
432c2c66affSColin Finck #define WINHTTP_HANDLE_TYPE_REQUEST                  3
433c2c66affSColin Finck 
434c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED         0x00000001
435c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT            0x00000002
436c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED            0x00000004
437c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA              0x00000008
438c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID         0x00000010
439c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID       0x00000020
440c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE        0x00000040
441c2c66affSColin Finck #define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR  0x80000000
442c2c66affSColin Finck 
443c2c66affSColin Finck #define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2   0x00000008
444c2c66affSColin Finck #define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3   0x00000020
445c2c66affSColin Finck #define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1   0x00000080
446*4f825146SAmine Khaldi #define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 0x00000200
447*4f825146SAmine Khaldi #define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 0x00000800
448*4f825146SAmine Khaldi #define WINHTTP_FLAG_SECURE_PROTOCOL_ALL    (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 |\
449*4f825146SAmine Khaldi                                              WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 |\
450*4f825146SAmine Khaldi                                              WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)
451c2c66affSColin Finck 
452c2c66affSColin Finck #define WINHTTP_AUTH_SCHEME_BASIC      0x00000001
453c2c66affSColin Finck #define WINHTTP_AUTH_SCHEME_NTLM       0x00000002
454c2c66affSColin Finck #define WINHTTP_AUTH_SCHEME_PASSPORT   0x00000004
455c2c66affSColin Finck #define WINHTTP_AUTH_SCHEME_DIGEST     0x00000008
456c2c66affSColin Finck #define WINHTTP_AUTH_SCHEME_NEGOTIATE  0x00000010
457c2c66affSColin Finck 
458c2c66affSColin Finck #define WINHTTP_AUTH_TARGET_SERVER     0x00000000
459c2c66affSColin Finck #define WINHTTP_AUTH_TARGET_PROXY      0x00000001
460c2c66affSColin Finck 
461c2c66affSColin Finck #define WINHTTP_TIME_FORMAT_BUFSIZE    62
462c2c66affSColin Finck 
463c2c66affSColin Finck typedef struct
464c2c66affSColin Finck {
465c2c66affSColin Finck     DWORD   dwStructSize;
466c2c66affSColin Finck     LPWSTR  lpszScheme;
467c2c66affSColin Finck     DWORD   dwSchemeLength;
468c2c66affSColin Finck     INTERNET_SCHEME nScheme;
469c2c66affSColin Finck     LPWSTR  lpszHostName;
470c2c66affSColin Finck     DWORD   dwHostNameLength;
471c2c66affSColin Finck     INTERNET_PORT nPort;
472c2c66affSColin Finck     LPWSTR  lpszUserName;
473c2c66affSColin Finck     DWORD   dwUserNameLength;
474c2c66affSColin Finck     LPWSTR  lpszPassword;
475c2c66affSColin Finck     DWORD   dwPasswordLength;
476c2c66affSColin Finck     LPWSTR  lpszUrlPath;
477c2c66affSColin Finck     DWORD   dwUrlPathLength;
478c2c66affSColin Finck     LPWSTR  lpszExtraInfo;
479c2c66affSColin Finck     DWORD   dwExtraInfoLength;
480c2c66affSColin Finck } URL_COMPONENTS, *LPURL_COMPONENTS;
481c2c66affSColin Finck typedef URL_COMPONENTS URL_COMPONENTSW;
482c2c66affSColin Finck typedef LPURL_COMPONENTS LPURL_COMPONENTSW;
483c2c66affSColin Finck 
484c2c66affSColin Finck typedef struct
485c2c66affSColin Finck {
486c2c66affSColin Finck     DWORD_PTR dwResult;
487c2c66affSColin Finck     DWORD dwError;
488c2c66affSColin Finck } WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT;
489c2c66affSColin Finck 
490c2c66affSColin Finck typedef struct
491c2c66affSColin Finck {
492c2c66affSColin Finck     FILETIME ftExpiry;
493c2c66affSColin Finck     FILETIME ftStart;
494c2c66affSColin Finck     LPWSTR lpszSubjectInfo;
495c2c66affSColin Finck     LPWSTR lpszIssuerInfo;
496c2c66affSColin Finck     LPWSTR lpszProtocolName;
497c2c66affSColin Finck     LPWSTR lpszSignatureAlgName;
498c2c66affSColin Finck     LPWSTR lpszEncryptionAlgName;
499c2c66affSColin Finck     DWORD dwKeySize;
500c2c66affSColin Finck } WINHTTP_CERTIFICATE_INFO;
501c2c66affSColin Finck 
502c2c66affSColin Finck typedef struct
503c2c66affSColin Finck {
504c2c66affSColin Finck     DWORD dwAccessType;
505c2c66affSColin Finck     LPWSTR lpszProxy;
506c2c66affSColin Finck     LPWSTR lpszProxyBypass;
507c2c66affSColin Finck } WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO;
508c2c66affSColin Finck typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW;
509c2c66affSColin Finck typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW;
510c2c66affSColin Finck 
511c2c66affSColin Finck typedef struct
512c2c66affSColin Finck {
513c2c66affSColin Finck     BOOL   fAutoDetect;
514c2c66affSColin Finck     LPWSTR lpszAutoConfigUrl;
515c2c66affSColin Finck     LPWSTR lpszProxy;
516c2c66affSColin Finck     LPWSTR lpszProxyBypass;
517c2c66affSColin Finck } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
518c2c66affSColin Finck 
519c2c66affSColin Finck typedef VOID
520c2c66affSColin Finck (CALLBACK *WINHTTP_STATUS_CALLBACK)(
521c2c66affSColin Finck   _In_ HINTERNET,
522c2c66affSColin Finck   _In_ DWORD_PTR,
523c2c66affSColin Finck   _In_ DWORD,
524c2c66affSColin Finck   _In_ LPVOID,
525c2c66affSColin Finck   _In_ DWORD);
526c2c66affSColin Finck 
527c2c66affSColin Finck #define WINHTTP_AUTO_DETECT_TYPE_DHCP   0x00000001
528c2c66affSColin Finck #define WINHTTP_AUTO_DETECT_TYPE_DNS_A  0x00000002
529c2c66affSColin Finck 
530c2c66affSColin Finck #define WINHTTP_AUTOPROXY_AUTO_DETECT           0x00000001
531c2c66affSColin Finck #define WINHTTP_AUTOPROXY_CONFIG_URL            0x00000002
532c2c66affSColin Finck #define WINHTTP_AUTOPROXY_RUN_INPROCESS         0x00010000
533c2c66affSColin Finck #define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY   0x00020000
534c2c66affSColin Finck 
535c2c66affSColin Finck typedef struct
536c2c66affSColin Finck {
537c2c66affSColin Finck     DWORD dwFlags;
538c2c66affSColin Finck     DWORD dwAutoDetectFlags;
539c2c66affSColin Finck     LPCWSTR lpszAutoConfigUrl;
540c2c66affSColin Finck     LPVOID lpvReserved;
541c2c66affSColin Finck     DWORD dwReserved;
542c2c66affSColin Finck     BOOL fAutoLogonIfChallenged;
543c2c66affSColin Finck } WINHTTP_AUTOPROXY_OPTIONS;
544c2c66affSColin Finck 
545c2c66affSColin Finck typedef struct
546c2c66affSColin Finck {
547c2c66affSColin Finck     DWORD dwMajorVersion;
548c2c66affSColin Finck     DWORD dwMinorVersion;
549c2c66affSColin Finck } HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO;
550c2c66affSColin Finck 
551c2c66affSColin Finck #ifdef _WS2DEF_
552c2c66affSColin Finck typedef struct
553c2c66affSColin Finck {
554c2c66affSColin Finck     DWORD cbSize;
555c2c66affSColin Finck     SOCKADDR_STORAGE LocalAddress;
556c2c66affSColin Finck     SOCKADDR_STORAGE RemoteAddress;
557c2c66affSColin Finck } WINHTTP_CONNECTION_INFO;
558c2c66affSColin Finck #endif
559c2c66affSColin Finck 
560c2c66affSColin Finck #ifdef __cplusplus
561c2c66affSColin Finck extern "C" {
562c2c66affSColin Finck #endif
563c2c66affSColin Finck 
564c2c66affSColin Finck BOOL
565c2c66affSColin Finck WINAPI
566c2c66affSColin Finck WinHttpAddRequestHeaders(
567c2c66affSColin Finck   _In_ HINTERNET,
568c2c66affSColin Finck   _When_(dwHeadersLength == (DWORD)-1, _In_z_)
569c2c66affSColin Finck   _When_(dwHeadersLength != (DWORD)-1, _In_reads_(dwHeadersLength))
570c2c66affSColin Finck     LPCWSTR,
571c2c66affSColin Finck   _In_ DWORD dwHeadersLength,
572c2c66affSColin Finck   _In_ DWORD);
573c2c66affSColin Finck 
574c2c66affSColin Finck BOOL
575c2c66affSColin Finck WINAPI
576c2c66affSColin Finck WinHttpDetectAutoProxyConfigUrl(
577c2c66affSColin Finck   _In_ DWORD,
578c2c66affSColin Finck   _Outptr_result_maybenull_ LPWSTR*);
579c2c66affSColin Finck 
580c2c66affSColin Finck BOOL        WINAPI WinHttpCheckPlatform(void);
581c2c66affSColin Finck BOOL        WINAPI WinHttpCloseHandle(_In_ HINTERNET);
582c2c66affSColin Finck 
583c2c66affSColin Finck HINTERNET
584c2c66affSColin Finck WINAPI
585c2c66affSColin Finck WinHttpConnect(
586c2c66affSColin Finck   _In_ HINTERNET,
587c2c66affSColin Finck   _In_ LPCWSTR,
588c2c66affSColin Finck   _In_ INTERNET_PORT,
589c2c66affSColin Finck   _Reserved_ DWORD);
590c2c66affSColin Finck 
591c2c66affSColin Finck BOOL
592c2c66affSColin Finck WINAPI
593c2c66affSColin Finck WinHttpCrackUrl(
594c2c66affSColin Finck   _In_reads_(dwUrlLength) LPCWSTR,
595c2c66affSColin Finck   _In_ DWORD dwUrlLength,
596c2c66affSColin Finck   _In_ DWORD,
597c2c66affSColin Finck   _Inout_ LPURL_COMPONENTS);
598c2c66affSColin Finck 
599c2c66affSColin Finck _Success_(return != 0)
600c2c66affSColin Finck BOOL
601c2c66affSColin Finck WINAPI
602c2c66affSColin Finck WinHttpCreateUrl(
603c2c66affSColin Finck   _In_ LPURL_COMPONENTS,
604c2c66affSColin Finck   _In_ DWORD,
605c2c66affSColin Finck   _Out_writes_to_opt_(*pdwUrlLength, *pdwUrlLength) LPWSTR,
606c2c66affSColin Finck   _Inout_ LPDWORD pdwUrlLength);
607c2c66affSColin Finck 
608c2c66affSColin Finck BOOL
609c2c66affSColin Finck WINAPI
610c2c66affSColin Finck WinHttpGetDefaultProxyConfiguration(
611c2c66affSColin Finck   _Inout_ WINHTTP_PROXY_INFO*);
612c2c66affSColin Finck 
613c2c66affSColin Finck BOOL
614c2c66affSColin Finck WINAPI
615c2c66affSColin Finck WinHttpGetIEProxyConfigForCurrentUser(
616c2c66affSColin Finck   _Inout_ WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*);
617c2c66affSColin Finck 
618c2c66affSColin Finck BOOL
619c2c66affSColin Finck WINAPI
620c2c66affSColin Finck WinHttpGetProxyForUrl(
621c2c66affSColin Finck   _In_ HINTERNET,
622c2c66affSColin Finck   _In_ LPCWSTR,
623c2c66affSColin Finck   _In_ WINHTTP_AUTOPROXY_OPTIONS*,
624c2c66affSColin Finck   _Out_ WINHTTP_PROXY_INFO*);
625c2c66affSColin Finck 
626c2c66affSColin Finck HINTERNET
627c2c66affSColin Finck WINAPI
628c2c66affSColin Finck WinHttpOpen(
629c2c66affSColin Finck   _In_opt_z_ LPCWSTR,
630c2c66affSColin Finck   _In_ DWORD,
631c2c66affSColin Finck   _In_opt_z_ LPCWSTR,
632c2c66affSColin Finck   _In_opt_z_ LPCWSTR,
633c2c66affSColin Finck   _In_ DWORD);
634c2c66affSColin Finck 
635c2c66affSColin Finck HINTERNET
636c2c66affSColin Finck WINAPI
637c2c66affSColin Finck WinHttpOpenRequest(
638c2c66affSColin Finck   _In_ HINTERNET,
639c2c66affSColin Finck   _In_ LPCWSTR,
640c2c66affSColin Finck   _In_ LPCWSTR,
641c2c66affSColin Finck   _In_ LPCWSTR,
642c2c66affSColin Finck   _In_ LPCWSTR,
643c2c66affSColin Finck   _In_ LPCWSTR*,
644c2c66affSColin Finck   _In_ DWORD);
645c2c66affSColin Finck 
646c2c66affSColin Finck BOOL
647c2c66affSColin Finck WINAPI
648c2c66affSColin Finck WinHttpQueryAuthParams(
649c2c66affSColin Finck   _In_ HINTERNET,
650c2c66affSColin Finck   _In_ DWORD,
651c2c66affSColin Finck   _Out_ LPVOID*);
652c2c66affSColin Finck 
653c2c66affSColin Finck BOOL
654c2c66affSColin Finck WINAPI
655c2c66affSColin Finck WinHttpQueryAuthSchemes(
656c2c66affSColin Finck   _In_ HINTERNET,
657c2c66affSColin Finck   _Out_ LPDWORD,
658c2c66affSColin Finck   _Out_ LPDWORD,
659c2c66affSColin Finck   _Out_ LPDWORD);
660c2c66affSColin Finck 
661c2c66affSColin Finck BOOL
662c2c66affSColin Finck WINAPI
663c2c66affSColin Finck WinHttpQueryDataAvailable(
664c2c66affSColin Finck   _In_ HINTERNET,
665c2c66affSColin Finck   __out_data_source(NETWORK) LPDWORD);
666c2c66affSColin Finck 
667c2c66affSColin Finck _Success_(return != 0)
668c2c66affSColin Finck BOOL
669c2c66affSColin Finck WINAPI
670c2c66affSColin Finck WinHttpQueryHeaders(
671c2c66affSColin Finck   _In_ HINTERNET,
672c2c66affSColin Finck   _In_ DWORD,
673c2c66affSColin Finck   _In_opt_ LPCWSTR,
674c2c66affSColin Finck   _Out_writes_bytes_to_opt_(*lpdwBufferLength, *lpdwBufferLength) __out_data_source(NETWORK) LPVOID,
675c2c66affSColin Finck   _Inout_ LPDWORD lpdwBufferLength,
676c2c66affSColin Finck   _Inout_ LPDWORD);
677c2c66affSColin Finck 
678c2c66affSColin Finck _Success_(return != 0)
679c2c66affSColin Finck BOOL
680c2c66affSColin Finck WINAPI
681c2c66affSColin Finck WinHttpQueryOption(
682c2c66affSColin Finck   _In_ HINTERNET,
683c2c66affSColin Finck   _In_ DWORD,
684c2c66affSColin Finck   _Out_writes_bytes_to_opt_(*lpdwBufferLength, *lpdwBufferLength) __out_data_source(NETWORK) LPVOID,
685c2c66affSColin Finck   _Inout_ LPDWORD lpdwBufferLength);
686c2c66affSColin Finck 
687c2c66affSColin Finck BOOL
688c2c66affSColin Finck WINAPI
689c2c66affSColin Finck WinHttpReadData(
690c2c66affSColin Finck   _In_ HINTERNET,
691c2c66affSColin Finck   _Out_writes_bytes_to_(dwNumberOfBytesToRead, *lpdwNumberOfBytesRead) __out_data_source(NETWORK) LPVOID,
692c2c66affSColin Finck   _In_ DWORD dwNumberOfBytesToRead,
693c2c66affSColin Finck   _Out_ LPDWORD lpdwNumberOfBytesRead);
694c2c66affSColin Finck 
695c2c66affSColin Finck BOOL WINAPI WinHttpReceiveResponse(_In_ HINTERNET, _Reserved_ LPVOID);
696c2c66affSColin Finck 
697c2c66affSColin Finck BOOL
698c2c66affSColin Finck WINAPI
699c2c66affSColin Finck WinHttpSendRequest(
700c2c66affSColin Finck   _In_ HINTERNET,
701c2c66affSColin Finck   _In_reads_opt_(dwHeadersLength) LPCWSTR,
702c2c66affSColin Finck   _In_ DWORD dwHeadersLength,
703c2c66affSColin Finck   _In_reads_bytes_opt_(dwOptionalLength) LPVOID,
704c2c66affSColin Finck   _In_ DWORD dwOptionalLength,
705c2c66affSColin Finck   _In_ DWORD,
706c2c66affSColin Finck   _In_ DWORD_PTR);
707c2c66affSColin Finck 
708c2c66affSColin Finck BOOL
709c2c66affSColin Finck WINAPI
710c2c66affSColin Finck WinHttpSetDefaultProxyConfiguration(
711c2c66affSColin Finck   _In_ WINHTTP_PROXY_INFO*);
712c2c66affSColin Finck 
713c2c66affSColin Finck BOOL
714c2c66affSColin Finck WINAPI
715c2c66affSColin Finck WinHttpSetCredentials(
716c2c66affSColin Finck   _In_ HINTERNET,
717c2c66affSColin Finck   _In_ DWORD,
718c2c66affSColin Finck   _In_ DWORD,
719c2c66affSColin Finck   _In_ LPCWSTR,
720c2c66affSColin Finck   _In_ LPCWSTR,
721c2c66affSColin Finck   _Reserved_ LPVOID);
722c2c66affSColin Finck 
723c2c66affSColin Finck BOOL
724c2c66affSColin Finck WINAPI
725c2c66affSColin Finck WinHttpSetOption(
726c2c66affSColin Finck   _In_opt_ HINTERNET,
727c2c66affSColin Finck   _In_ DWORD dwOption,
728c2c66affSColin Finck   _When_((dwOption == WINHTTP_OPTION_USERNAME ||
729c2c66affSColin Finck           dwOption == WINHTTP_OPTION_PASSWORD ||
730c2c66affSColin Finck           dwOption == WINHTTP_OPTION_PROXY_USERNAME ||
731c2c66affSColin Finck           dwOption == WINHTTP_OPTION_PROXY_PASSWORD ||
732c2c66affSColin Finck           dwOption == WINHTTP_OPTION_USER_AGENT),
733c2c66affSColin Finck          _At_((LPCWSTR) lpBuffer, _In_reads_(dwBufferLength)))
734c2c66affSColin Finck   _When_((dwOption != WINHTTP_OPTION_USERNAME &&
735c2c66affSColin Finck           dwOption != WINHTTP_OPTION_PASSWORD &&
736c2c66affSColin Finck           dwOption != WINHTTP_OPTION_PROXY_USERNAME &&
737c2c66affSColin Finck           dwOption != WINHTTP_OPTION_PROXY_PASSWORD &&
738c2c66affSColin Finck           dwOption != WINHTTP_OPTION_USER_AGENT),
739c2c66affSColin Finck          _In_reads_bytes_(dwBufferLength))
740c2c66affSColin Finck     LPVOID lpBuffer,
741c2c66affSColin Finck   _In_ DWORD dwBufferLength);
742c2c66affSColin Finck 
743c2c66affSColin Finck WINHTTP_STATUS_CALLBACK
744c2c66affSColin Finck WINAPI
745c2c66affSColin Finck WinHttpSetStatusCallback(
746c2c66affSColin Finck   _In_ HINTERNET,
747c2c66affSColin Finck   _In_ WINHTTP_STATUS_CALLBACK,
748c2c66affSColin Finck   _In_ DWORD,
749c2c66affSColin Finck   _Reserved_ DWORD_PTR);
750c2c66affSColin Finck 
751c2c66affSColin Finck BOOL
752c2c66affSColin Finck WINAPI
753c2c66affSColin Finck WinHttpSetTimeouts(
754c2c66affSColin Finck   _In_ HINTERNET,
755c2c66affSColin Finck   _In_ int,
756c2c66affSColin Finck   _In_ int,
757c2c66affSColin Finck   _In_ int,
758c2c66affSColin Finck   _In_ int);
759c2c66affSColin Finck 
760c2c66affSColin Finck BOOL
761c2c66affSColin Finck WINAPI
762c2c66affSColin Finck WinHttpTimeFromSystemTime(
763c2c66affSColin Finck   _In_ CONST SYSTEMTIME *,
764c2c66affSColin Finck   _Out_writes_bytes_(WINHTTP_TIME_FORMAT_BUFSIZE) LPWSTR);
765c2c66affSColin Finck 
766c2c66affSColin Finck BOOL WINAPI WinHttpTimeToSystemTime(_In_z_ LPCWSTR, _Out_ SYSTEMTIME*);
767c2c66affSColin Finck 
768c2c66affSColin Finck BOOL
769c2c66affSColin Finck WINAPI
770c2c66affSColin Finck WinHttpWriteData(
771c2c66affSColin Finck   _In_ HINTERNET,
772c2c66affSColin Finck   _In_reads_bytes_opt_(dwNumberOfBytesToWrite) LPCVOID,
773c2c66affSColin Finck   _In_ DWORD dwNumberOfBytesToWrite,
774c2c66affSColin Finck   _Out_ LPDWORD);
775c2c66affSColin Finck 
776c2c66affSColin Finck #ifdef __cplusplus
777c2c66affSColin Finck }
778c2c66affSColin Finck #endif
779c2c66affSColin Finck 
780c2c66affSColin Finck #include <poppack.h>
781c2c66affSColin Finck 
782c2c66affSColin Finck #endif  /* __WINE_WINHTTP_H */
783