exception.h: Make the RtlUnwind wrapper available separately.
[wine/wine64.git] / include / winhttp.h
blobcedcea323a246e1af5b707a546d96a8a60f2868f
1 /*
2 * Copyright (C) 2007 Francois Gouget
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.
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.
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
19 #ifndef __WINE_WINHTTP_H
20 #define __WINE_WINHTTP_H
22 #define WINHTTPAPI
23 #define BOOLAPI WINHTTPAPI BOOL WINAPI
26 typedef LPVOID HINTERNET;
27 typedef HINTERNET *LPHINTERNET;
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;
35 #define INTERNET_SCHEME_HTTP 1
36 #define INTERNET_SCHEME_HTTPS 2
37 typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
39 /* flags for WinHttpOpen */
40 #define WINHTTP_FLAG_ASYNC 0x10000000
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
51 #define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0
52 #define WINHTTP_ACCESS_TYPE_NO_PROXY 1
53 #define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3
55 #define WINHTTP_NO_PROXY_NAME NULL
56 #define WINHTTP_NO_PROXY_BYPASS NULL
58 #define WINHTTP_NO_REFERER NULL
59 #define WINHTTP_DEFAULT_ACCEPT_TYPES NULL
61 #define WINHTTP_ERROR_BASE 12000
63 #define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180)
65 /* flags for WinHttp{Set/Query}Options */
66 #define WINHTTP_FIRST_OPTION WINHTTP_OPTION_CALLBACK
67 #define WINHTTP_OPTION_CALLBACK 1
68 #define WINHTTP_OPTION_RESOLVE_TIMEOUT 2
69 #define WINHTTP_OPTION_CONNECT_TIMEOUT 3
70 #define WINHTTP_OPTION_CONNECT_RETRIES 4
71 #define WINHTTP_OPTION_SEND_TIMEOUT 5
72 #define WINHTTP_OPTION_RECEIVE_TIMEOUT 6
73 #define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT 7
74 #define WINHTTP_OPTION_HANDLE_TYPE 9
75 #define WINHTTP_OPTION_READ_BUFFER_SIZE 12
76 #define WINHTTP_OPTION_WRITE_BUFFER_SIZE 13
77 #define WINHTTP_OPTION_PARENT_HANDLE 21
78 #define WINHTTP_OPTION_EXTENDED_ERROR 24
79 #define WINHTTP_OPTION_SECURITY_FLAGS 31
80 #define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT 32
81 #define WINHTTP_OPTION_URL 34
82 #define WINHTTP_OPTION_SECURITY_KEY_BITNESS 36
83 #define WINHTTP_OPTION_PROXY 38
84 #define WINHTTP_OPTION_USER_AGENT 41
85 #define WINHTTP_OPTION_CONTEXT_VALUE 45
86 #define WINHTTP_OPTION_CLIENT_CERT_CONTEXT 47
87 #define WINHTTP_OPTION_REQUEST_PRIORITY 58
88 #define WINHTTP_OPTION_HTTP_VERSION 59
89 #define WINHTTP_OPTION_DISABLE_FEATURE 63
90 #define WINHTTP_OPTION_CODEPAGE 68
91 #define WINHTTP_OPTION_MAX_CONNS_PER_SERVER 73
92 #define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER 74
93 #define WINHTTP_OPTION_AUTOLOGON_POLICY 77
94 #define WINHTTP_OPTION_SERVER_CERT_CONTEXT 78
95 #define WINHTTP_OPTION_ENABLE_FEATURE 79
96 #define WINHTTP_OPTION_WORKER_THREAD_COUNT 80
97 #define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT 81
98 #define WINHTTP_OPTION_PASSPORT_COBRANDING_URL 82
99 #define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH 83
100 #define WINHTTP_OPTION_SECURE_PROTOCOLS 84
101 #define WINHTTP_OPTION_ENABLETRACING 85
102 #define WINHTTP_OPTION_PASSPORT_SIGN_OUT 86
103 #define WINHTTP_OPTION_PASSPORT_RETURN_URL 87
104 #define WINHTTP_OPTION_REDIRECT_POLICY 88
105 #define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS 89
106 #define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE 90
107 #define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE 91
108 #define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE 92
109 #define WINHTTP_OPTION_CONNECTION_INFO 93
110 #define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST 94
111 #define WINHTTP_OPTION_SPN 96
112 #define WINHTTP_OPTION_GLOBAL_PROXY_CREDS 97
113 #define WINHTTP_OPTION_GLOBAL_SERVER_CREDS 98
114 #define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT 99
115 #define WINHTTP_OPTION_REJECT_USERPWD_IN_URL 100
116 #define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101
117 #define WINHTTP_LAST_OPTION WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS
118 #define WINHTTP_OPTION_USERNAME 0x1000
119 #define WINHTTP_OPTION_PASSWORD 0x1001
120 #define WINHTTP_OPTION_PROXY_USERNAME 0x1002
121 #define WINHTTP_OPTION_PROXY_PASSWORD 0x1003
123 /* Options for WinHttpOpenRequest */
124 #define WINHTTP_NO_REFERER NULL
125 #define WINHTTP_DEFAULT_ACCEPT_TYPES NULL
127 /* Options for WinHttpSendRequest */
128 #define WINHTTP_NO_ADDITIONAL_HEADERS NULL
129 #define WINHTTP_NO_REQUEST_DATA NULL
131 typedef struct
133 DWORD dwStructSize;
134 LPWSTR lpszScheme;
135 DWORD dwSchemeLength;
136 INTERNET_SCHEME nScheme;
137 LPWSTR lpszHostName;
138 DWORD dwHostNameLength;
139 INTERNET_PORT nPort;
140 LPWSTR lpszUserName;
141 DWORD dwUserNameLength;
142 LPWSTR lpszPassword;
143 DWORD dwPasswordLength;
144 LPWSTR lpszUrlPath;
145 DWORD dwUrlPathLength;
146 LPWSTR lpszExtraInfo;
147 DWORD dwExtraInfoLength;
148 } URL_COMPONENTS, *LPURL_COMPONENTS;
149 typedef URL_COMPONENTS URL_COMPONENTSW;
150 typedef LPURL_COMPONENTS LPURL_COMPONENTSW;
152 typedef struct
154 DWORD_PTR dwResult;
155 DWORD dwError;
156 } WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT;
158 typedef struct
160 FILETIME ftExpiry;
161 FILETIME ftStart;
162 LPWSTR lpszSubjectInfo;
163 LPWSTR lpszIssuerInfo;
164 LPWSTR lpszProtocolName;
165 LPWSTR lpszSignatureAlgName;
166 LPWSTR lpszEncryptionAlgName;
167 DWORD dwKeySize;
168 } WINHTTP_CERTIFICATE_INFO;
170 typedef struct
172 DWORD dwAccessType;
173 LPCWSTR lpszProxy;
174 LPCWSTR lpszProxyBypass;
175 } WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO;
176 typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW;
177 typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW;
179 typedef struct
181 BOOL fAutoDetect;
182 LPWSTR lpszAutoConfigUrl;
183 LPWSTR lpszProxy;
184 LPWSTR lpszProxyBypass;
185 } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
187 typedef VOID (CALLBACK *WINHTTP_STATUS_CALLBACK)(HINTERNET,DWORD_PTR,DWORD,LPVOID,DWORD);
189 typedef struct
191 DWORD dwFlags;
192 DWORD dwAutoDetectFlags;
193 LPCWSTR lpszAutoConfigUrl;
194 LPVOID lpvReserved;
195 DWORD dwReserved;
196 BOOL fAutoLogonIfChallenged;
197 } WINHTTP_AUTOPROXY_OPTIONS;
199 typedef struct
201 DWORD dwMajorVersion;
202 DWORD dwMinorVersion;
203 } HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO;
206 #ifdef __cplusplus
207 extern "C" {
208 #endif
210 BOOL WINAPI WinHttpAddRequestHeaders(HINTERNET,LPCWSTR,DWORD,DWORD);
211 BOOL WINAPI WinHttpDetectAutoProxyConfigUrl(DWORD,LPWSTR*);
212 BOOL WINAPI WinHttpCheckPlatform(void);
213 BOOL WINAPI WinHttpCloseHandle(HINTERNET);
214 HINTERNET WINAPI WinHttpConnect(HINTERNET,LPCWSTR,INTERNET_PORT,DWORD);
215 BOOL WINAPI WinHttpCrackUrl(LPCWSTR,DWORD,DWORD,LPURL_COMPONENTS);
216 BOOL WINAPI WinHttpCreateUrl(LPURL_COMPONENTS,DWORD,LPWSTR,LPDWORD);
217 BOOL WINAPI WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*);
218 BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG* config);
219 BOOL WINAPI WinHttpGetProxyForUrl(HINTERNET,LPCWSTR,WINHTTP_AUTOPROXY_OPTIONS*,WINHTTP_PROXY_INFO*);
220 HINTERNET WINAPI WinHttpOpen(LPCWSTR,DWORD,LPCWSTR,LPCWSTR,DWORD);
221 HINTERNET WINAPI WinHttpOpenRequest(HINTERNET,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,DWORD);
222 BOOL WINAPI WinHttpQueryAuthParams(HINTERNET,DWORD,LPVOID*);
223 BOOL WINAPI WinHttpQueryAuthSchemes(HINTERNET,LPDWORD,LPDWORD,LPDWORD);
224 BOOL WINAPI WinHttpQueryDataAvailable(HINTERNET,LPDWORD);
225 BOOL WINAPI WinHttpQueryHeaders(HINTERNET,DWORD,LPCWSTR,LPVOID,LPDWORD,LPDWORD);
226 BOOL WINAPI WinHttpReadData(HINTERNET,LPVOID,DWORD,LPDWORD);
227 BOOL WINAPI WinHttpReceiveResponse(HINTERNET,LPVOID);
228 BOOL WINAPI WinHttpSendRequest(HINTERNET,LPCWSTR,DWORD,LPVOID,DWORD,DWORD,DWORD_PTR);
229 BOOL WINAPI WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*);
230 BOOL WINAPI WinHttpSetCredentials(HINTERNET,DWORD,DWORD,LPCWSTR,LPCWSTR,LPVOID);
231 BOOL WINAPI WinHttpSetOption(HINTERNET,DWORD,LPVOID,DWORD);
232 WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback(HINTERNET,WINHTTP_STATUS_CALLBACK,DWORD,DWORD_PTR);
233 BOOL WINAPI WinHttpSetTimeouts(HINTERNET,int,int,int,int);
234 BOOL WINAPI WinHttpTimeFromSystemTime(CONST SYSTEMTIME *,LPWSTR);
235 BOOL WINAPI WinHttpTimeToSystemTime(LPCWSTR,SYSTEMTIME*);
236 BOOL WINAPI WinHttpWriteData(HINTERNET,LPCVOID,DWORD,LPDWORD);
238 #ifdef __cplusplus
240 #endif
242 #endif /* __WINE_WINHTTP_H */