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
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)
70 INTERNET_SCHEME nScheme
;
72 DWORD dwHostNameLength
;
75 DWORD dwUserNameLength
;
77 DWORD dwPasswordLength
;
79 DWORD dwUrlPathLength
;
81 DWORD dwExtraInfoLength
;
82 } URL_COMPONENTS
, *LPURL_COMPONENTS
;
83 typedef URL_COMPONENTS URL_COMPONENTSW
;
84 typedef LPURL_COMPONENTS LPURL_COMPONENTSW
;
90 } WINHTTP_ASYNC_RESULT
, *LPWINHTTP_ASYNC_RESULT
;
96 LPWSTR lpszSubjectInfo
;
97 LPWSTR lpszIssuerInfo
;
98 LPWSTR lpszProtocolName
;
99 LPWSTR lpszSignatureAlgName
;
100 LPWSTR lpszEncryptionAlgName
;
102 } WINHTTP_CERTIFICATE_INFO
;
108 LPCWSTR lpszProxyBypass
;
109 } WINHTTP_PROXY_INFO
, *LPWINHTTP_PROXY_INFO
;
110 typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW
;
111 typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW
;
116 LPWSTR lpszAutoConfigUrl
;
118 LPWSTR lpszProxyBypass
;
119 } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG
;
121 typedef VOID (CALLBACK
*WINHTTP_STATUS_CALLBACK
)(HINTERNET
,DWORD_PTR
,DWORD
,LPVOID
,DWORD
);
126 DWORD dwAutoDetectFlags
;
127 LPCWSTR lpszAutoConfigUrl
;
130 BOOL fAutoLogonIfChallenged
;
131 } WINHTTP_AUTOPROXY_OPTIONS
;
135 DWORD dwMajorVersion
;
136 DWORD dwMinorVersion
;
137 } HTTP_VERSION_INFO
, *LPHTTP_VERSION_INFO
;
144 BOOL WINAPI
WinHttpAddRequestHeaders(HINTERNET
,LPCWSTR
,DWORD
,DWORD
);
145 BOOL WINAPI
WinHttpDetectAutoProxyConfigUrl(DWORD
,LPWSTR
*);
146 BOOL WINAPI
WinHttpCheckPlatform(void);
147 BOOL WINAPI
WinHttpCloseHandle(HINTERNET
);
148 HINTERNET WINAPI
WinHttpConnect(HINTERNET
,LPCWSTR
,INTERNET_PORT
,DWORD
);
149 BOOL WINAPI
WinHttpCrackUrl(LPCWSTR
,DWORD
,DWORD
,LPURL_COMPONENTS
);
150 BOOL WINAPI
WinHttpCreateUrl(LPURL_COMPONENTS
,DWORD
,LPWSTR
,LPDWORD
);
151 BOOL WINAPI
WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO
*);
152 BOOL WINAPI
WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG
* config
);
153 BOOL WINAPI
WinHttpGetProxyForUrl(HINTERNET
,LPCWSTR
,WINHTTP_AUTOPROXY_OPTIONS
*,WINHTTP_PROXY_INFO
*);
154 HINTERNET WINAPI
WinHttpOpen(LPCWSTR
,DWORD
,LPCWSTR
,LPCWSTR
,DWORD
);
155 HINTERNET WINAPI
WinHttpOpenRequest(HINTERNET
,LPCWSTR
,LPCWSTR
,LPCWSTR
,LPCWSTR
,LPCWSTR
,DWORD
);
156 BOOL WINAPI
WinHttpQueryAuthParams(HINTERNET
,DWORD
,LPVOID
*);
157 BOOL WINAPI
WinHttpQueryAuthSchemes(HINTERNET
,LPDWORD
,LPDWORD
,LPDWORD
);
158 BOOL WINAPI
WinHttpQueryDataAvailable(HINTERNET
,LPDWORD
);
159 BOOL WINAPI
WinHttpQueryHeaders(HINTERNET
,DWORD
,LPCWSTR
,LPVOID
,LPDWORD
,LPDWORD
);
160 BOOL WINAPI
WinHttpReadData(HINTERNET
,LPVOID
,DWORD
,LPDWORD
);
161 BOOL WINAPI
WinHttpReceiveResponse(HINTERNET
,LPVOID
);
162 BOOL WINAPI
WinHttpSendRequest(HINTERNET
,LPCWSTR
,DWORD
,LPVOID
,DWORD
,DWORD
,DWORD_PTR
);
163 BOOL WINAPI
WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO
*);
164 BOOL WINAPI
WinHttpSetCredentials(HINTERNET
,DWORD
,DWORD
,LPCWSTR
,LPCWSTR
,LPVOID
);
165 BOOL WINAPI
WinHttpSetOption(HINTERNET
,DWORD
,LPVOID
,DWORD
);
166 WINHTTP_STATUS_CALLBACK WINAPI
WinHttpSetStatusCallback(HINTERNET
,WINHTTP_STATUS_CALLBACK
,DWORD
,DWORD_PTR
);
167 BOOL WINAPI
WinHttpSetTimeouts(HINTERNET
,int,int,int,int);
168 BOOL WINAPI
WinHttpTimeFromSystemTime(CONST SYSTEMTIME
*,LPWSTR
);
169 BOOL WINAPI
WinHttpTimeToSystemTime(LPCWSTR
,SYSTEMTIME
*);
170 BOOL WINAPI
WinHttpWriteData(HINTERNET
,LPCVOID
,DWORD
,LPDWORD
);
176 #endif /* __WINE_WINHTTP_H */