292{
299 const WCHAR **accept_types;
300 BYTE security_id[512];
305
306 static const WCHAR wszBindVerb[BINDVERB_CUSTOM][5] =
307 {{'G','E','T',0},
308 {'P','O','S','T',0},
309 {'P','U','T',0}};
310
314
318
322
327 }
329 }
333 if(!
This->base.connection) {
335 return INET_E_CANNOT_CONNECT;
336 }
337
339 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_ROOTDOC_URL, &rootdoc_url, 1, &
num);
343 }
344
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};
350
351 accept_types = default_accept_mimes;
354 accept_types = (
const WCHAR**)accept_mimes;
355 }else {
356 WARN(
"GetBindString BINDSTRING_ACCEPT_MIMES failed: %08x\n",
hres);
357 return INET_E_NO_VALID_MEDIA;
358 }
359 accept_mimes[
num] = 0;
360
363
367 This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
368 ? wszBindVerb[
This->base.bind_info.dwBindVerb] :
This->base.bind_info.szCustomVerb,
371 }
376 if (!
This->base.request) {
378 return INET_E_RESOURCE_NOT_FOUND;
379 }
380
381 hres = IInternetProtocolSink_QueryInterface(
This->base.protocol_sink, &IID_IServiceProvider,
384 WARN(
"IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08x\n",
hres);
386 }
387
389 &IID_IHttpNegotiate, (
void **)&
This->http_negotiate);
391 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate failed: %08x\n",
hres);
394 }
395
400 }
401
403 0, &addl_header);
406 WARN(
"IHttpNegotiate_BeginningTransaction failed: %08x\n",
hres);
409 }
410
412
414 if(!
This->full_header) {
417 }
418
423
425 &IID_IHttpNegotiate2, (void **)&http_negotiate2);
428 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08x\n",
hres);
429
430 }else {
432 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &
len, 0);
433 IHttpNegotiate2_Release(http_negotiate2);
435 WARN(
"IHttpNegotiate2_GetRootSecurityId failed: %08x\n",
hres);
436 }
437
438
439
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());
448 }
449 }
450
454 WARN(
"InternetSetOption(INTERNET_OPTION_ERROR_MASK) failed: %u\n",
GetLastError());
455
459 WARN(
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %u\n",
GetLastError());
460
461 do {
463
468
469
470
471
473 default:
475 }
477
478 WARN(
"HttpSendRequest failed: %d\n",
error);
480}
static void * heap_alloc(size_t len)
void user(int argc, const char *argv[])
static const WCHAR default_headersW[]
HRESULT protocol_syncbinding(Protocol *protocol)
static HINTERNET internet_session
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)
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
GLboolean GLboolean GLboolean b
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define memcpy(s1, s2, n)
static IServiceProvider service_provider
static IInternetBindInfo bind_info
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
#define INTERNET_OPTION_SECONDARY_CACHE_KEY
#define INTERNET_FLAG_SECURE
#define INTERNET_OPTION_ERROR_MASK
#define INTERNET_OPTION_HTTP_DECODING
#define INTERNET_SERVICE_HTTP