94 ERR(
"Failed to set security flags: %lx\n",
flags);
154 hres = IInternetProtocolSink_QueryInterface(
This->base.protocol_sink, &IID_IServiceProvider,
157 ERR(
"Failed to get IServiceProvider.\n");
162 hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpSecurity, &IID_IHttpSecurity,
168 TRACE(
"OnSecurityProblem returned %08lx\n",
hres);
174 IServiceProvider_Release(serv_prov);
187 FIXME(
"Don't know how to ignore error %ld\n",
error);
211 hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI, (
void**)&wfb_ui);
213 const IID *iid_reason;
216 iid_reason = &IID_IHttpSecurity;
218 iid_reason = &IID_IAuthenticate;
220 iid_reason = &IID_IWindowForBindingUI;
222 hres = IWindowForBindingUI_GetWindow(wfb_ui, iid_reason, &
hwnd);
223 IWindowForBindingUI_Release(wfb_ui);
229 if(
This->base.bindf & BINDF_NO_UI)
236 IServiceProvider_Release(serv_prov);
248 if(
This->base.bind_info.dwBindVerb != BINDVERB_GET) {
249 switch(
This->base.bind_info.stgmedData.tymed) {
255 case TYMED_ISTREAM: {
259 if(!
This->base.post_stream) {
260 This->base.post_stream =
This->base.bind_info.stgmedData.pstm;
261 IStream_AddRef(
This->base.post_stream);
265 IStream_Seek(
This->base.post_stream,
offset, STREAM_SEEK_SET,
NULL);
269 FIXME(
"Unsupported This->base.bind_info.stgmedData.tymed %ld\n",
This->base.bind_info.stgmedData.tymed);
273 if(
This->base.post_stream)
295 LPOLESTR accept_mimes[257];
296 const WCHAR **accept_types;
297 BYTE security_id[512];
303 static const WCHAR wszBindVerb[BINDVERB_CUSTOM][5] =
330 if(!
This->base.connection) {
336 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_ROOTDOC_URL, &rootdoc_url, 1, &
num);
343 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_ACCEPT_MIMES, accept_mimes,
num, &
num);
344 if(
hres == INET_E_USE_DEFAULT_SETTING) {
345 static const WCHAR *default_accept_mimes[] = {
L"*/*",
NULL};
347 accept_types = default_accept_mimes;
350 accept_types = (
const WCHAR**)accept_mimes;
352 WARN(
"GetBindString BINDSTRING_ACCEPT_MIMES failed: %08lx\n",
hres);
355 accept_mimes[
num] = 0;
363 This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
364 ? wszBindVerb[
This->base.bind_info.dwBindVerb] :
This->base.bind_info.szCustomVerb,
372 if (!
This->base.request) {
377 hres = IInternetProtocolSink_QueryInterface(
This->base.protocol_sink, &IID_IServiceProvider,
380 WARN(
"IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08lx\n",
hres);
385 &IID_IHttpNegotiate, (
void **)&
This->http_negotiate);
387 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate failed: %08lx\n",
hres);
402 WARN(
"IHttpNegotiate_BeginningTransaction failed: %08lx\n",
hres);
410 if(!
This->full_header) {
421 &IID_IHttpNegotiate2, (
void **)&http_negotiate2);
424 WARN(
"IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08lx\n",
hres);
428 hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &
len, 0);
429 IHttpNegotiate2_Release(http_negotiate2);
431 WARN(
"IHttpNegotiate2_GetRootSecurityId failed: %08lx\n",
hres);
436 if(
This->base.bind_info.dwBindVerb == BINDVERB_POST) {
438 hres = IInternetBindInfo_GetBindString(
bind_info, BINDSTRING_POST_COOKIE, &post_cookie, 1, &
num);
441 post_cookie,
lstrlenW(post_cookie)))
442 WARN(
"InternetSetOption INTERNET_OPTION_SECONDARY_CACHE_KEY failed: %ld\n",
GetLastError());
450 WARN(
"InternetSetOption(INTERNET_OPTION_ERROR_MASK) failed: %lu\n",
GetLastError());
455 WARN(
"InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %lu\n",
GetLastError());
474 WARN(
"HttpSendRequest failed: %ld\n",
error);
512 if(!
This->http_negotiate) {
513 WARN(
"Expected IHttpNegotiate pointer to be non-NULL\n");
520 WCHAR *response_headers;
525 TRACE(
"Got redirect with disabled auto redirects\n");
535 if(response_headers) {
538 free(response_headers);
540 WARN(
"IHttpNegotiate_OnResponse failed: %08lx\n",
hres);
550 IInternetProtocolSink_ReportProgress(
This->base.protocol_sink, BINDSTATUS_ACCEPTRANGES,
NULL);
560 IInternetProtocolSink_ReportProgress(
This->base.protocol_sink,
561 (
This->base.bindf & BINDF_FROMURLMON)
562 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
567 IInternetProtocolSink_ReportProgress(
This->base.protocol_sink,
568 (
This->base.bindf & BINDF_FROMURLMON)
569 ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
L"text/html");
585 if(
This->http_negotiate) {
586 IHttpNegotiate_Release(
This->http_negotiate);
634 TRACE(
"(%p)->(IID_IInternetProtocolRoot %p)\n",
This,
ppv);
635 *
ppv = &
This->IInternetProtocolEx_iface;
638 *
ppv = &
This->IInternetProtocolEx_iface;
640 TRACE(
"(%p)->(IID_IInternetProtocolEx %p)\n",
This,
ppv);
641 *
ppv = &
This->IInternetProtocolEx_iface;
644 *
ppv = &
This->IInternetPriority_iface;
647 *
ppv = &
This->IWinInetHttpInfo_iface;
650 *
ppv = &
This->IWinInetHttpInfo_iface;
696 return IUnknown_QueryInterface(
This->outer,
riid,
ppv);
703 return IUnknown_AddRef(
This->outer);
710 return IUnknown_Release(
This->outer);
728 hres = IInternetProtocolEx_StartEx(&
This->IInternetProtocolEx_iface,
uri, pOIProtSink,
739 TRACE(
"(%p)->(%p)\n",
This, pProtocolData);
783 TRACE(
"(%p)->(%p %lu %p)\n",
This, pv,
cb, pcbRead);
792 FIXME(
"(%p)->(%ld %ld %p)\n",
This, dlibMove.
LowPart, dwOrigin, plibNewPosition);
822 TRACE(
"(%p)->(%p %p %p %08lx %p)\n",
This, pUri, pOIProtSink,
832 pOIProtSink, pOIBindInfo);
855 return IInternetProtocolEx_QueryInterface(&
This->IInternetProtocolEx_iface,
riid,
ppv);
861 return IInternetProtocolEx_AddRef(&
This->IInternetProtocolEx_iface);
867 return IInternetProtocolEx_Release(&
This->IInternetProtocolEx_iface);
876 This->base.priority = nPriority;
886 *pnPriority =
This->base.priority;
901 return IInternetProtocolEx_QueryInterface(&
This->IInternetProtocolEx_iface,
riid,
ppv);
907 return IInternetProtocolEx_AddRef(&
This->IInternetProtocolEx_iface);
913 return IInternetProtocolEx_Release(&
This->IInternetProtocolEx_iface);
922 if(!
This->base.request)
934 TRACE(
"(%p)->(%lx %p %p %p %p)\n",
This, dwOption,
pBuffer, pcbBuffer, pdwFlags, pdwReserved);
936 if(!
This->base.request)
971 *ppobj = &
ret->IUnknown_inner;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void user(int argc, const char *argv[])
#define ERROR_INSUFFICIENT_BUFFER
void WINAPI CoTaskMemFree(void *ptr)
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
static ULONG WINAPI HttpProtocol_AddRef(IInternetProtocolEx *iface)
static HRESULT WINAPI HttpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
static HRESULT internet_error_to_hres(DWORD error)
static ULONG send_http_request(HttpProtocol *This)
static HRESULT HttpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags, HINTERNET internet_session, IInternetBindInfo *bind_info)
static HRESULT HttpProtocol_start_downloading(Protocol *prot)
static ULONG WINAPI HttpProtocol_Release(IInternetProtocolEx *iface)
static void HttpProtocol_on_error(Protocol *prot, DWORD error)
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
static HRESULT WINAPI HttpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
static const IUnknownVtbl HttpProtocolUnkVtbl
static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer)
HRESULT HttpProtocol_Construct(IUnknown *outer, void **ppv)
static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
HRESULT HttpSProtocol_Construct(IUnknown *outer, void **ppv)
static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
static HRESULT create_http_protocol(BOOL https, IUnknown *outer, void **ppobj)
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
static HRESULT WINAPI HttpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
static void HttpProtocol_close_connection(Protocol *prot)
static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
static HttpProtocol * impl_from_IUnknown(IUnknown *iface)
static ULONG WINAPI HttpPriority_AddRef(IInternetPriority *iface)
static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
static HRESULT HttpProtocol_end_request(Protocol *protocol)
static BOOL is_redirect_response(DWORD status_code)
static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocolEx *iface)
static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocolEx *iface)
static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
static HRESULT WINAPI HttpProtocolUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
static ULONG WINAPI HttpProtocolUnk_AddRef(IUnknown *iface)
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
static const IInternetPriorityVtbl HttpPriorityVtbl
static ULONG WINAPI HttpProtocolUnk_Release(IUnknown *iface)
static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
static HttpProtocol * impl_from_Protocol(Protocol *prot)
static const ProtocolVtbl AsyncProtocolVtbl
static HRESULT WINAPI HttpProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
static const IInternetProtocolExVtbl HttpProtocolVtbl
static BOOL set_security_flag(HttpProtocol *This, DWORD flags)
static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
static HRESULT WINAPI HttpProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
static HRESULT WINAPI HttpProtocol_Resume(IInternetProtocolEx *iface)
static ULONG WINAPI HttpPriority_Release(IInternetPriority *iface)
static const WCHAR default_headersW[]
static HRESULT WINAPI HttpProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
HRESULT protocol_syncbinding(Protocol *protocol)
HRESULT protocol_lock_request(Protocol *protocol)
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
void protocol_close_connection(Protocol *protocol)
HRESULT protocol_unlock_request(Protocol *protocol)
static HINTERNET internet_session
HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, DWORD dwError, DWORD dwFlags, LPVOID *lppvData)
BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersIn, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
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
#define location(file, line)
#define memcpy(s1, s2, n)
static IServiceProvider service_provider
static IInternetBindInfo bind_info
#define protocol_start(p, u, e)
static IHttpSecurity http_security
static BOOL security_problem
static const char * send_buffer
static DWORD64 content_length
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define IsEqualGUID(rguid1, rguid2)
IHttpNegotiate * http_negotiate
IInternetProtocolEx IInternetProtocolEx_iface
IWinInetHttpInfo IWinInetHttpInfo_iface
IInternetPriority IInternetPriority_iface
#define CONTAINING_RECORD(address, type, field)
static void URLMON_LockModule(void)
static void URLMON_UnlockModule(void)
#define FLAG_LAST_DATA_REPORTED
#define FLAG_FIRST_CONTINUE_COMPLETE
#define FLAG_RESULT_REPORTED
DWORD WINAPI GetLastError(void)
#define INET_E_NO_VALID_MEDIA
#define INET_E_INVALID_CERTIFICATE
#define INET_E_RESOURCE_NOT_FOUND
#define INET_E_REDIRECT_FAILED
#define INET_E_DOWNLOAD_FAILURE
#define INET_E_CANNOT_CONNECT
#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID
#define HTTP_STATUS_REDIRECT_KEEP_VERB
#define HTTP_STATUS_REDIRECT
#define HTTP_STATUS_MOVED
#define SECURITY_FLAG_IGNORE_UNKNOWN_CA
#define HTTP_STATUS_REDIRECT_METHOD
#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID
struct _INTERNET_BUFFERSW INTERNET_BUFFERSW
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
#define INTERNET_OPTION_SECURITY_FLAGS
#define ERROR_INTERNET_SEC_CERT_CN_INVALID
#define INTERNET_OPTION_SECONDARY_CACHE_KEY
#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR
#define HTTP_QUERY_RAW_HEADERS_CRLF
#define HTTP_QUERY_FLAG_NUMBER
#define ERROR_INTERNET_INVALID_CA
#define ERROR_INTERNET_INCORRECT_PASSWORD
#define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA
#define ERROR_INTERNET_SEC_CERT_DATE_INVALID
#define INTERNET_FLAG_SECURE
#define HTTP_QUERY_ACCEPT_RANGES
#define HTTP_QUERY_CONTENT_TYPE
#define ERROR_INTERNET_FORCE_RETRY
#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED
#define FLAGS_ERROR_UI_FLAGS_NO_UI
#define HTTP_QUERY_LOCATION
#define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION
#define HTTP_QUERY_STATUS_CODE
#define SECURITY_FLAG_IGNORE_REVOCATION
#define INTERNET_OPTION_ERROR_MASK
#define ERROR_INTERNET_SEC_CERT_REV_FAILED
#define ERROR_INTERNET_SEC_CERT_REVOKED
#define ERROR_INTERNET_SEC_CERT_NO_REV
#define ERROR_INTERNET_SEC_CERT_ERRORS
#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR
#define INTERNET_OPTION_HTTP_DECODING
#define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS
#define ERROR_INTERNET_SEC_INVALID_CERT
#define HTTP_QUERY_CONTENT_LENGTH
#define INTERNET_SERVICE_HTTP