299 const WCHAR **accept_types;
300 BYTE security_id[512];
306 static const WCHAR wszBindVerb[BINDVERB_CUSTOM][5] =
333 if(!
This->base.connection) {
335 return INET_E_CANNOT_CONNECT;
339 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_ROOTDOC_URL, &rootdoc_url, 1, &
num);
346 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_ACCEPT_MIMES, accept_mimes,
num, &
num);
347 if(
hres == INET_E_USE_DEFAULT_SETTING) {
348 static const WCHAR default_accept_mimeW[] = {
'*',
'/',
'*',0};
349 static const WCHAR *default_accept_mimes[] = {default_accept_mimeW,
NULL};
351 accept_types = default_accept_mimes;
354 accept_types = (
const WCHAR**)accept_mimes;
356 WARN(
"GetBindString BINDSTRING_ACCEPT_MIMES failed: %08x\n",
hres);
357 return INET_E_NO_VALID_MEDIA;
359 accept_mimes[
num] = 0;
367 This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
368 ? wszBindVerb[
This->base.bind_info.dwBindVerb] :
This->base.bind_info.szCustomVerb,
376 if (!
This->base.request) {
378 return INET_E_RESOURCE_NOT_FOUND;
381 hres = IInternetProtocolSink_QueryInterface(
This->base.protocol_sink, &IID_IServiceProvider,
384 WARN(
"IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08x\n",
hres);
389 &IID_IHttpNegotiate, (
void **)&
This->http_negotiate);
391 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate failed: %08x\n",
hres);
406 WARN(
"IHttpNegotiate_BeginningTransaction failed: %08x\n",
hres);
414 if(!
This->full_header) {
425 &IID_IHttpNegotiate2, (
void **)&http_negotiate2);
428 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08x\n",
hres);
432 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &
len, 0);
433 IHttpNegotiate2_Release(http_negotiate2);
435 WARN(
"IHttpNegotiate2_GetRootSecurityId failed: %08x\n",
hres);
440 if(
This->base.bind_info.dwBindVerb == BINDVERB_POST) {
442 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_POST_COOKIE, &post_cookie, 1, &
num);
445 post_cookie,
lstrlenW(post_cookie)))
446 WARN(
"InternetSetOption INTERNET_OPTION_SECONDARY_CACHE_KEY failed: %d\n",
GetLastError());
454 WARN(
"InternetSetOption(INTERNET_OPTION_ERROR_MASK) failed: %u\n",
GetLastError());
459 WARN(
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %u\n",
GetLastError());
478 WARN(
"HttpSendRequest failed: %d\n",
error);
VOID WINAPI CoTaskMemFree(LPVOID ptr)
GLsizei const GLchar ** path
static ULONG send_http_request(HttpProtocol *This)
#define INTERNET_FLAG_SECURE
HRESULT protocol_syncbinding(Protocol *protocol)
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
static const WCHAR default_headersW[]
DWORD WINAPI GetLastError(VOID)
static HINTERNET internet_session
static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
static void * heap_alloc(size_t len)
static IServiceProvider service_provider
GLboolean GLboolean GLboolean b
#define memcpy(s1, s2, n)
#define INTERNET_OPTION_SECONDARY_CACHE_KEY
#define INTERNET_OPTION_ERROR_MASK
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
static HttpProtocol * impl_from_Protocol(Protocol *prot)
static IInternetBindInfo bind_info
#define INTERNET_OPTION_HTTP_DECODING
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
#define INTERNET_SERVICE_HTTP
void user(int argc, const char *argv[])