ReactOS  0.4.14-dev-614-gbfd8a84
http.c File Reference
#include "urlmon_main.h"
#include "wininet.h"
#include "shlwapi.h"
#include "wine/debug.h"
Include dependency graph for http.c:

Go to the source code of this file.

Classes

struct  HttpProtocol
 

Macros

#define NONAMELESSUNION
 
#define NO_SHLWAPI_REG
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (urlmon)
 
static HttpProtocolimpl_from_IUnknown (IUnknown *iface)
 
static HttpProtocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static HttpProtocolimpl_from_IInternetPriority (IInternetPriority *iface)
 
static HttpProtocolimpl_from_IWinInetHttpInfo (IWinInetHttpInfo *iface)
 
static LPWSTR query_http_info (HttpProtocol *This, DWORD option)
 
static BOOL set_security_flag (HttpProtocol *This, DWORD flags)
 
static HRESULT internet_error_to_hres (DWORD error)
 
static HRESULT handle_http_error (HttpProtocol *This, DWORD error)
 
static ULONG send_http_request (HttpProtocol *This)
 
static HttpProtocolimpl_from_Protocol (Protocol *prot)
 
static HRESULT HttpProtocol_open_request (Protocol *prot, IUri *uri, DWORD request_flags, HINTERNET internet_session, IInternetBindInfo *bind_info)
 
static HRESULT HttpProtocol_end_request (Protocol *protocol)
 
static BOOL is_redirect_response (DWORD status_code)
 
static HRESULT HttpProtocol_start_downloading (Protocol *prot)
 
static void HttpProtocol_close_connection (Protocol *prot)
 
static void HttpProtocol_on_error (Protocol *prot, DWORD error)
 
static HRESULT WINAPI HttpProtocolUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpProtocolUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI HttpProtocolUnk_Release (IUnknown *iface)
 
static HRESULT WINAPI HttpProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpProtocol_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI HttpProtocol_Release (IInternetProtocolEx *iface)
 
static HRESULT WINAPI HttpProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI HttpProtocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI HttpProtocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI HttpProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI HttpProtocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI HttpProtocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI HttpProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI HttpProtocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI HttpProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI HttpProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI HttpProtocol_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
static HRESULT WINAPI HttpPriority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpPriority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI HttpPriority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI HttpPriority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI HttpPriority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
static HRESULT WINAPI HttpInfo_QueryInterface (IWinInetHttpInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpInfo_AddRef (IWinInetHttpInfo *iface)
 
static ULONG WINAPI HttpInfo_Release (IWinInetHttpInfo *iface)
 
static HRESULT WINAPI HttpInfo_QueryOption (IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer)
 
static HRESULT WINAPI HttpInfo_QueryInfo (IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
 
static HRESULT create_http_protocol (BOOL https, IUnknown *outer, void **ppobj)
 
HRESULT HttpProtocol_Construct (IUnknown *outer, void **ppv)
 
HRESULT HttpSProtocol_Construct (IUnknown *outer, void **ppv)
 

Variables

static const WCHAR default_headersW []
 
static const ProtocolVtbl AsyncProtocolVtbl
 
static const IUnknownVtbl HttpProtocolUnkVtbl
 
static const IInternetProtocolExVtbl HttpProtocolVtbl
 
static const IInternetPriorityVtbl HttpPriorityVtbl
 
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
 

Macro Definition Documentation

◆ NO_SHLWAPI_REG

#define NO_SHLWAPI_REG

Definition at line 25 of file http.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 20 of file http.c.

Function Documentation

◆ create_http_protocol()

static HRESULT create_http_protocol ( BOOL  https,
IUnknown outer,
void **  ppobj 
)
static

Definition at line 961 of file http.c.

962 {
963  HttpProtocol *ret;
964 
965  ret = heap_alloc_zero(sizeof(HttpProtocol));
966  if(!ret)
967  return E_OUTOFMEMORY;
968 
969  ret->base.vtbl = &AsyncProtocolVtbl;
970  ret->IUnknown_inner.lpVtbl = &HttpProtocolUnkVtbl;
971  ret->IInternetProtocolEx_iface.lpVtbl = &HttpProtocolVtbl;
972  ret->IInternetPriority_iface.lpVtbl = &HttpPriorityVtbl;
973  ret->IWinInetHttpInfo_iface.lpVtbl = &WinInetHttpInfoVtbl;
974 
975  ret->https = https;
976  ret->ref = 1;
977  ret->outer = outer ? outer : &ret->IUnknown_inner;
978 
979  *ppobj = &ret->IUnknown_inner;
980 
982  return S_OK;
983 }
static const IInternetPriorityVtbl HttpPriorityVtbl
Definition: http.c:898
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
Definition: http.c:953
static const ProtocolVtbl AsyncProtocolVtbl
Definition: http.c:626
int ret
#define S_OK
Definition: intsafe.h:59
static const IInternetProtocolExVtbl HttpProtocolVtbl
Definition: http.c:843
static const IUnknownVtbl HttpProtocolUnkVtbl
Definition: http.c:694
static void URLMON_LockModule(void)
Definition: urlmon_main.h:68

Referenced by HttpProtocol_Construct(), and HttpSProtocol_Construct().

◆ handle_http_error()

static HRESULT handle_http_error ( HttpProtocol This,
DWORD  error 
)
static

Definition at line 125 of file http.c.

126 {
127  IServiceProvider *serv_prov;
128  IWindowForBindingUI *wfb_ui;
131  DWORD dlg_flags;
132  HWND hwnd;
133  DWORD res;
134  HRESULT hres;
135 
136  TRACE("(%p %u)\n", This, error);
137 
138  switch(error) {
152  break;
153  default:
155  }
156 
157  hres = IInternetProtocolSink_QueryInterface(This->base.protocol_sink, &IID_IServiceProvider,
158  (void**)&serv_prov);
159  if(FAILED(hres)) {
160  ERR("Failed to get IServiceProvider.\n");
161  return E_ABORT;
162  }
163 
164  if(security_problem) {
165  hres = IServiceProvider_QueryService(serv_prov, &IID_IHttpSecurity, &IID_IHttpSecurity,
166  (void**)&http_security);
167  if(SUCCEEDED(hres)) {
168  hres = IHttpSecurity_OnSecurityProblem(http_security, error);
169  IHttpSecurity_Release(http_security);
170 
171  TRACE("OnSecurityProblem returned %08x\n", hres);
172 
173  if(hres != S_FALSE)
174  {
175  BOOL res = FALSE;
176 
177  IServiceProvider_Release(serv_prov);
178 
179  if(hres == S_OK) {
184  else if(error == ERROR_INTERNET_INVALID_CA)
186 
187  if(res)
188  return RPC_E_RETRY;
189 
190  FIXME("Don't know how to ignore error %d\n", error);
191  return E_ABORT;
192  }
193 
194  if(hres == E_ABORT)
195  return E_ABORT;
196  if(hres == RPC_E_RETRY)
197  return RPC_E_RETRY;
198 
200  }
201  }
202  }
203 
204  switch(error) {
206  if(hres != S_FALSE) {
207  /* Silently ignore the error. We will get more detailed error from wininet anyway. */
209  hres = RPC_E_RETRY;
210  break;
211  }
212  /* fallthrough */
213  default:
214  hres = IServiceProvider_QueryService(serv_prov, &IID_IWindowForBindingUI, &IID_IWindowForBindingUI, (void**)&wfb_ui);
215  if(SUCCEEDED(hres)) {
216  const IID *iid_reason;
217 
218  if(security_problem)
219  iid_reason = &IID_IHttpSecurity;
221  iid_reason = &IID_IAuthenticate;
222  else
223  iid_reason = &IID_IWindowForBindingUI;
224 
225  hres = IWindowForBindingUI_GetWindow(wfb_ui, iid_reason, &hwnd);
226  IWindowForBindingUI_Release(wfb_ui);
227  }
228 
229  if(FAILED(hres)) hwnd = NULL;
230 
232  if(This->base.bindf & BINDF_NO_UI)
233  dlg_flags |= FLAGS_ERROR_UI_FLAGS_NO_UI;
234 
235  res = InternetErrorDlg(hwnd, This->base.request, error, dlg_flags, NULL);
237  }
238 
239  IServiceProvider_Release(serv_prov);
240  return hres;
241 }
#define ERROR_INTERNET_SEC_CERT_CN_INVALID
Definition: wininet.h:2026
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ERROR_INTERNET_SEC_CERT_NO_REV
Definition: wininet.h:2043
#define TRUE
Definition: types.h:120
#define SECURITY_FLAG_IGNORE_UNKNOWN_CA
Definition: winhttp.h:281
#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR
Definition: wininet.h:2028
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
static BOOL set_security_flag(HttpProtocol *This, DWORD flags)
Definition: http.c:91
#define ERROR_INTERNET_SEC_CERT_REV_FAILED
Definition: wininet.h:2044
#define ERROR_INTERNET_SEC_CERT_REVOKED
Definition: wininet.h:2078
#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID
Definition: winhttp.h:283
#define SECURITY_FLAG_IGNORE_REVOCATION
Definition: wininet.h:829
#define FLAGS_ERROR_UI_FLAGS_NO_UI
Definition: wininet.h:1909
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED
Definition: wininet.h:2032
#define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS
Definition: wininet.h:1907
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_INTERNET_SEC_CERT_ERRORS
Definition: wininet.h:2042
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA
Definition: wininet.h:1908
#define E_ABORT
Definition: winerror.h:2366
#define ERROR_INTERNET_FORCE_RETRY
Definition: wininet.h:2021
static HRESULT internet_error_to_hres(DWORD error)
Definition: http.c:102
#define ERR(fmt,...)
Definition: debug.h:109
#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID
Definition: winhttp.h:282
#define ERROR_INTERNET_SEC_CERT_DATE_INVALID
Definition: wininet.h:2025
#define ERROR_INTERNET_INVALID_CA
Definition: wininet.h:2033
#define S_OK
Definition: intsafe.h:59
#define ERROR_INTERNET_SEC_INVALID_CERT
Definition: wininet.h:2077
#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR
Definition: wininet.h:2027
static IHttpSecurity http_security
Definition: protocol.c:294
#define ERROR_INTERNET_INCORRECT_PASSWORD
Definition: wininet.h:2003
#define RPC_E_RETRY
Definition: winerror.h:2485
GLuint res
Definition: glext.h:9613
#define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION
Definition: wininet.h:2068
DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, DWORD dwError, DWORD dwFlags, LPVOID *lppvData)
Definition: dialogs.c:474
static BOOL security_problem
Definition: protocol.c:160
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by HttpProtocol_on_error(), and HttpProtocol_open_request().

◆ HttpInfo_AddRef()

static ULONG WINAPI HttpInfo_AddRef ( IWinInetHttpInfo iface)
static

Definition at line 912 of file http.c.

913 {
915  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
916 }
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: http.c:63

◆ HttpInfo_QueryInfo()

static HRESULT WINAPI HttpInfo_QueryInfo ( IWinInetHttpInfo iface,
DWORD  dwOption,
void pBuffer,
DWORD pcbBuffer,
DWORD pdwFlags,
DWORD pdwReserved 
)
static

Definition at line 938 of file http.c.

940 {
942  TRACE("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
943 
944  if(!This->base.request)
945  return E_FAIL;
946 
947  if(!HttpQueryInfoA(This->base.request, dwOption, pBuffer, pcbBuffer, pdwFlags))
948  return S_FALSE;
949 
950  return S_OK;
951 }
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: http.c:63
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:4031

◆ HttpInfo_QueryInterface()

static HRESULT WINAPI HttpInfo_QueryInterface ( IWinInetHttpInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 906 of file http.c.

907 {
909  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
910 }
REFIID riid
Definition: precomp.h:44
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: http.c:63
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ HttpInfo_QueryOption()

static HRESULT WINAPI HttpInfo_QueryOption ( IWinInetHttpInfo iface,
DWORD  dwOption,
void pBuffer,
DWORD pcbBuffer 
)
static

Definition at line 924 of file http.c.

926 {
928  TRACE("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer);
929 
930  if(!This->base.request)
931  return E_FAIL;
932 
933  if(!InternetQueryOptionW(This->base.request, dwOption, pBuffer, pcbBuffer))
934  return S_FALSE;
935  return S_OK;
936 }
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: http.c:63
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:2574

◆ HttpInfo_Release()

static ULONG WINAPI HttpInfo_Release ( IWinInetHttpInfo iface)
static

Definition at line 918 of file http.c.

919 {
921  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
922 }
static HttpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: http.c:63

◆ HttpPriority_AddRef()

static ULONG WINAPI HttpPriority_AddRef ( IInternetPriority iface)
static

Definition at line 866 of file http.c.

867 {
869  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
870 }
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: http.c:58

◆ HttpPriority_GetPriority()

static HRESULT WINAPI HttpPriority_GetPriority ( IInternetPriority iface,
LONG pnPriority 
)
static

Definition at line 888 of file http.c.

889 {
891 
892  TRACE("(%p)->(%p)\n", This, pnPriority);
893 
894  *pnPriority = This->base.priority;
895  return S_OK;
896 }
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: http.c:58
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ HttpPriority_QueryInterface()

static HRESULT WINAPI HttpPriority_QueryInterface ( IInternetPriority iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 860 of file http.c.

861 {
863  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
864 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: http.c:58

◆ HttpPriority_Release()

static ULONG WINAPI HttpPriority_Release ( IInternetPriority iface)
static

Definition at line 872 of file http.c.

873 {
875  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
876 }
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: http.c:58

◆ HttpPriority_SetPriority()

static HRESULT WINAPI HttpPriority_SetPriority ( IInternetPriority iface,
LONG  nPriority 
)
static

Definition at line 878 of file http.c.

879 {
881 
882  TRACE("(%p)->(%d)\n", This, nPriority);
883 
884  This->base.priority = nPriority;
885  return S_OK;
886 }
static HttpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: http.c:58
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ HttpProtocol_Abort()

static HRESULT WINAPI HttpProtocol_Abort ( IInternetProtocolEx iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 752 of file http.c.

754 {
756 
757  TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
758 
759  return protocol_abort(&This->base, hrReason);
760 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
DWORD dwOptions
Definition: solitaire.cpp:23
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
Definition: protocol.c:518
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocol_AddRef()

static ULONG WINAPI HttpProtocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 707 of file http.c.

708 {
710  TRACE("(%p)\n", This);
711  return IUnknown_AddRef(This->outer);
712 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocol_close_connection()

static void HttpProtocol_close_connection ( Protocol prot)
static

Definition at line 589 of file http.c.

590 {
592 
593  if(This->http_negotiate) {
594  IHttpNegotiate_Release(This->http_negotiate);
595  This->http_negotiate = NULL;
596  }
597 
598  heap_free(This->full_header);
599  This->full_header = NULL;
600 }
smooth NULL
Definition: ftsmooth.c:416
static HttpProtocol * impl_from_Protocol(Protocol *prot)
Definition: http.c:285
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HttpProtocol_Construct()

HRESULT HttpProtocol_Construct ( IUnknown outer,
void **  ppv 
)

Definition at line 985 of file http.c.

986 {
987  TRACE("(%p %p)\n", outer, ppv);
988 
989  return create_http_protocol(FALSE, outer, ppv);
990 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT create_http_protocol(BOOL https, IUnknown *outer, void **ppobj)
Definition: http.c:961
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocol_Continue()

static HRESULT WINAPI HttpProtocol_Continue ( IInternetProtocolEx iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 743 of file http.c.

744 {
746 
747  TRACE("(%p)->(%p)\n", This, pProtocolData);
748 
749  return protocol_continue(&This->base, pProtocolData);
750 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
Definition: protocol.c:355

◆ HttpProtocol_end_request()

static HRESULT HttpProtocol_end_request ( Protocol protocol)
static

Definition at line 482 of file http.c.

483 {
484  BOOL res;
485 
486  res = HttpEndRequestW(protocol->request, NULL, 0, 0);
487  if(!res && GetLastError() != ERROR_IO_PENDING) {
488  FIXME("HttpEndRequest failed: %u\n", GetLastError());
489  return E_FAIL;
490  }
491 
492  return S_OK;
493 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ERROR_IO_PENDING
Definition: dderror.h:15
#define E_FAIL
Definition: ddrawi.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI HttpEndRequestW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:5425
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613

◆ HttpProtocol_LockRequest()

static HRESULT WINAPI HttpProtocol_LockRequest ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 804 of file http.c.

805 {
807 
808  TRACE("(%p)->(%08x)\n", This, dwOptions);
809 
810  return protocol_lock_request(&This->base);
811 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT protocol_lock_request(Protocol *protocol)
Definition: protocol.c:498

◆ HttpProtocol_on_error()

static void HttpProtocol_on_error ( Protocol prot,
DWORD  error 
)
static

Definition at line 602 of file http.c.

603 {
605  HRESULT hres;
606 
607  TRACE("(%p) %d\n", prot, error);
608 
609  if(prot->flags & FLAG_FIRST_CONTINUE_COMPLETE) {
610  FIXME("Not handling error %d\n", error);
611  return;
612  }
613 
614  while((hres = handle_http_error(This, error)) == RPC_E_RETRY) {
616 
618  return;
619  }
620 
621  protocol_abort(prot, hres);
623  return;
624 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
static ULONG send_http_request(HttpProtocol *This)
Definition: http.c:243
#define ERROR_IO_PENDING
Definition: dderror.h:15
static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
Definition: http.c:125
void protocol_close_connection(Protocol *protocol)
Definition: protocol.c:531
DWORD flags
Definition: urlmon_main.h:108
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
Definition: protocol.c:518
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define FLAG_FIRST_CONTINUE_COMPLETE
Definition: urlmon_main.h:153
static HttpProtocol * impl_from_Protocol(Protocol *prot)
Definition: http.c:285
#define RPC_E_RETRY
Definition: winerror.h:2485

◆ HttpProtocol_open_request()

static HRESULT HttpProtocol_open_request ( Protocol prot,
IUri uri,
DWORD  request_flags,
HINTERNET  internet_session,
IInternetBindInfo bind_info 
)
static

Definition at line 290 of file http.c.

292 {
294  WCHAR *addl_header = NULL, *post_cookie = NULL, *rootdoc_url = NULL;
296  IHttpNegotiate2 *http_negotiate2 = NULL;
297  BSTR url, host, user, pass, path;
298  LPOLESTR accept_mimes[257];
299  const WCHAR **accept_types;
300  BYTE security_id[512];
301  DWORD len, port, flags;
302  ULONG num, error;
303  BOOL res, b;
304  HRESULT hres;
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 
311  hres = IUri_GetPort(uri, &port);
312  if(FAILED(hres))
313  return hres;
314 
315  hres = IUri_GetHost(uri, &host);
316  if(FAILED(hres))
317  return hres;
318 
319  hres = IUri_GetUserName(uri, &user);
320  if(SUCCEEDED(hres)) {
321  hres = IUri_GetPassword(uri, &pass);
322 
323  if(SUCCEEDED(hres)) {
324  This->base.connection = InternetConnectW(internet_session, host, port, user, pass,
327  }
329  }
331  if(FAILED(hres))
332  return hres;
333  if(!This->base.connection) {
334  WARN("InternetConnect failed: %d\n", GetLastError());
335  return INET_E_CANNOT_CONNECT;
336  }
337 
338  num = 0;
339  hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_ROOTDOC_URL, &rootdoc_url, 1, &num);
340  if(hres == S_OK && num) {
341  FIXME("Use root doc URL %s\n", debugstr_w(rootdoc_url));
342  CoTaskMemFree(rootdoc_url);
343  }
344 
345  num = ARRAY_SIZE(accept_mimes) - 1;
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;
352  num = 0;
353  }else if(hres == S_OK) {
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 
361  if(This->https)
362  request_flags |= INTERNET_FLAG_SECURE;
363 
364  hres = IUri_GetPathAndQuery(uri, &path);
365  if(SUCCEEDED(hres)) {
366  This->base.request = HttpOpenRequestW(This->base.connection,
367  This->base.bind_info.dwBindVerb < BINDVERB_CUSTOM
368  ? wszBindVerb[This->base.bind_info.dwBindVerb] : This->base.bind_info.szCustomVerb,
369  path, NULL, NULL, accept_types, request_flags, (DWORD_PTR)&This->base);
371  }
372  while(num--)
373  CoTaskMemFree(accept_mimes[num]);
374  if(FAILED(hres))
375  return hres;
376  if (!This->base.request) {
377  WARN("HttpOpenRequest failed: %d\n", GetLastError());
378  return INET_E_RESOURCE_NOT_FOUND;
379  }
380 
381  hres = IInternetProtocolSink_QueryInterface(This->base.protocol_sink, &IID_IServiceProvider,
382  (void **)&service_provider);
383  if (hres != S_OK) {
384  WARN("IInternetProtocolSink_QueryInterface IID_IServiceProvider failed: %08x\n", hres);
385  return hres;
386  }
387 
388  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate,
389  &IID_IHttpNegotiate, (void **)&This->http_negotiate);
390  if (hres != S_OK) {
391  WARN("IServiceProvider_QueryService IID_IHttpNegotiate failed: %08x\n", hres);
392  IServiceProvider_Release(service_provider);
393  return hres;
394  }
395 
396  hres = IUri_GetAbsoluteUri(uri, &url);
397  if(FAILED(hres)) {
398  IServiceProvider_Release(service_provider);
399  return hres;
400  }
401 
402  hres = IHttpNegotiate_BeginningTransaction(This->http_negotiate, url, default_headersW,
403  0, &addl_header);
405  if(hres != S_OK) {
406  WARN("IHttpNegotiate_BeginningTransaction failed: %08x\n", hres);
407  IServiceProvider_Release(service_provider);
408  return hres;
409  }
410 
411  len = addl_header ? lstrlenW(addl_header) : 0;
412 
413  This->full_header = heap_alloc(len*sizeof(WCHAR)+sizeof(default_headersW));
414  if(!This->full_header) {
415  IServiceProvider_Release(service_provider);
416  return E_OUTOFMEMORY;
417  }
418 
419  if(len)
420  memcpy(This->full_header, addl_header, len*sizeof(WCHAR));
421  CoTaskMemFree(addl_header);
422  memcpy(This->full_header+len, default_headersW, sizeof(default_headersW));
423 
424  hres = IServiceProvider_QueryService(service_provider, &IID_IHttpNegotiate2,
425  &IID_IHttpNegotiate2, (void **)&http_negotiate2);
426  IServiceProvider_Release(service_provider);
427  if(hres != S_OK) {
428  WARN("IServiceProvider_QueryService IID_IHttpNegotiate2 failed: %08x\n", hres);
429  /* No goto done as per native */
430  }else {
431  len = ARRAY_SIZE(security_id);
432  hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, security_id, &len, 0);
433  IHttpNegotiate2_Release(http_negotiate2);
434  if (hres != S_OK)
435  WARN("IHttpNegotiate2_GetRootSecurityId failed: %08x\n", hres);
436  }
437 
438  /* FIXME: Handle security_id. Native calls undocumented function IsHostInProxyBypassList. */
439 
440  if(This->base.bind_info.dwBindVerb == BINDVERB_POST) {
441  num = 0;
442  hres = IInternetBindInfo_GetBindString(bind_info, BINDSTRING_POST_COOKIE, &post_cookie, 1, &num);
443  if(hres == S_OK && num) {
445  post_cookie, lstrlenW(post_cookie)))
446  WARN("InternetSetOption INTERNET_OPTION_SECONDARY_CACHE_KEY failed: %d\n", GetLastError());
447  CoTaskMemFree(post_cookie);
448  }
449  }
450 
452  res = InternetSetOptionW(This->base.request, INTERNET_OPTION_ERROR_MASK, &flags, sizeof(flags));
453  if(!res)
454  WARN("InternetSetOption(INTERNET_OPTION_ERROR_MASK) failed: %u\n", GetLastError());
455 
456  b = TRUE;
457  res = InternetSetOptionW(This->base.request, INTERNET_OPTION_HTTP_DECODING, &b, sizeof(b));
458  if(!res)
459  WARN("InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %u\n", GetLastError());
460 
461  do {
463 
464  switch(error) {
465  case ERROR_IO_PENDING:
466  return S_OK;
467  case ERROR_SUCCESS:
468  /*
469  * If sending response ended synchronously, it means that we have the whole data
470  * available locally (most likely in cache).
471  */
472  return protocol_syncbinding(&This->base);
473  default:
475  }
476  } while(hres == RPC_E_RETRY);
477 
478  WARN("HttpSendRequest failed: %d\n", error);
479  return hres;
480 }
#define TRUE
Definition: types.h:120
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
GLsizei const GLchar ** path
Definition: glext.h:7234
const char * uri
Definition: sec_mgr.c:1594
static ULONG send_http_request(HttpProtocol *This)
Definition: http.c:243
#define WARN(fmt,...)
Definition: debug.h:111
#define INTERNET_FLAG_SECURE
Definition: wininet.h:71
char * host
Definition: whois.c:55
HRESULT protocol_syncbinding(Protocol *protocol)
Definition: protocol.c:101
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:2714
static const WCHAR default_headersW[]
Definition: http.c:68
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static HINTERNET internet_session
Definition: protocol.c:288
OLECHAR * BSTR
Definition: compat.h:1942
static LPOLESTR
Definition: stg_prop.c:27
#define ERROR_IO_PENDING
Definition: dderror.h:15
static HRESULT handle_http_error(HttpProtocol *This, DWORD error)
Definition: http.c:125
#define lstrlenW
Definition: compat.h:415
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
pass
Definition: typegen.h:24
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
static IServiceProvider service_provider
Definition: mimeole.c:1313
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
GLbitfield flags
Definition: glext.h:7161
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define INTERNET_OPTION_SECONDARY_CACHE_KEY
Definition: wininet.h:747
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define INTERNET_OPTION_ERROR_MASK
Definition: wininet.h:755
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static HttpProtocol * impl_from_Protocol(Protocol *prot)
Definition: http.c:285
#define RPC_E_RETRY
Definition: winerror.h:2485
static IInternetBindInfo bind_info
Definition: mimeole.c:1273
#define INTERNET_OPTION_HTTP_DECODING
Definition: wininet.h:758
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:3481
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:1280
USHORT port
Definition: uri.c:228
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
Definition: wininet.h:125
#define INTERNET_SERVICE_HTTP
Definition: wininet.h:562
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ HttpProtocol_QueryInterface()

static HRESULT WINAPI HttpProtocol_QueryInterface ( IInternetProtocolEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 700 of file http.c.

701 {
703  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
704  return IUnknown_QueryInterface(This->outer, riid, ppv);
705 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocol_Read()

static HRESULT WINAPI HttpProtocol_Read ( IInternetProtocolEx iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 786 of file http.c.

788 {
790 
791  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
792 
793  return protocol_read(&This->base, pv, cb, pcbRead);
794 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define TRACE(s)
Definition: solgame.cpp:4
static int protocol_read
Definition: htmldoc.c:205
static void WINAPI cb(HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID info, DWORD size)
Definition: http.c:7104

◆ HttpProtocol_Release()

static ULONG WINAPI HttpProtocol_Release ( IInternetProtocolEx iface)
static

Definition at line 714 of file http.c.

715 {
717  TRACE("(%p)\n", This);
718  return IUnknown_Release(This->outer);
719 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocol_Resume()

static HRESULT WINAPI HttpProtocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 779 of file http.c.

780 {
782  FIXME("(%p)\n", This);
783  return E_NOTIMPL;
784 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HttpProtocol_Seek()

static HRESULT WINAPI HttpProtocol_Seek ( IInternetProtocolEx iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 796 of file http.c.

798 {
800  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
801  return E_NOTIMPL;
802 }
struct _LARGE_INTEGER::@2220 u
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HttpProtocol_Start()

static HRESULT WINAPI HttpProtocol_Start ( IInternetProtocolEx iface,
LPCWSTR  szUrl,
IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  grfPI,
HANDLE_PTR  dwReserved 
)
static

Definition at line 721 of file http.c.

724 {
726  IUri *uri;
727  HRESULT hres;
728 
729  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
730  pOIBindInfo, grfPI, dwReserved);
731 
732  hres = CreateUri(szUrl, 0, 0, &uri);
733  if(FAILED(hres))
734  return hres;
735 
736  hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
737  pOIBindInfo, grfPI, (HANDLE*)dwReserved);
738 
739  IUri_Release(uri);
740  return hres;
741 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
const char * uri
Definition: sec_mgr.c:1594
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5700

◆ HttpProtocol_start_downloading()

static HRESULT HttpProtocol_start_downloading ( Protocol prot)
static

Definition at line 507 of file http.c.

508 {
511  DWORD len = sizeof(DWORD);
513  BOOL res;
514  HRESULT hres;
515 
516  static const WCHAR wszDefaultContentType[] =
517  {'t','e','x','t','/','h','t','m','l',0};
518 
519  if(!This->http_negotiate) {
520  WARN("Expected IHttpNegotiate pointer to be non-NULL\n");
521  return S_OK;
522  }
523 
525  &status_code, &len, NULL);
526  if(res) {
527  WCHAR *response_headers;
528 
529  if((This->base.bind_info.dwOptions & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS) && is_redirect_response(status_code)) {
530  WCHAR *location;
531 
532  TRACE("Got redirect with disabled auto redirects\n");
533 
536  IInternetProtocolSink_ReportResult(This->base.protocol_sink, INET_E_REDIRECT_FAILED, 0, location);
538  return INET_E_REDIRECT_FAILED;
539  }
540 
541  response_headers = query_http_info(This, HTTP_QUERY_RAW_HEADERS_CRLF);
542  if(response_headers) {
543  hres = IHttpNegotiate_OnResponse(This->http_negotiate, status_code, response_headers,
544  NULL, NULL);
545  heap_free(response_headers);
546  if (hres != S_OK) {
547  WARN("IHttpNegotiate_OnResponse failed: %08x\n", hres);
548  return S_OK;
549  }
550  }
551  }else {
552  WARN("HttpQueryInfo failed: %d\n", GetLastError());
553  }
554 
556  if(ranges) {
557  IInternetProtocolSink_ReportProgress(This->base.protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL);
558  heap_free(ranges);
559  }
560 
562  if(content_type) {
563  /* remove the charset, if present */
564  LPWSTR p = wcschr(content_type, ';');
565  if (p) *p = '\0';
566 
567  IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
568  (This->base.bindf & BINDF_FROMURLMON)
569  ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
570  content_type);
572  }else {
573  WARN("HttpQueryInfo failed: %d\n", GetLastError());
574  IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
575  (This->base.bindf & BINDF_FROMURLMON)
576  ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
577  wszDefaultContentType);
578  }
579 
581  if(content_length) {
582  This->base.content_length = wcstol(content_length, NULL, 10);
584  }
585 
586  return S_OK;
587 }
#define HTTP_QUERY_CONTENT_LENGTH
Definition: wininet.h:1528
#define HTTP_QUERY_CONTENT_TYPE
Definition: wininet.h:1524
#define HTTP_QUERY_RAW_HEADERS_CRLF
Definition: wininet.h:1545
static BOOL is_redirect_response(DWORD status_code)
Definition: http.c:495
static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
Definition: http.c:71
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define DWORD
Definition: nt_native.h:44
struct status_code status_code
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3883
#define FLAG_RESULT_REPORTED
Definition: urlmon_main.h:157
GLenum GLsizei len
Definition: glext.h:6722
static BSTR content_type
#define HTTP_QUERY_STATUS_CODE
Definition: wininet.h:1542
#define location(file, line)
Definition: kmtest.h:18
#define S_OK
Definition: intsafe.h:59
static HttpProtocol * impl_from_Protocol(Protocol *prot)
Definition: http.c:285
#define HTTP_QUERY_FLAG_NUMBER
Definition: wininet.h:1606
static DWORD64 content_length
Definition: http.c:2071
GLuint res
Definition: glext.h:9613
#define FLAG_LAST_DATA_REPORTED
Definition: urlmon_main.h:156
#define HTTP_QUERY_ACCEPT_RANGES
Definition: wininet.h:1565
#define HTTP_QUERY_LOCATION
Definition: wininet.h:1556
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HttpProtocol_StartEx()

static HRESULT WINAPI HttpProtocol_StartEx ( IInternetProtocolEx iface,
IUri pUri,
IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  grfPI,
HANDLE dwReserved 
)
static

Definition at line 822 of file http.c.

825 {
827  DWORD scheme = 0;
828  HRESULT hres;
829 
830  TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
831  pOIBindInfo, grfPI, dwReserved);
832 
833  hres = IUri_GetScheme(pUri, &scheme);
834  if(FAILED(hres))
835  return hres;
836  if(scheme != (This->https ? URL_SCHEME_HTTPS : URL_SCHEME_HTTP))
837  return MK_E_SYNTAX;
838 
839  return protocol_start(&This->base, (IInternetProtocol*)&This->IInternetProtocolEx_iface, pUri,
840  pOIProtSink, pOIBindInfo);
841 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
DWORD scheme
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define protocol_start(p, u, e)
Definition: protocol.c:303
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MK_E_SYNTAX
Definition: winerror.h:2785

◆ HttpProtocol_Suspend()

static HRESULT WINAPI HttpProtocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 772 of file http.c.

773 {
775  FIXME("(%p)\n", This);
776  return E_NOTIMPL;
777 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HttpProtocol_Terminate()

static HRESULT WINAPI HttpProtocol_Terminate ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 762 of file http.c.

763 {
765 
766  TRACE("(%p)->(%08x)\n", This, dwOptions);
767 
769  return S_OK;
770 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
DWORD dwOptions
Definition: solitaire.cpp:23
void protocol_close_connection(Protocol *protocol)
Definition: protocol.c:531
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ HttpProtocol_UnlockRequest()

static HRESULT WINAPI HttpProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 813 of file http.c.

814 {
816 
817  TRACE("(%p)\n", This);
818 
819  return protocol_unlock_request(&This->base);
820 }
static HttpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: http.c:53
HRESULT protocol_unlock_request(Protocol *protocol)
Definition: protocol.c:506
#define TRACE(s)
Definition: solgame.cpp:4

◆ HttpProtocolUnk_AddRef()

static ULONG WINAPI HttpProtocolUnk_AddRef ( IUnknown iface)
static

Definition at line 669 of file http.c.

670 {
673  TRACE("(%p) ref=%d\n", This, ref);
674  return ref;
675 }
static HttpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: http.c:48
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ HttpProtocolUnk_QueryInterface()

static HRESULT WINAPI HttpProtocolUnk_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 634 of file http.c.

635 {
637 
638  if(IsEqualGUID(&IID_IUnknown, riid)) {
639  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
640  *ppv = &This->IUnknown_inner;
641  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
642  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
643  *ppv = &This->IInternetProtocolEx_iface;
644  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
645  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
646  *ppv = &This->IInternetProtocolEx_iface;
647  }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
648  TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
649  *ppv = &This->IInternetProtocolEx_iface;
650  }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
651  TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
652  *ppv = &This->IInternetPriority_iface;
653  }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) {
654  TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv);
655  *ppv = &This->IWinInetHttpInfo_iface;
656  }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
657  TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
658  *ppv = &This->IWinInetHttpInfo_iface;
659  }else {
660  *ppv = NULL;
661  WARN("not supported interface %s\n", debugstr_guid(riid));
662  return E_NOINTERFACE;
663  }
664 
665  IUnknown_AddRef((IUnknown*)*ppv);
666  return S_OK;
667 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HttpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: http.c:48
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HttpProtocolUnk_Release()

static ULONG WINAPI HttpProtocolUnk_Release ( IUnknown iface)
static

Definition at line 677 of file http.c.

678 {
681 
682  TRACE("(%p) ref=%d\n", This, ref);
683 
684  if(!ref) {
686  heap_free(This);
687 
689  }
690 
691  return ref;
692 }
static HttpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: http.c:48
Definition: send.c:47
void protocol_close_connection(Protocol *protocol)
Definition: protocol.c:531
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static void URLMON_UnlockModule(void)
Definition: urlmon_main.h:69
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HttpSProtocol_Construct()

HRESULT HttpSProtocol_Construct ( IUnknown outer,
void **  ppv 
)

Definition at line 992 of file http.c.

993 {
994  TRACE("(%p %p)\n", outer, ppv);
995 
996  return create_http_protocol(TRUE, outer, ppv);
997 }
#define TRUE
Definition: types.h:120
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT create_http_protocol(BOOL https, IUnknown *outer, void **ppobj)
Definition: http.c:961
#define TRACE(s)
Definition: solgame.cpp:4

◆ impl_from_IInternetPriority()

static HttpProtocol* impl_from_IInternetPriority ( IInternetPriority iface)
inlinestatic

Definition at line 58 of file http.c.

59 {
60  return CONTAINING_RECORD(iface, HttpProtocol, IInternetPriority_iface);
61 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpPriority_AddRef(), HttpPriority_GetPriority(), HttpPriority_QueryInterface(), HttpPriority_Release(), and HttpPriority_SetPriority().

◆ impl_from_IInternetProtocolEx()

static HttpProtocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
inlinestatic

Definition at line 53 of file http.c.

54 {
55  return CONTAINING_RECORD(iface, HttpProtocol, IInternetProtocolEx_iface);
56 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpProtocol_Abort(), HttpProtocol_AddRef(), HttpProtocol_Continue(), HttpProtocol_LockRequest(), HttpProtocol_QueryInterface(), HttpProtocol_Read(), HttpProtocol_Release(), HttpProtocol_Resume(), HttpProtocol_Seek(), HttpProtocol_Start(), HttpProtocol_StartEx(), HttpProtocol_Suspend(), HttpProtocol_Terminate(), and HttpProtocol_UnlockRequest().

◆ impl_from_IUnknown()

static HttpProtocol* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 48 of file http.c.

49 {
50  return CONTAINING_RECORD(iface, HttpProtocol, IUnknown_inner);
51 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpProtocolUnk_AddRef(), HttpProtocolUnk_QueryInterface(), and HttpProtocolUnk_Release().

◆ impl_from_IWinInetHttpInfo()

static HttpProtocol* impl_from_IWinInetHttpInfo ( IWinInetHttpInfo iface)
inlinestatic

Definition at line 63 of file http.c.

64 {
65  return CONTAINING_RECORD(iface, HttpProtocol, IWinInetHttpInfo_iface);
66 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpInfo_AddRef(), HttpInfo_QueryInfo(), HttpInfo_QueryInterface(), HttpInfo_QueryOption(), and HttpInfo_Release().

◆ impl_from_Protocol()

static HttpProtocol* impl_from_Protocol ( Protocol prot)
inlinestatic

Definition at line 285 of file http.c.

286 {
287  return CONTAINING_RECORD(prot, HttpProtocol, base);
288 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpProtocol_close_connection(), HttpProtocol_on_error(), HttpProtocol_open_request(), and HttpProtocol_start_downloading().

◆ internet_error_to_hres()

static HRESULT internet_error_to_hres ( DWORD  error)
inlinestatic

Definition at line 102 of file http.c.

103 {
104  switch(error)
105  {
115  return INET_E_INVALID_CERTIFICATE;
119  return INET_E_REDIRECT_FAILED;
120  default:
121  return INET_E_DOWNLOAD_FAILURE;
122  }
123 }
#define ERROR_INTERNET_SEC_CERT_CN_INVALID
Definition: wininet.h:2026
#define ERROR_INTERNET_SEC_CERT_NO_REV
Definition: wininet.h:2043
#define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR
Definition: wininet.h:2028
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_INTERNET_SEC_CERT_REV_FAILED
Definition: wininet.h:2044
#define ERROR_INTERNET_SEC_CERT_REVOKED
Definition: wininet.h:2078
#define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED
Definition: wininet.h:2032
#define ERROR_INTERNET_SEC_CERT_ERRORS
Definition: wininet.h:2042
#define ERROR_INTERNET_SEC_CERT_DATE_INVALID
Definition: wininet.h:2025
#define ERROR_INTERNET_INVALID_CA
Definition: wininet.h:2033
#define ERROR_INTERNET_SEC_INVALID_CERT
Definition: wininet.h:2077
#define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR
Definition: wininet.h:2027
#define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION
Definition: wininet.h:2068

Referenced by handle_http_error().

◆ is_redirect_response()

static BOOL is_redirect_response ( DWORD  status_code)
static

Definition at line 495 of file http.c.

496 {
497  switch(status_code) {
499  case HTTP_STATUS_MOVED:
502  return TRUE;
503  }
504  return FALSE;
505 }
#define TRUE
Definition: types.h:120
#define HTTP_STATUS_REDIRECT_METHOD
Definition: winhttp.h:251
#define HTTP_STATUS_REDIRECT
Definition: winhttp.h:250
#define HTTP_STATUS_REDIRECT_KEEP_VERB
Definition: winhttp.h:254
#define HTTP_STATUS_MOVED
Definition: winhttp.h:249

Referenced by HttpProtocol_start_downloading().

◆ query_http_info()

static LPWSTR query_http_info ( HttpProtocol This,
DWORD  option 
)
static

Definition at line 71 of file http.c.

72 {
73  LPWSTR ret = NULL;
74  DWORD len = 0;
75  BOOL res;
76 
77  res = HttpQueryInfoW(This->base.request, option, NULL, &len, NULL);
79  ret = heap_alloc(len);
80  res = HttpQueryInfoW(This->base.request, option, ret, &len, NULL);
81  }
82  if(!res) {
83  TRACE("HttpQueryInfoW(%d) failed: %08x\n", option, GetLastError());
84  heap_free(ret);
85  return NULL;
86  }
87 
88  return ret;
89 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: getopt.h:108
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3883
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by HttpProtocol_start_downloading().

◆ send_http_request()

static ULONG send_http_request ( HttpProtocol This)
static

Definition at line 243 of file http.c.

244 {
246  BOOL res;
247 
248  send_buffer.lpcszHeader = This->full_header;
249  send_buffer.dwHeadersLength = send_buffer.dwHeadersTotal = lstrlenW(This->full_header);
250 
251  if(This->base.bind_info.dwBindVerb != BINDVERB_GET) {
252  switch(This->base.bind_info.stgmedData.tymed) {
253  case TYMED_HGLOBAL:
254  /* Native does not use GlobalLock/GlobalUnlock, so we won't either */
255  send_buffer.lpvBuffer = This->base.bind_info.stgmedData.u.hGlobal;
256  send_buffer.dwBufferLength = send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData;
257  break;
258  case TYMED_ISTREAM: {
260 
261  send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData;
262  if(!This->base.post_stream) {
263  This->base.post_stream = This->base.bind_info.stgmedData.u.pstm;
264  IStream_AddRef(This->base.post_stream);
265  }
266 
267  offset.QuadPart = 0;
268  IStream_Seek(This->base.post_stream, offset, STREAM_SEEK_SET, NULL);
269  break;
270  }
271  default:
272  FIXME("Unsupported This->base.bind_info.stgmedData.tymed %d\n", This->base.bind_info.stgmedData.tymed);
273  }
274  }
275 
276  if(This->base.post_stream)
277  res = HttpSendRequestExW(This->base.request, &send_buffer, NULL, 0, 0);
278  else
279  res = HttpSendRequestW(This->base.request, send_buffer.lpcszHeader, send_buffer.dwHeadersLength,
280  send_buffer.lpvBuffer, send_buffer.dwBufferLength);
281 
282  return res ? 0 : GetLastError();
283 }
GLintptr offset
Definition: glext.h:5920
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define lstrlenW
Definition: compat.h:415
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5631
BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, LPINTERNET_BUFFERSW lpBuffersIn, LPINTERNET_BUFFERSW lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:5536
struct _INTERNET_BUFFERSW INTERNET_BUFFERSW
GLuint res
Definition: glext.h:9613
static const char * send_buffer
Definition: http.c:2142

Referenced by HttpProtocol_on_error(), and HttpProtocol_open_request().

◆ set_security_flag()

static BOOL set_security_flag ( HttpProtocol This,
DWORD  flags 
)
inlinestatic

Definition at line 91 of file http.c.

92 {
93  BOOL res;
94 
96  if(!res)
97  ERR("Failed to set security flags: %x\n", flags);
98 
99  return res;
100 }
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:2714
unsigned int BOOL
Definition: ntddk_ex.h:94
GLbitfield flags
Definition: glext.h:7161
#define ERR(fmt,...)
Definition: debug.h:109
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
GLuint res
Definition: glext.h:9613

Referenced by handle_http_error().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( urlmon  )

Variable Documentation

◆ AsyncProtocolVtbl

const ProtocolVtbl AsyncProtocolVtbl
static
Initial value:
= {
}
static HRESULT HttpProtocol_start_downloading(Protocol *prot)
Definition: http.c:507
static void HttpProtocol_close_connection(Protocol *prot)
Definition: http.c:589
static void HttpProtocol_on_error(Protocol *prot, DWORD error)
Definition: http.c:602
static HRESULT HttpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags, HINTERNET internet_session, IInternetBindInfo *bind_info)
Definition: http.c:290
static HRESULT HttpProtocol_end_request(Protocol *protocol)
Definition: http.c:482

Definition at line 626 of file http.c.

Referenced by create_http_protocol().

◆ default_headersW

const WCHAR default_headersW[]
static
Initial value:
= {
'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0}

Definition at line 68 of file http.c.

Referenced by HttpProtocol_open_request().

◆ HttpPriorityVtbl

const IInternetPriorityVtbl HttpPriorityVtbl
static
Initial value:
= {
}
static ULONG WINAPI HttpPriority_Release(IInternetPriority *iface)
Definition: http.c:872
static HRESULT WINAPI HttpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: http.c:888
static ULONG WINAPI HttpPriority_AddRef(IInternetPriority *iface)
Definition: http.c:866
static HRESULT WINAPI HttpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: http.c:878
static HRESULT WINAPI HttpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
Definition: http.c:860

Definition at line 898 of file http.c.

Referenced by create_http_protocol().

◆ HttpProtocolUnkVtbl

const IUnknownVtbl HttpProtocolUnkVtbl
static
Initial value:
= {
}
static ULONG WINAPI HttpProtocolUnk_AddRef(IUnknown *iface)
Definition: http.c:669
static HRESULT WINAPI HttpProtocolUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: http.c:634
static ULONG WINAPI HttpProtocolUnk_Release(IUnknown *iface)
Definition: http.c:677

Definition at line 694 of file http.c.

Referenced by create_http_protocol().

◆ HttpProtocolVtbl

const IInternetProtocolExVtbl HttpProtocolVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HttpProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
Definition: http.c:822
static ULONG WINAPI HttpProtocol_AddRef(IInternetProtocolEx *iface)
Definition: http.c:707
static ULONG WINAPI HttpProtocol_Release(IInternetProtocolEx *iface)
Definition: http.c:714
static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: http.c:796
static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
Definition: http.c:700
static HRESULT WINAPI HttpProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: http.c:721
static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: http.c:762
static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: http.c:743
static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocolEx *iface)
Definition: http.c:772
static HRESULT WINAPI HttpProtocol_Resume(IInternetProtocolEx *iface)
Definition: http.c:779
static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: http.c:813
static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: http.c:752
static HRESULT WINAPI HttpProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: http.c:786
static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: http.c:804

Definition at line 843 of file http.c.

Referenced by create_http_protocol().

◆ WinInetHttpInfoVtbl

const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
Definition: http.c:906
static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
Definition: http.c:938
static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer)
Definition: http.c:924
static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
Definition: http.c:912
static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
Definition: http.c:918

Definition at line 953 of file http.c.

Referenced by create_http_protocol().