ReactOS  0.4.14-dev-317-g96040ec
bindprot.c File Reference
#include "urlmon_main.h"
#include "wine/debug.h"
Include dependency graph for bindprot.c:

Go to the source code of this file.

Classes

struct  _task_header_t
 
struct  switch_task_t
 
struct  on_progress_task_t
 
struct  report_data_task_t
 
struct  report_result_task_t
 

Macros

#define BUFFER_SIZE   2048
 
#define MIME_TEST_SIZE   255
 
#define WM_MK_CONTINUE   (WM_USER+101)
 
#define WM_MK_RELEASE   (WM_USER+102)
 

Typedefs

typedef void(* task_proc_t) (BindProtocol *, task_header_t *)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (urlmon)
 
static void process_tasks (BindProtocol *This)
 
static LRESULT WINAPI notif_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static BOOL WINAPI register_notif_wnd_class (INIT_ONCE *once, void *param, void **context)
 
void unregister_notif_wnd_class (void)
 
HWND get_notif_hwnd (void)
 
void release_notif_hwnd (HWND hwnd)
 
static void push_task (BindProtocol *This, task_header_t *task, task_proc_t proc)
 
static BOOL is_apartment_thread (BindProtocol *This)
 
static BOOL do_direct_notif (BindProtocol *This)
 
static HRESULT handle_mime_filter (BindProtocol *This, IInternetProtocol *mime_filter)
 
static void mime_available (BindProtocol *This, LPCWSTR mime, BOOL verified)
 
static BindProtocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static HRESULT WINAPI BindProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindProtocol_AddRef (IInternetProtocolEx *iface)
 
static void release_protocol_handler (BindProtocol *This)
 
static ULONG WINAPI BindProtocol_Release (IInternetProtocolEx *iface)
 
static HRESULT WINAPI BindProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI BindProtocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI BindProtocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI BindProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI BindProtocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI BindProtocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI BindProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI BindProtocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI BindProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI BindProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI BindProtocol_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
void set_binding_sink (BindProtocol *This, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
 
static BindProtocolimpl_from_IInternetProtocol (IInternetProtocol *iface)
 
static HRESULT WINAPI ProtocolHandler_QueryInterface (IInternetProtocol *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ProtocolHandler_AddRef (IInternetProtocol *iface)
 
static ULONG WINAPI ProtocolHandler_Release (IInternetProtocol *iface)
 
static HRESULT WINAPI ProtocolHandler_Start (IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI ProtocolHandler_Continue (IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI ProtocolHandler_Abort (IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI ProtocolHandler_Terminate (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI ProtocolHandler_Suspend (IInternetProtocol *iface)
 
static HRESULT WINAPI ProtocolHandler_Resume (IInternetProtocol *iface)
 
static HRESULT WINAPI ProtocolHandler_Read (IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI ProtocolHandler_Seek (IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI ProtocolHandler_LockRequest (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI ProtocolHandler_UnlockRequest (IInternetProtocol *iface)
 
static BindProtocolimpl_from_IInternetProtocolSinkHandler (IInternetProtocolSink *iface)
 
static HRESULT WINAPI ProtocolSinkHandler_QueryInterface (IInternetProtocolSink *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ProtocolSinkHandler_AddRef (IInternetProtocolSink *iface)
 
static ULONG WINAPI ProtocolSinkHandler_Release (IInternetProtocolSink *iface)
 
static HRESULT WINAPI ProtocolSinkHandler_Switch (IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI ProtocolSinkHandler_ReportProgress (IInternetProtocolSink *iface, ULONG status_code, LPCWSTR status_text)
 
static HRESULT WINAPI ProtocolSinkHandler_ReportData (IInternetProtocolSink *iface, DWORD bscf, ULONG progress, ULONG progress_max)
 
static HRESULT handle_redirect (BindProtocol *This, const WCHAR *url)
 
static HRESULT WINAPI ProtocolSinkHandler_ReportResult (IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
 
static BindProtocolimpl_from_IInternetBindInfo (IInternetBindInfo *iface)
 
static HRESULT WINAPI BindInfo_QueryInterface (IInternetBindInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindInfo_AddRef (IInternetBindInfo *iface)
 
static ULONG WINAPI BindInfo_Release (IInternetBindInfo *iface)
 
static HRESULT WINAPI BindInfo_GetBindInfo (IInternetBindInfo *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static HRESULT WINAPI BindInfo_GetBindString (IInternetBindInfo *iface, ULONG ulStringType, LPOLESTR *ppwzStr, ULONG cEl, ULONG *pcElFetched)
 
static BindProtocolimpl_from_IInternetPriority (IInternetPriority *iface)
 
static HRESULT WINAPI InternetPriority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InternetPriority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI InternetPriority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI InternetPriority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI InternetPriority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
static BindProtocolimpl_from_IInternetProtocolSink (IInternetProtocolSink *iface)
 
static HRESULT WINAPI BPInternetProtocolSink_QueryInterface (IInternetProtocolSink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BPInternetProtocolSink_AddRef (IInternetProtocolSink *iface)
 
static ULONG WINAPI BPInternetProtocolSink_Release (IInternetProtocolSink *iface)
 
static void switch_proc (BindProtocol *bind, task_header_t *t)
 
static HRESULT WINAPI BPInternetProtocolSink_Switch (IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
 
static void on_progress_proc (BindProtocol *This, task_header_t *t)
 
static HRESULT WINAPI BPInternetProtocolSink_ReportProgress (IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static void report_data_proc (BindProtocol *This, task_header_t *t)
 
static HRESULT WINAPI BPInternetProtocolSink_ReportData (IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
 
static void report_result_proc (BindProtocol *This, task_header_t *t)
 
static HRESULT WINAPI BPInternetProtocolSink_ReportResult (IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
 
static BindProtocolimpl_from_IServiceProvider (IServiceProvider *iface)
 
static HRESULT WINAPI BPServiceProvider_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BPServiceProvider_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI BPServiceProvider_Release (IServiceProvider *iface)
 
static HRESULT WINAPI BPServiceProvider_QueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
HRESULT create_binding_protocol (BindProtocol **protocol)
 

Variables

static const WCHAR wszURLMonikerNotificationWindow []
 
static ATOM notif_wnd_class
 
static const IInternetProtocolExVtbl BindProtocolVtbl
 
static const IInternetProtocolVtbl InternetProtocolHandlerVtbl
 
static const IInternetProtocolSinkVtbl InternetProtocolSinkHandlerVtbl
 
static const IInternetBindInfoVtbl InternetBindInfoVtbl
 
static const IInternetPriorityVtbl InternetPriorityVtbl
 
static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl
 
static const IServiceProviderVtbl ServiceProviderVtbl
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   2048

Definition at line 31 of file bindprot.c.

◆ MIME_TEST_SIZE

#define MIME_TEST_SIZE   255

Definition at line 32 of file bindprot.c.

◆ WM_MK_CONTINUE

#define WM_MK_CONTINUE   (WM_USER+101)

Definition at line 34 of file bindprot.c.

◆ WM_MK_RELEASE

#define WM_MK_RELEASE   (WM_USER+102)

Definition at line 35 of file bindprot.c.

Typedef Documentation

◆ task_proc_t

typedef void(* task_proc_t) (BindProtocol *, task_header_t *)

Definition at line 24 of file bindprot.c.

Function Documentation

◆ BindInfo_AddRef()

static ULONG WINAPI BindInfo_AddRef ( IInternetBindInfo iface)
static

Definition at line 1062 of file bindprot.c.

1063 {
1065  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1066 }
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1050

◆ BindInfo_GetBindInfo()

static HRESULT WINAPI BindInfo_GetBindInfo ( IInternetBindInfo iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo 
)
static

Definition at line 1074 of file bindprot.c.

1076 {
1078  HRESULT hres;
1079 
1080  TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo);
1081 
1082  hres = IInternetBindInfo_GetBindInfo(This->bind_info, grfBINDF, pbindinfo);
1083  if(FAILED(hres)) {
1084  WARN("GetBindInfo failed: %08x\n", hres);
1085  return hres;
1086  }
1087 
1088  if((pbindinfo->dwOptions & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS) && !This->redirect_callback) {
1090 
1091  hres = IInternetProtocolSink_QueryInterface(This->protocol_sink, &IID_IServiceProvider, (void**)&service_provider);
1092  if(SUCCEEDED(hres)) {
1093  hres = IServiceProvider_QueryService(service_provider, &IID_IBindCallbackRedirect, &IID_IBindCallbackRedirect,
1094  (void**)&This->redirect_callback);
1095  IServiceProvider_Release(service_provider);
1096  }
1097  }
1098 
1099  *grfBINDF |= BINDF_FROMURLMON;
1100  return hres;
1101 }
#define WARN(fmt,...)
Definition: debug.h:111
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1050
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ BindInfo_GetBindString()

static HRESULT WINAPI BindInfo_GetBindString ( IInternetBindInfo iface,
ULONG  ulStringType,
LPOLESTR ppwzStr,
ULONG  cEl,
ULONG pcElFetched 
)
static

Definition at line 1103 of file bindprot.c.

1105 {
1107 
1108  TRACE("(%p)->(%d %p %d %p)\n", This, ulStringType, ppwzStr, cEl, pcElFetched);
1109 
1110  return IInternetBindInfo_GetBindString(This->bind_info, ulStringType, ppwzStr, cEl, pcElFetched);
1111 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1050

◆ BindInfo_QueryInterface()

static HRESULT WINAPI BindInfo_QueryInterface ( IInternetBindInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1055 of file bindprot.c.

1057 {
1059  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1060 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1050

◆ BindInfo_Release()

static ULONG WINAPI BindInfo_Release ( IInternetBindInfo iface)
static

Definition at line 1068 of file bindprot.c.

1069 {
1071  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1072 }
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1050

◆ BindProtocol_Abort()

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

Definition at line 395 of file bindprot.c.

397 {
399 
400  TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
401 
402  return IInternetProtocol_Abort(This->protocol_handler, hrReason, dwOptions);
403 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_AddRef()

static ULONG WINAPI BindProtocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 302 of file bindprot.c.

303 {
306  TRACE("(%p) ref=%d\n", This, ref);
307  return ref;
308 }
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
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_Continue()

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

Definition at line 386 of file bindprot.c.

387 {
389 
390  TRACE("(%p)->(%p)\n", This, pProtocolData);
391 
392  return IInternetProtocol_Continue(This->protocol_handler, pProtocolData);
393 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_LockRequest()

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

Definition at line 448 of file bindprot.c.

449 {
451 
452  TRACE("(%p)->(%08x)\n", This, dwOptions);
453 
454  return IInternetProtocol_LockRequest(This->protocol_handler, dwOptions);
455 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_QueryInterface()

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

Definition at line 255 of file bindprot.c.

256 {
258 
259  *ppv = NULL;
260  if(IsEqualGUID(&IID_IUnknown, riid)) {
261  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
262  *ppv = &This->IInternetProtocolEx_iface;
263  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
264  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
265  *ppv = &This->IInternetProtocolEx_iface;
266  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
267  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
268  *ppv = &This->IInternetProtocolEx_iface;
269  }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
270  TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
271  *ppv = &This->IInternetProtocolEx_iface;
272  }else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) {
273  TRACE("(%p)->(IID_IInternetBindInfo %p)\n", This, ppv);
274  *ppv = &This->IInternetBindInfo_iface;
275  }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
276  TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
277  *ppv = &This->IInternetPriority_iface;
278  }else if(IsEqualGUID(&IID_IAuthenticate, riid)) {
279  FIXME("(%p)->(IID_IAuthenticate %p)\n", This, ppv);
280  }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
281  TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
282  *ppv = &This->IServiceProvider_iface;
283  }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
284  TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv);
285  *ppv = &This->IInternetProtocolSink_iface;
286  }else if(This->protocol_unk) {
287  HRESULT hres;
288  hres = IUnknown_QueryInterface(This->protocol_unk, riid, ppv);
289  TRACE("(%p) aggregated handler returned %08x for %s\n", This, hres, debugstr_guid(riid));
290  return hres;
291  }else {
292  WARN("not supported interface %s\n", debugstr_guid(riid));
293  }
294 
295  if(!*ppv)
296  return E_NOINTERFACE;
297 
298  IUnknown_AddRef((IUnknown*)*ppv);
299  return S_OK;
300 }
#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
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_Read()

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

Definition at line 428 of file bindprot.c.

430 {
432 
433  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
434 
435  if(pcbRead)
436  *pcbRead = 0;
437  return IInternetProtocol_Read(This->protocol_handler, pv, cb, pcbRead);
438 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

◆ BindProtocol_Release()

static ULONG WINAPI BindProtocol_Release ( IInternetProtocolEx iface)
static

Definition at line 331 of file bindprot.c.

332 {
335 
336  TRACE("(%p) ref=%d\n", This, ref);
337 
338  if(!ref) {
340  if(This->redirect_callback)
341  IBindCallbackRedirect_Release(This->redirect_callback);
342  if(This->bind_info)
343  IInternetBindInfo_Release(This->bind_info);
344  if(This->uri)
345  IUri_Release(This->uri);
346  SysFreeString(This->display_uri);
347 
349 
350  if(This->notif_hwnd)
351  release_notif_hwnd(This->notif_hwnd);
352  This->section.DebugInfo->Spare[0] = 0;
353  DeleteCriticalSection(&This->section);
354 
355  heap_free(This->mime);
356  heap_free(This);
357 
359  }
360 
361  return ref;
362 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
static void release_protocol_handler(BindProtocol *This)
Definition: bindprot.c:310
GLenum GLint ref
Definition: glext.h:6028
smooth NULL
Definition: ftsmooth.c:416
static void URLMON_UnlockModule(void)
Definition: urlmon_main.h:68
#define TRACE(s)
Definition: solgame.cpp:4
void release_notif_hwnd(HWND hwnd)
Definition: bindprot.c:141
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define InterlockedDecrement
Definition: armddk.h:52
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
Definition: bindprot.c:560
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ BindProtocol_Resume()

static HRESULT WINAPI BindProtocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 421 of file bindprot.c.

422 {
424  FIXME("(%p)\n", This);
425  return E_NOTIMPL;
426 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_Seek()

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

Definition at line 440 of file bindprot.c.

442 {
444  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
445  return E_NOTIMPL;
446 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
struct _LARGE_INTEGER::@2221 u

◆ BindProtocol_Start()

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

Definition at line 364 of file bindprot.c.

367 {
369  IUri *uri;
370  HRESULT hres;
371 
372  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
373  pOIBindInfo, grfPI, dwReserved);
374 
375  hres = CreateUri(szUrl, Uri_CREATE_FILE_USE_DOS_PATH, 0, &uri);
376  if(FAILED(hres))
377  return hres;
378 
379  hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
380  pOIBindInfo, grfPI, (HANDLE*)dwReserved);
381 
382  IUri_Release(uri);
383  return hres;
384 }
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
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5701

◆ BindProtocol_StartEx()

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

Definition at line 466 of file bindprot.c.

469 {
472  IInternetProtocolEx *protocolex;
475  CLSID clsid = IID_NULL;
476  IUnknown *protocol_unk = NULL;
477  LPOLESTR clsid_str;
478  HRESULT hres;
479 
480  TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink, pOIBindInfo, grfPI, dwReserved);
481 
482  if(!pUri || !pOIProtSink || !pOIBindInfo)
483  return E_INVALIDARG;
484 
485  This->pi = grfPI;
486 
487  if(This->uri) {
488  SysFreeString(This->display_uri);
489  IUri_Release(This->uri);
490  }
491  IUri_AddRef(pUri);
492  This->uri = pUri;
493 
494  hres = IInternetProtocolSink_QueryInterface(pOIProtSink, &IID_IServiceProvider,
495  (void**)&service_provider);
496  if(SUCCEEDED(hres)) {
497  /* FIXME: What's protocol CLSID here? */
498  IServiceProvider_QueryService(service_provider, &IID_IInternetProtocol,
499  &IID_IInternetProtocol, (void**)&protocol);
500  IServiceProvider_Release(service_provider);
501  }
502 
503  if(!protocol) {
504  IClassFactory *cf;
505 
506  hres = get_protocol_handler(pUri, &clsid, &cf);
507  if(FAILED(hres))
508  return hres;
509 
510  hres = IClassFactory_CreateInstance(cf, (IUnknown*)&This->IInternetBindInfo_iface,
511  &IID_IUnknown, (void**)&protocol_unk);
512  IClassFactory_Release(cf);
513  if(FAILED(hres))
514  return hres;
515 
516  hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
517  if(FAILED(hres)) {
518  IUnknown_Release(protocol_unk);
519  return hres;
520  }
521  }
522 
523  StringFromCLSID(&clsid, &clsid_str);
524  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_PROTOCOLCLASSID, clsid_str);
525  CoTaskMemFree(clsid_str);
526 
527  This->protocol_unk = protocol_unk;
528  This->protocol = protocol;
529 
530  if(!protocol_unk)
531  protocol_unk = (IUnknown*)protocol;
532 
533  set_binding_sink(This, pOIProtSink, pOIBindInfo);
534 
535  hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetPriority, (void**)&priority);
536  if(SUCCEEDED(hres)) {
537  IInternetPriority_SetPriority(priority, This->priority);
538  IInternetPriority_Release(priority);
539  }
540 
541  hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocolEx, (void**)&protocolex);
542  if(SUCCEEDED(hres)) {
543  hres = IInternetProtocolEx_StartEx(protocolex, pUri, &This->IInternetProtocolSink_iface,
544  &This->IInternetBindInfo_iface, 0, NULL);
545  IInternetProtocolEx_Release(protocolex);
546  }else {
547  hres = IUri_GetDisplayUri(pUri, &This->display_uri);
548  if(FAILED(hres))
549  return hres;
550 
551  hres = IInternetProtocol_Start(protocol, This->display_uri, &This->IInternetProtocolSink_iface,
552  &This->IInternetBindInfo_iface, 0, 0);
553  }
554 
555  if(SUCCEEDED(hres))
557  return hres;
558 }
static IClassFactory * cf
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static void process_tasks(BindProtocol *This)
Definition: bindprot.c:37
static LPOLESTR
Definition: stg_prop.c:27
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
REFCLSID clsid
Definition: msctf.c:82
#define IID_NULL
Definition: guiddef.h:98
HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret)
Definition: session.c:220
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
static int priority
Definition: timer.c:163
void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
Definition: bindprot.c:560
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

◆ BindProtocol_Suspend()

static HRESULT WINAPI BindProtocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 414 of file bindprot.c.

415 {
417  FIXME("(%p)\n", This);
418  return E_NOTIMPL;
419 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_Terminate()

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

Definition at line 405 of file bindprot.c.

406 {
408 
409  TRACE("(%p)->(%08x)\n", This, dwOptions);
410 
411  return IInternetProtocol_Terminate(This->protocol_handler, dwOptions);
412 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BindProtocol_UnlockRequest()

static HRESULT WINAPI BindProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 457 of file bindprot.c.

458 {
460 
461  TRACE("(%p)\n", This);
462 
463  return IInternetProtocol_UnlockRequest(This->protocol_handler);
464 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250

◆ BPInternetProtocolSink_AddRef()

static ULONG WINAPI BPInternetProtocolSink_AddRef ( IInternetProtocolSink iface)
static

Definition at line 1186 of file bindprot.c.

1187 {
1189  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1190 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174

◆ BPInternetProtocolSink_QueryInterface()

static HRESULT WINAPI BPInternetProtocolSink_QueryInterface ( IInternetProtocolSink iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1179 of file bindprot.c.

1181 {
1183  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1184 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ BPInternetProtocolSink_Release()

static ULONG WINAPI BPInternetProtocolSink_Release ( IInternetProtocolSink iface)
static

Definition at line 1192 of file bindprot.c.

1193 {
1195  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1196 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174

◆ BPInternetProtocolSink_ReportData()

static HRESULT WINAPI BPInternetProtocolSink_ReportData ( IInternetProtocolSink iface,
DWORD  grfBSCF,
ULONG  ulProgress,
ULONG  ulProgressMax 
)
static

Definition at line 1305 of file bindprot.c.

1307 {
1309 
1310  TRACE("(%p)->(%x %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax);
1311 
1312  if(!This->protocol_sink)
1313  return S_OK;
1314 
1315  if(!do_direct_notif(This)) {
1316  report_data_task_t *task;
1317 
1318  task = heap_alloc(sizeof(report_data_task_t));
1319  if(!task)
1320  return E_OUTOFMEMORY;
1321 
1322  task->bscf = grfBSCF;
1323  task->progress = ulProgress;
1324  task->progress_max = ulProgressMax;
1325 
1327  return S_OK;
1328  }
1329 
1330  return IInternetProtocolSink_ReportData(This->protocol_sink_handler,
1331  grfBSCF, ulProgress, ulProgressMax);
1332 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
static void report_data_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1295
static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
Definition: bindprot.c:159
static BOOL do_direct_notif(BindProtocol *This)
Definition: bindprot.c:189
#define S_OK
Definition: intsafe.h:59
task_header_t header
Definition: bindprot.c:1289

◆ BPInternetProtocolSink_ReportProgress()

static HRESULT WINAPI BPInternetProtocolSink_ReportProgress ( IInternetProtocolSink iface,
ULONG  ulStatusCode,
LPCWSTR  szStatusText 
)
static

Definition at line 1265 of file bindprot.c.

1267 {
1269 
1270  TRACE("(%p)->(%u %s)\n", This, ulStatusCode, debugstr_w(szStatusText));
1271 
1272  if(do_direct_notif(This)) {
1273  IInternetProtocolSink_ReportProgress(This->protocol_sink_handler, ulStatusCode, szStatusText);
1274  }else {
1275  on_progress_task_t *task;
1276 
1277  task = heap_alloc(sizeof(on_progress_task_t));
1278 
1279  task->status_code = ulStatusCode;
1280  task->status_text = heap_strdupW(szStatusText);
1281 
1283  }
1284 
1285  return S_OK;
1286 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
Definition: bindprot.c:159
static void on_progress_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1255
static BOOL do_direct_notif(BindProtocol *This)
Definition: bindprot.c:189
#define S_OK
Definition: intsafe.h:59
task_header_t header
Definition: bindprot.c:1249

◆ BPInternetProtocolSink_ReportResult()

static HRESULT WINAPI BPInternetProtocolSink_ReportResult ( IInternetProtocolSink iface,
HRESULT  hrResult,
DWORD  dwError,
LPCWSTR  szResult 
)
static

Definition at line 1352 of file bindprot.c.

1354 {
1356 
1357  TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
1358 
1359  if(!This->protocol_sink)
1360  return E_FAIL;
1361  This->reported_result = TRUE;
1362 
1363  if(!do_direct_notif(This)) {
1364  report_result_task_t *task;
1365 
1366  task = heap_alloc(sizeof(report_result_task_t));
1367  if(!task)
1368  return E_OUTOFMEMORY;
1369 
1370  task->hres = hrResult;
1371  task->err = dwError;
1372  task->str = heap_strdupW(szResult);
1373 
1375  return S_OK;
1376  }
1377 
1378  return IInternetProtocolSink_ReportResult(This->protocol_sink_handler, hrResult, dwError, szResult);
1379 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174
#define TRUE
Definition: types.h:120
#define E_FAIL
Definition: ddrawi.h:102
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
task_header_t header
Definition: bindprot.c:1335
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
Definition: bindprot.c:159
static BOOL do_direct_notif(BindProtocol *This)
Definition: bindprot.c:189
#define S_OK
Definition: intsafe.h:59
static void report_result_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1342

◆ BPInternetProtocolSink_Switch()

static HRESULT WINAPI BPInternetProtocolSink_Switch ( IInternetProtocolSink iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 1212 of file bindprot.c.

1214 {
1216  PROTOCOLDATA *data;
1217 
1218  TRACE("(%p)->(%p)\n", This, pProtocolData);
1219 
1220  TRACE("flags %x state %x data %p cb %u\n", pProtocolData->grfFlags, pProtocolData->dwState,
1221  pProtocolData->pData, pProtocolData->cbData);
1222 
1223  data = heap_alloc(sizeof(PROTOCOLDATA));
1224  if(!data)
1225  return E_OUTOFMEMORY;
1226  memcpy(data, pProtocolData, sizeof(PROTOCOLDATA));
1227 
1228  if((This->pi&PI_APARTMENTTHREADED && pProtocolData->grfFlags&PI_FORCE_ASYNC)
1229  || !do_direct_notif(This)) {
1230  switch_task_t *task;
1231 
1232  task = heap_alloc(sizeof(switch_task_t));
1233  if(!task)
1234  {
1235  heap_free(data);
1236  return E_OUTOFMEMORY;
1237  }
1238 
1239  task->data = data;
1240 
1241  push_task(This, &task->header, switch_proc);
1242  return S_OK;
1243  }
1244 
1245  return IInternetProtocolSink_Switch(This->protocol_sink_handler, data);
1246 }
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1174
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
Definition: bindprot.c:159
static BOOL do_direct_notif(BindProtocol *This)
Definition: bindprot.c:189
PROTOCOLDATA * data
Definition: bindprot.c:1200
#define S_OK
Definition: intsafe.h:59
task_header_t header
Definition: bindprot.c:1199
static void switch_proc(BindProtocol *bind, task_header_t *t)
Definition: bindprot.c:1203
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ BPServiceProvider_AddRef()

static ULONG WINAPI BPServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 1403 of file bindprot.c.

1404 {
1406  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1407 }
static BindProtocol * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: bindprot.c:1391

◆ BPServiceProvider_QueryInterface()

static HRESULT WINAPI BPServiceProvider_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1396 of file bindprot.c.

1398 {
1400  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1401 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static BindProtocol * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: bindprot.c:1391

◆ BPServiceProvider_QueryService()

static HRESULT WINAPI BPServiceProvider_QueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1415 of file bindprot.c.

1417 {
1419 
1420  TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
1421 
1422  if(!This->service_provider)
1423  return E_NOINTERFACE;
1424 
1425  return IServiceProvider_QueryService(This->service_provider, guidService, riid, ppv);
1426 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static BindProtocol * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: bindprot.c:1391
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

◆ BPServiceProvider_Release()

static ULONG WINAPI BPServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 1409 of file bindprot.c.

1410 {
1412  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1413 }
static BindProtocol * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: bindprot.c:1391

◆ create_binding_protocol()

HRESULT create_binding_protocol ( BindProtocol **  protocol)

Definition at line 1435 of file bindprot.c.

1436 {
1437  BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
1438 
1439  ret->IInternetProtocolEx_iface.lpVtbl = &BindProtocolVtbl;
1440  ret->IInternetBindInfo_iface.lpVtbl = &InternetBindInfoVtbl;
1441  ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl;
1442  ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
1443  ret->IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkVtbl;
1444 
1445  ret->default_protocol_handler.IInternetProtocol_iface.lpVtbl = &InternetProtocolHandlerVtbl;
1446  ret->default_protocol_handler.IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkHandlerVtbl;
1447 
1448  ret->ref = 1;
1449  ret->apartment_thread = GetCurrentThreadId();
1450  ret->notif_hwnd = get_notif_hwnd();
1451  ret->protocol_handler = &ret->default_protocol_handler.IInternetProtocol_iface;
1452  ret->protocol_sink_handler = &ret->default_protocol_handler.IInternetProtocolSink_iface;
1453  InitializeCriticalSection(&ret->section);
1454  ret->section.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BindProtocol.section");
1455 
1457 
1458  *protocol = ret;
1459  return S_OK;
1460 }
static const IInternetProtocolExVtbl BindProtocolVtbl
Definition: bindprot.c:584
#define DWORD_PTR
Definition: treelist.c:76
static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl
Definition: bindprot.c:1381
static const IInternetPriorityVtbl InternetPriorityVtbl
Definition: bindprot.c:1165
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
static const IInternetBindInfoVtbl InternetBindInfoVtbl
Definition: bindprot.c:1113
HWND get_notif_hwnd(void)
Definition: bindprot.c:111
int ret
static const IInternetProtocolVtbl InternetProtocolHandlerVtbl
Definition: bindprot.c:818
#define S_OK
Definition: intsafe.h:59
static const IServiceProviderVtbl ServiceProviderVtbl
Definition: bindprot.c:1428
static const IInternetProtocolSinkVtbl InternetProtocolSinkHandlerVtbl
Definition: bindprot.c:1040
static void URLMON_LockModule(void)
Definition: urlmon_main.h:67

Referenced by Binding_Create(), and InternetSession_CreateBinding().

◆ do_direct_notif()

static BOOL do_direct_notif ( BindProtocol This)
inlinestatic

Definition at line 189 of file bindprot.c.

190 {
191  return !(This->pi & PI_APARTMENTTHREADED) || (is_apartment_thread(This) && !This->continue_call);
192 }
static BOOL is_apartment_thread(BindProtocol *This)
Definition: bindprot.c:184

Referenced by BPInternetProtocolSink_ReportData(), BPInternetProtocolSink_ReportProgress(), BPInternetProtocolSink_ReportResult(), and BPInternetProtocolSink_Switch().

◆ get_notif_hwnd()

HWND get_notif_hwnd ( void  )

Definition at line 111 of file bindprot.c.

112 {
113  tls_data_t *tls_data;
114 
115  static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
116 
117  tls_data = get_tls_data();
118  if(!tls_data)
119  return NULL;
120 
121  if(tls_data->notif_hwnd_cnt) {
122  tls_data->notif_hwnd_cnt++;
123  return tls_data->notif_hwnd;
124  }
125 
127  if(!notif_wnd_class)
128  return NULL;
129 
132  NULL, hProxyDll, NULL);
133  if(tls_data->notif_hwnd)
134  tls_data->notif_hwnd_cnt++;
135 
136  TRACE("hwnd = %p\n", tls_data->notif_hwnd);
137 
138  return tls_data->notif_hwnd;
139 }
static const WCHAR wszURLMonikerNotificationWindow[]
Definition: bindprot.c:86
static ATOM notif_wnd_class
Definition: bindprot.c:90
HWND notif_hwnd
Definition: urlmon_main.h:225
#define INIT_ONCE_STATIC_INIT
Definition: winbase.h:593
#define HWND_MESSAGE
Definition: winuser.h:1196
smooth NULL
Definition: ftsmooth.c:416
BOOL NTAPI InitOnceExecuteOnce(INIT_ONCE *once, PINIT_ONCE_FN func, void *param, void **context)
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void **context)
Definition: bindprot.c:92
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
DWORD notif_hwnd_cnt
Definition: urlmon_main.h:226
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
tls_data_t * get_tls_data(void)
Definition: urlmon_main.c:62

Referenced by Binding_Create(), and create_binding_protocol().

◆ handle_mime_filter()

static HRESULT handle_mime_filter ( BindProtocol This,
IInternetProtocol mime_filter 
)
static

Definition at line 194 of file bindprot.c.

195 {
196  PROTOCOLFILTERDATA filter_data = { sizeof(PROTOCOLFILTERDATA), NULL, NULL, NULL, 0 };
197  HRESULT hres;
198 
199  hres = IInternetProtocol_QueryInterface(mime_filter, &IID_IInternetProtocolSink, (void**)&This->protocol_sink_handler);
200  if(FAILED(hres)) {
201  This->protocol_sink_handler = &This->default_protocol_handler.IInternetProtocolSink_iface;
202  return hres;
203  }
204 
205  IInternetProtocol_AddRef(mime_filter);
206  This->protocol_handler = mime_filter;
207 
208  filter_data.pProtocol = &This->default_protocol_handler.IInternetProtocol_iface;
209  hres = IInternetProtocol_Start(mime_filter, This->mime, &This->default_protocol_handler.IInternetProtocolSink_iface,
210  &This->IInternetBindInfo_iface, PI_FILTER_MODE|PI_FORCE_ASYNC,
211  (HANDLE_PTR)&filter_data);
212  if(FAILED(hres)) {
213  IInternetProtocolSink_Release(This->protocol_sink_handler);
214  IInternetProtocol_Release(This->protocol_handler);
215  This->protocol_sink_handler = &This->default_protocol_handler.IInternetProtocolSink_iface;
216  This->protocol_handler = &This->default_protocol_handler.IInternetProtocol_iface;
217  return hres;
218  }
219 
220  /* NOTE: IE9 calls it on the new protocol_sink. It doesn't make sense so it seems to be a bug there. */
221  IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_LOADINGMIMEHANDLER, NULL);
222 
223  return S_OK;
224 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GET_FEATURE_FROM_THREAD_RESTRICTED struct _tagPROTOCOLFILTERDATA PROTOCOLFILTERDATA
#define S_OK
Definition: intsafe.h:59
unsigned long HANDLE_PTR
Definition: basetsd.h:78

Referenced by mime_available().

◆ handle_redirect()

static HRESULT handle_redirect ( BindProtocol This,
const WCHAR url 
)
static

Definition at line 998 of file bindprot.c.

999 {
1000  HRESULT hres;
1001 
1002  if(This->redirect_callback) {
1003  VARIANT_BOOL cancel = VARIANT_FALSE;
1004  IBindCallbackRedirect_Redirect(This->redirect_callback, url, &cancel);
1005  if(cancel)
1006  return INET_E_REDIRECT_FAILED;
1007  }
1008 
1009  if(This->protocol_sink) {
1010  hres = IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_REDIRECTING, url);
1011  if(FAILED(hres))
1012  return hres;
1013  }
1014 
1015  IInternetProtocol_Terminate(This->protocol, 0); /* should this be done in StartEx? */
1017 
1018  return IInternetProtocolEx_Start(&This->IInternetProtocolEx_iface, url, This->protocol_sink, This->bind_info, This->pi, 0);
1019 }
short VARIANT_BOOL
Definition: compat.h:1931
static void release_protocol_handler(BindProtocol *This)
Definition: bindprot.c:310
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432

Referenced by ProtocolSinkHandler_ReportResult().

◆ impl_from_IInternetBindInfo()

static BindProtocol* impl_from_IInternetBindInfo ( IInternetBindInfo iface)
inlinestatic

Definition at line 1050 of file bindprot.c.

1051 {
1052  return CONTAINING_RECORD(iface, BindProtocol, IInternetBindInfo_iface);
1053 }
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 BindInfo_AddRef(), BindInfo_GetBindInfo(), BindInfo_GetBindString(), BindInfo_QueryInterface(), and BindInfo_Release().

◆ impl_from_IInternetPriority()

static BindProtocol* impl_from_IInternetPriority ( IInternetPriority iface)
inlinestatic

Definition at line 1121 of file bindprot.c.

1122 {
1123  return CONTAINING_RECORD(iface, BindProtocol, IInternetPriority_iface);
1124 }
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 InternetPriority_AddRef(), InternetPriority_GetPriority(), InternetPriority_QueryInterface(), InternetPriority_Release(), and InternetPriority_SetPriority().

◆ impl_from_IInternetProtocol()

static BindProtocol* impl_from_IInternetProtocol ( IInternetProtocol iface)
inlinestatic

Definition at line 601 of file bindprot.c.

602 {
603  return CONTAINING_RECORD(iface, BindProtocol, default_protocol_handler.IInternetProtocol_iface);
604 }
IInternetProtocol IInternetProtocol_iface
Definition: urlmon_main.h:191
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 ProtocolHandler_Abort(), ProtocolHandler_AddRef(), ProtocolHandler_Continue(), ProtocolHandler_LockRequest(), ProtocolHandler_QueryInterface(), ProtocolHandler_Read(), ProtocolHandler_Release(), ProtocolHandler_Resume(), ProtocolHandler_Seek(), ProtocolHandler_Suspend(), ProtocolHandler_Terminate(), and ProtocolHandler_UnlockRequest().

◆ impl_from_IInternetProtocolEx()

static BindProtocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
inlinestatic

Definition at line 250 of file bindprot.c.

251 {
252  return CONTAINING_RECORD(iface, BindProtocol, IInternetProtocolEx_iface);
253 }
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 BindProtocol_Abort(), BindProtocol_AddRef(), BindProtocol_Continue(), BindProtocol_LockRequest(), BindProtocol_QueryInterface(), BindProtocol_Read(), BindProtocol_Release(), BindProtocol_Resume(), BindProtocol_Seek(), BindProtocol_Start(), BindProtocol_StartEx(), BindProtocol_Suspend(), BindProtocol_Terminate(), and BindProtocol_UnlockRequest().

◆ impl_from_IInternetProtocolSink()

static BindProtocol* impl_from_IInternetProtocolSink ( IInternetProtocolSink iface)
inlinestatic

Definition at line 1174 of file bindprot.c.

1175 {
1176  return CONTAINING_RECORD(iface, BindProtocol, IInternetProtocolSink_iface);
1177 }
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 BPInternetProtocolSink_AddRef(), BPInternetProtocolSink_QueryInterface(), BPInternetProtocolSink_Release(), BPInternetProtocolSink_ReportData(), BPInternetProtocolSink_ReportProgress(), BPInternetProtocolSink_ReportResult(), and BPInternetProtocolSink_Switch().

◆ impl_from_IInternetProtocolSinkHandler()

static BindProtocol* impl_from_IInternetProtocolSinkHandler ( IInternetProtocolSink iface)
inlinestatic

Definition at line 834 of file bindprot.c.

835 {
836  return CONTAINING_RECORD(iface, BindProtocol, default_protocol_handler.IInternetProtocolSink_iface);
837 }
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
IInternetProtocolSink IInternetProtocolSink_iface
Definition: urlmon_main.h:178

Referenced by ProtocolSinkHandler_AddRef(), ProtocolSinkHandler_QueryInterface(), ProtocolSinkHandler_Release(), ProtocolSinkHandler_ReportData(), ProtocolSinkHandler_ReportProgress(), ProtocolSinkHandler_ReportResult(), and ProtocolSinkHandler_Switch().

◆ impl_from_IServiceProvider()

static BindProtocol* impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 1391 of file bindprot.c.

1392 {
1393  return CONTAINING_RECORD(iface, BindProtocol, IServiceProvider_iface);
1394 }
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 BPServiceProvider_AddRef(), BPServiceProvider_QueryInterface(), BPServiceProvider_QueryService(), and BPServiceProvider_Release().

◆ InternetPriority_AddRef()

static ULONG WINAPI InternetPriority_AddRef ( IInternetPriority iface)
static

Definition at line 1133 of file bindprot.c.

1134 {
1136  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1137 }
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1121

◆ InternetPriority_GetPriority()

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

Definition at line 1155 of file bindprot.c.

1156 {
1158 
1159  TRACE("(%p)->(%p)\n", This, pnPriority);
1160 
1161  *pnPriority = This->priority;
1162  return S_OK;
1163 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1121
#define S_OK
Definition: intsafe.h:59

◆ InternetPriority_QueryInterface()

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

Definition at line 1126 of file bindprot.c.

1128 {
1130  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1131 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1121

◆ InternetPriority_Release()

static ULONG WINAPI InternetPriority_Release ( IInternetPriority iface)
static

Definition at line 1139 of file bindprot.c.

1140 {
1142  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1143 }
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1121

◆ InternetPriority_SetPriority()

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

Definition at line 1145 of file bindprot.c.

1146 {
1148 
1149  TRACE("(%p)->(%d)\n", This, nPriority);
1150 
1151  This->priority = nPriority;
1152  return S_OK;
1153 }
#define TRACE(s)
Definition: solgame.cpp:4
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1121
#define S_OK
Definition: intsafe.h:59

◆ is_apartment_thread()

static BOOL is_apartment_thread ( BindProtocol This)
inlinestatic

Definition at line 184 of file bindprot.c.

185 {
186  return This->apartment_thread == GetCurrentThreadId();
187 }
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458

Referenced by do_direct_notif(), ProtocolHandler_Read(), and ProtocolSinkHandler_ReportData().

◆ mime_available()

static void mime_available ( BindProtocol This,
LPCWSTR  mime,
BOOL  verified 
)
static

Definition at line 226 of file bindprot.c.

227 {
229  HRESULT hres;
230 
231  heap_free(This->mime);
232  This->mime = heap_strdupW(mime);
233 
234  if(This->protocol_handler==&This->default_protocol_handler.IInternetProtocol_iface
235  && (mime_filter = get_mime_filter(mime))) {
236  TRACE("Got mime filter for %s\n", debugstr_w(mime));
237 
239  IInternetProtocol_Release(mime_filter);
240  if(FAILED(hres))
241  FIXME("MIME filter failed: %08x\n", hres);
242  }
243 
244  if(This->reported_mime || verified || !(This->pi & PI_MIMEVERIFICATION)) {
245  This->reported_mime = TRUE;
246  IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_MIMETYPEAVAILABLE, mime);
247  }
248 }
#define TRUE
Definition: types.h:120
static HRESULT handle_mime_filter(BindProtocol *This, IInternetProtocol *mime_filter)
Definition: bindprot.c:194
const WCHAR * mime
Definition: mimefilter.c:512
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IInternetProtocol * get_mime_filter(LPCWSTR mime)
Definition: session.c:250
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by ProtocolSinkHandler_ReportProgress().

◆ notif_wnd_proc()

static LRESULT WINAPI notif_wnd_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 62 of file bindprot.c.

63 {
64  switch(msg) {
65  case WM_MK_CONTINUE: {
67 
69 
70  IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
71  return 0;
72  }
73  case WM_MK_RELEASE: {
75 
76  if(!--data->notif_hwnd_cnt) {
78  data->notif_hwnd = NULL;
79  }
80  }
81  }
82 
83  return DefWindowProcW(hwnd, msg, wParam, lParam);
84 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void process_tasks(BindProtocol *This)
Definition: bindprot.c:37
BOOL WINAPI DestroyWindow(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MK_CONTINUE
Definition: bindprot.c:34
#define WM_MK_RELEASE
Definition: bindprot.c:35
smooth NULL
Definition: ftsmooth.c:416
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define msg(x)
Definition: auth_time.c:54
tls_data_t * get_tls_data(void)
Definition: urlmon_main.c:62
LPARAM lParam
Definition: combotst.c:139

Referenced by register_notif_wnd_class().

◆ on_progress_proc()

static void on_progress_proc ( BindProtocol This,
task_header_t t 
)
static

Definition at line 1255 of file bindprot.c.

1256 {
1258 
1259  IInternetProtocolSink_ReportProgress(This->protocol_sink_handler, task->status_code, task->status_text);
1260 
1261  heap_free(task->status_text);
1262  heap_free(task);
1263 }
GLdouble GLdouble t
Definition: gl.h:2047
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by BPInternetProtocolSink_ReportProgress().

◆ process_tasks()

static void process_tasks ( BindProtocol This)
static

Definition at line 37 of file bindprot.c.

38 {
39  task_header_t *task;
40 
41  while(1) {
42  EnterCriticalSection(&This->section);
43 
44  task = This->task_queue_head;
45  if(task) {
46  This->task_queue_head = task->next;
47  if(!This->task_queue_head)
48  This->task_queue_tail = NULL;
49  }
50 
51  LeaveCriticalSection(&This->section);
52 
53  if(!task)
54  break;
55 
56  This->continue_call++;
57  task->proc(This, task);
58  This->continue_call--;
59  }
60 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
smooth NULL
Definition: ftsmooth.c:416
async_task_proc_t proc
Definition: internet.h:390
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by BindProtocol_StartEx(), and notif_wnd_proc().

◆ ProtocolHandler_Abort()

static HRESULT WINAPI ProtocolHandler_Abort ( IInternetProtocol iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 679 of file bindprot.c.

681 {
683 
684  TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
685 
686  if(This->protocol && !This->reported_result)
687  return IInternetProtocol_Abort(This->protocol, hrReason, dwOptions);
688 
689  return S_OK;
690 }
DWORD dwOptions
Definition: solitaire.cpp:23
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ ProtocolHandler_AddRef()

static ULONG WINAPI ProtocolHandler_AddRef ( IInternetProtocol iface)
static

Definition at line 634 of file bindprot.c.

635 {
637  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
638 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601

◆ ProtocolHandler_Continue()

static HRESULT WINAPI ProtocolHandler_Continue ( IInternetProtocol iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 654 of file bindprot.c.

655 {
658  HRESULT hres;
659 
660  TRACE("(%p)->(%p)\n", This, pProtocolData);
661 
662  /* FIXME: This should not be needed. */
663  if(!This->protocol) {
664  if(!This->protocol_unk)
665  return E_FAIL;
666  hres = IUnknown_QueryInterface(This->protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
667  if(FAILED(hres))
668  return E_FAIL;
669  }
670 
671  hres = IInternetProtocol_Continue(protocol ? protocol : This->protocol, pProtocolData);
672 
673  heap_free(pProtocolData);
674  if(protocol)
675  IInternetProtocol_Release(protocol);
676  return hres;
677 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ProtocolHandler_LockRequest()

static HRESULT WINAPI ProtocolHandler_LockRequest ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 800 of file bindprot.c.

801 {
803 
804  TRACE("(%p)->(%08x)\n", This, dwOptions);
805 
806  return IInternetProtocol_LockRequest(This->protocol, dwOptions);
807 }
DWORD dwOptions
Definition: solitaire.cpp:23
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define TRACE(s)
Definition: solgame.cpp:4

◆ ProtocolHandler_QueryInterface()

static HRESULT WINAPI ProtocolHandler_QueryInterface ( IInternetProtocol iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 606 of file bindprot.c.

607 {
609 
610  *ppv = NULL;
611  if(IsEqualGUID(&IID_IUnknown, riid)) {
612  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
613  *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
614  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
615  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
616  *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
617  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
618  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
619  *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
620  }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
621  TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv);
622  *ppv = &This->default_protocol_handler.IInternetProtocolSink_iface;
623  }
624 
625  if(*ppv) {
626  IInternetProtocol_AddRef(iface);
627  return S_OK;
628  }
629 
630  WARN("not supported interface %s\n", debugstr_guid(riid));
631  return E_NOINTERFACE;
632 }
#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 BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
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

◆ ProtocolHandler_Read()

static HRESULT WINAPI ProtocolHandler_Read ( IInternetProtocol iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 740 of file bindprot.c.

742 {
744  ULONG read = 0;
745  HRESULT hres = S_OK;
746 
747  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
748 
749  if(This->buf_size) {
750  read = min(cb, This->buf_size);
751  memcpy(pv, This->buf, read);
752 
753  if(read == This->buf_size) {
754  heap_free(This->buf);
755  This->buf = NULL;
756  }else {
757  memmove(This->buf, This->buf+cb, This->buf_size-cb);
758  }
759 
760  This->buf_size -= read;
761  }
762 
763  if(read < cb) {
765  ULONG cread = 0;
766 
767  /* FIXME: We shouldn't need it, but out binding code currently depends on it. */
768  if(!This->protocol && This->protocol_unk) {
769  hres = IUnknown_QueryInterface(This->protocol_unk, &IID_IInternetProtocol,
770  (void**)&protocol);
771  if(FAILED(hres))
772  return E_ABORT;
773  }else {
774  protocol = This->protocol;
775  }
776 
778  This->continue_call++;
779  hres = IInternetProtocol_Read(protocol, (BYTE*)pv+read, cb-read, &cread);
781  This->continue_call--;
782  read += cread;
783 
784  if(!This->protocol)
785  IInternetProtocol_Release(protocol);
786  }
787 
788  *pcbRead = read;
789  return hres;
790 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static BOOL is_apartment_thread(BindProtocol *This)
Definition: bindprot.c:184
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define E_ABORT
Definition: winerror.h:2366
#define S_OK
Definition: intsafe.h:59
#define min(a, b)
Definition: monoChain.cc:55
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
unsigned int ULONG
Definition: retypes.h:1
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ProtocolHandler_Release()

static ULONG WINAPI ProtocolHandler_Release ( IInternetProtocol iface)
static

Definition at line 640 of file bindprot.c.

641 {
643  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
644 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601

◆ ProtocolHandler_Resume()

static HRESULT WINAPI ProtocolHandler_Resume ( IInternetProtocol iface)
static

Definition at line 733 of file bindprot.c.

734 {
736  FIXME("(%p)\n", This);
737  return E_NOTIMPL;
738 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProtocolHandler_Seek()

static HRESULT WINAPI ProtocolHandler_Seek ( IInternetProtocol iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 792 of file bindprot.c.

794 {
796  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
797  return E_NOTIMPL;
798 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
struct _LARGE_INTEGER::@2221 u

◆ ProtocolHandler_Start()

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

Definition at line 646 of file bindprot.c.

649 {
650  ERR("Should not be called\n");
651  return E_NOTIMPL;
652 }
#define ERR(fmt,...)
Definition: debug.h:109
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProtocolHandler_Suspend()

static HRESULT WINAPI ProtocolHandler_Suspend ( IInternetProtocol iface)
static

Definition at line 726 of file bindprot.c.

727 {
729  FIXME("(%p)\n", This);
730  return E_NOTIMPL;
731 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProtocolHandler_Terminate()

static HRESULT WINAPI ProtocolHandler_Terminate ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 692 of file bindprot.c.

693 {
695 
696  TRACE("(%p)->(%08x)\n", This, dwOptions);
697 
698  if(!This->reported_result)
699  return E_FAIL;
700 
701  /* This may get released in Terminate call. */
702  IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
703 
704  if(This->protocol) {
705  IInternetProtocol_Terminate(This->protocol, 0);
706  IInternetProtocol_Release(This->protocol);
707  This->protocol = NULL;
708  }
709 
711 
712  if(This->bind_info) {
713  IInternetBindInfo_Release(This->bind_info);
714  This->bind_info = NULL;
715  }
716 
717  if(This->redirect_callback) {
718  IBindCallbackRedirect_Release(This->redirect_callback);
719  This->redirect_callback = NULL;
720  }
721 
722  IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
723  return S_OK;
724 }
DWORD dwOptions
Definition: solitaire.cpp:23
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
Definition: bindprot.c:560

◆ ProtocolHandler_UnlockRequest()

static HRESULT WINAPI ProtocolHandler_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 809 of file bindprot.c.

810 {
812 
813  TRACE("(%p)\n", This);
814 
815  return IInternetProtocol_UnlockRequest(This->protocol);
816 }
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:601
#define TRACE(s)
Definition: solgame.cpp:4

◆ ProtocolSinkHandler_AddRef()

static ULONG WINAPI ProtocolSinkHandler_AddRef ( IInternetProtocolSink iface)
static

Definition at line 847 of file bindprot.c.

848 {
850  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
851 }
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ ProtocolSinkHandler_QueryInterface()

static HRESULT WINAPI ProtocolSinkHandler_QueryInterface ( IInternetProtocolSink iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 839 of file bindprot.c.

841 {
843  return IInternetProtocol_QueryInterface(&This->default_protocol_handler.IInternetProtocol_iface,
844  riid, ppvObject);
845 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ ProtocolSinkHandler_Release()

static ULONG WINAPI ProtocolSinkHandler_Release ( IInternetProtocolSink iface)
static

Definition at line 853 of file bindprot.c.

854 {
856  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
857 }
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ ProtocolSinkHandler_ReportData()

static HRESULT WINAPI ProtocolSinkHandler_ReportData ( IInternetProtocolSink iface,
DWORD  bscf,
ULONG  progress,
ULONG  progress_max 
)
static

Definition at line 915 of file bindprot.c.

917 {
919 
920  TRACE("(%p)->(%x %u %u)\n", This, bscf, progress, progress_max);
921 
922  This->bscf = bscf;
923  This->progress = progress;
924  This->progress_max = progress_max;
925 
926  if(!This->protocol_sink)
927  return S_OK;
928 
929  if((This->pi & PI_MIMEVERIFICATION) && !This->reported_mime) {
931  DWORD read = 0;
932  LPWSTR mime;
933  HRESULT hres;
934 
935  do {
936  read = 0;
938  This->continue_call++;
939  hres = IInternetProtocol_Read(This->protocol, buf,
940  sizeof(buf)-This->buf_size, &read);
942  This->continue_call--;
943  if(FAILED(hres) && hres != E_PENDING)
944  return hres;
945 
946  if(!This->buf) {
947  This->buf = heap_alloc(BUFFER_SIZE);
948  if(!This->buf)
949  return E_OUTOFMEMORY;
950  }else if(read + This->buf_size > BUFFER_SIZE) {
951  BYTE *tmp;
952 
953  tmp = heap_realloc(This->buf, read+This->buf_size);
954  if(!tmp)
955  return E_OUTOFMEMORY;
956  This->buf = tmp;
957  }
958 
959  memcpy(This->buf+This->buf_size, buf, read);
960  This->buf_size += read;
961  }while(This->buf_size < MIME_TEST_SIZE && hres == S_OK);
962 
963  if(This->buf_size < MIME_TEST_SIZE && hres != S_FALSE)
964  return S_OK;
965 
966  bscf = BSCF_FIRSTDATANOTIFICATION;
967  if(hres == S_FALSE)
968  bscf |= BSCF_LASTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
969 
970  if(!This->reported_mime) {
971  BSTR raw_uri;
972 
973  hres = IUri_GetRawUri(This->uri, &raw_uri);
974  if(FAILED(hres))
975  return hres;
976 
977  hres = FindMimeFromData(NULL, raw_uri, This->buf, min(This->buf_size, MIME_TEST_SIZE),
978  This->mime, 0, &mime, 0);
979  SysFreeString(raw_uri);
980  if(FAILED(hres))
981  return hres;
982 
983  heap_free(This->mime);
984  This->mime = heap_strdupW(mime);
986  This->reported_mime = TRUE;
987  if(This->protocol_sink)
988  IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_MIMETYPEAVAILABLE, This->mime);
989  }
990  }
991 
992  if(!This->protocol_sink)
993  return S_OK;
994 
995  return IInternetProtocolSink_ReportData(This->protocol_sink, bscf, progress, progress_max);
996 }
#define BUFFER_SIZE
Definition: bindprot.c:31
#define TRUE
Definition: types.h:120
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
const WCHAR * mime
Definition: mimefilter.c:512
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static BOOL is_apartment_thread(BindProtocol *This)
Definition: bindprot.c:184
OLECHAR * BSTR
Definition: compat.h:1934
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#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 memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
#define min(a, b)
Definition: monoChain.cc:55
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
cd_progress_ptr progress
Definition: cdjpeg.h:150
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834
#define MIME_TEST_SIZE
Definition: bindprot.c:32
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define E_PENDING
Definition: dinput.h:172
HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer, DWORD cbSize, LPCWSTR pwzMimeProposed, DWORD dwMimeFlags, LPWSTR *ppwzMimeOut, DWORD dwReserved)
Definition: mimefilter.c:680
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ProtocolSinkHandler_ReportProgress()

static HRESULT WINAPI ProtocolSinkHandler_ReportProgress ( IInternetProtocolSink iface,
ULONG  status_code,
LPCWSTR  status_text 
)
static

Definition at line 874 of file bindprot.c.

876 {
878 
879  TRACE("(%p)->(%s %s)\n", This, debugstr_bindstatus(status_code), debugstr_w(status_text));
880 
881  if(!This->protocol_sink)
882  return S_OK;
883 
884  switch(status_code) {
885  case BINDSTATUS_FINDINGRESOURCE:
886  case BINDSTATUS_CONNECTING:
887  case BINDSTATUS_REDIRECTING:
888  case BINDSTATUS_SENDINGREQUEST:
889  case BINDSTATUS_CACHEFILENAMEAVAILABLE:
890  case BINDSTATUS_DIRECTBIND:
891  case BINDSTATUS_ACCEPTRANGES:
892  case BINDSTATUS_DECODING:
893  IInternetProtocolSink_ReportProgress(This->protocol_sink, status_code, status_text);
894  break;
895 
896  case BINDSTATUS_BEGINDOWNLOADDATA:
897  IInternetProtocolSink_ReportData(This->protocol_sink, This->bscf, This->progress, This->progress_max);
898  break;
899 
900  case BINDSTATUS_MIMETYPEAVAILABLE:
901  mime_available(This, status_text, FALSE);
902  break;
903 
904  case BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE:
905  mime_available(This, status_text, TRUE);
906  break;
907 
908  default:
909  FIXME("unsupported ulStatusCode %u\n", status_code);
910  }
911 
912  return S_OK;
913 }
#define TRUE
Definition: types.h:120
static void mime_available(BindProtocol *This, LPCWSTR mime, BOOL verified)
Definition: bindprot.c:226
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
const char * debugstr_bindstatus(ULONG status)
Definition: urlmon_main.c:175
#define S_OK
Definition: intsafe.h:59
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ ProtocolSinkHandler_ReportResult()

static HRESULT WINAPI ProtocolSinkHandler_ReportResult ( IInternetProtocolSink iface,
HRESULT  hrResult,
DWORD  dwError,
LPCWSTR  szResult 
)
static

Definition at line 1021 of file bindprot.c.

1023 {
1025 
1026  TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
1027 
1028  if(hrResult == INET_E_REDIRECT_FAILED) {
1029  hrResult = handle_redirect(This, szResult);
1030  if(hrResult == S_OK)
1031  return S_OK;
1032  szResult = NULL;
1033  }
1034 
1035  if(This->protocol_sink)
1036  return IInternetProtocolSink_ReportResult(This->protocol_sink, hrResult, dwError, szResult);
1037  return S_OK;
1038 }
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT handle_redirect(BindProtocol *This, const WCHAR *url)
Definition: bindprot.c:998
#define S_OK
Definition: intsafe.h:59
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ ProtocolSinkHandler_Switch()

static HRESULT WINAPI ProtocolSinkHandler_Switch ( IInternetProtocolSink iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 859 of file bindprot.c.

861 {
863 
864  TRACE("(%p)->(%p)\n", This, pProtocolData);
865 
866  if(!This->protocol_sink) {
867  IInternetProtocol_Continue(This->protocol_handler, pProtocolData);
868  return S_OK;
869  }
870 
871  return IInternetProtocolSink_Switch(This->protocol_sink, pProtocolData);
872 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:834

◆ push_task()

static void push_task ( BindProtocol This,
task_header_t task,
task_proc_t  proc 
)
static

Definition at line 159 of file bindprot.c.

160 {
161  BOOL do_post = FALSE;
162 
163  task->proc = proc;
164  task->next = NULL;
165 
166  EnterCriticalSection(&This->section);
167 
168  if(This->task_queue_tail) {
169  This->task_queue_tail->next = task;
170  This->task_queue_tail = task;
171  }else {
172  This->task_queue_tail = This->task_queue_head = task;
173  do_post = !This->continue_call;
174  }
175 
176  LeaveCriticalSection(&This->section);
177 
178  if(do_post) {
179  IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
180  PostMessageW(This->notif_hwnd, WM_MK_CONTINUE, 0, (LPARAM)This);
181  }
182 }
static HANDLE proc()
Definition: pdb.c:32
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define WM_MK_CONTINUE
Definition: bindprot.c:34
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
async_task_proc_t proc
Definition: internet.h:390
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by BPInternetProtocolSink_ReportData(), BPInternetProtocolSink_ReportProgress(), BPInternetProtocolSink_ReportResult(), and BPInternetProtocolSink_Switch().

◆ register_notif_wnd_class()

static BOOL WINAPI register_notif_wnd_class ( INIT_ONCE once,
void param,
void **  context 
)
static

Definition at line 92 of file bindprot.c.

93 {
94  static WNDCLASSEXW wndclass = {
95  sizeof(wndclass), 0, notif_wnd_proc, 0, 0,
96  NULL, NULL, NULL, NULL, NULL,
98  };
99 
100  wndclass.hInstance = hProxyDll;
101  notif_wnd_class = RegisterClassExW(&wndclass);
102  return TRUE;
103 }
static const WCHAR wszURLMonikerNotificationWindow[]
Definition: bindprot.c:86
#define TRUE
Definition: types.h:120
static ATOM notif_wnd_class
Definition: bindprot.c:90
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
smooth NULL
Definition: ftsmooth.c:416
static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: bindprot.c:62
HINSTANCE hInstance
Definition: winuser.h:3195

Referenced by get_notif_hwnd().

◆ release_notif_hwnd()

void release_notif_hwnd ( HWND  hwnd)

Definition at line 141 of file bindprot.c.

142 {
144 
145  if(!data)
146  return;
147 
148  if(data->notif_hwnd != hwnd) {
149  PostMessageW(data->notif_hwnd, WM_MK_RELEASE, 0, 0);
150  return;
151  }
152 
153  if(!--data->notif_hwnd_cnt) {
154  DestroyWindow(data->notif_hwnd);
155  data->notif_hwnd = NULL;
156  }
157 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WM_MK_RELEASE
Definition: bindprot.c:35
smooth NULL
Definition: ftsmooth.c:416
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
tls_data_t * get_tls_data(void)
Definition: urlmon_main.c:62

Referenced by Binding_Release(), and BindProtocol_Release().

◆ release_protocol_handler()

static void release_protocol_handler ( BindProtocol This)
static

Definition at line 310 of file bindprot.c.

311 {
312  if(This->protocol) {
313  IInternetProtocol_Release(This->protocol);
314  This->protocol = NULL;
315  }
316  if(This->protocol_handler && This->protocol_handler != &This->default_protocol_handler.IInternetProtocol_iface) {
317  IInternetProtocol_Release(This->protocol_handler);
318  This->protocol_handler = &This->default_protocol_handler.IInternetProtocol_iface;
319  }
320  if(This->protocol_sink_handler &&
321  This->protocol_sink_handler != &This->default_protocol_handler.IInternetProtocolSink_iface) {
322  IInternetProtocolSink_Release(This->protocol_sink_handler);
323  This->protocol_sink_handler = &This->default_protocol_handler.IInternetProtocolSink_iface;
324  }
325  if(This->protocol_unk) {
326  IUnknown_Release(This->protocol_unk);
327  This->protocol_unk = NULL;
328  }
329 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by BindProtocol_Release(), and handle_redirect().

◆ report_data_proc()

static void report_data_proc ( BindProtocol This,
task_header_t t 
)
static

Definition at line 1295 of file bindprot.c.

1296 {
1298 
1299  IInternetProtocolSink_ReportData(This->protocol_sink_handler,
1300  task->bscf, task->progress, task->progress_max);
1301 
1302  heap_free(task);
1303 }
GLdouble GLdouble t
Definition: gl.h:2047
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by BPInternetProtocolSink_ReportData().

◆ report_result_proc()

static void report_result_proc ( BindProtocol This,
task_header_t t 
)
static

Definition at line 1342 of file bindprot.c.

1343 {
1345 
1346  IInternetProtocolSink_ReportResult(This->protocol_sink_handler, task->hres, task->err, task->str);
1347 
1348  heap_free(task->str);
1349  heap_free(task);
1350 }
GLdouble GLdouble t
Definition: gl.h:2047
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by BPInternetProtocolSink_ReportResult().

◆ set_binding_sink()

void set_binding_sink ( BindProtocol This,
IInternetProtocolSink sink,
IInternetBindInfo bind_info 
)

Definition at line 560 of file bindprot.c.

561 {
562  IInternetProtocolSink *prev_sink;
564 
565  if(sink)
566  IInternetProtocolSink_AddRef(sink);
567  prev_sink = InterlockedExchangePointer((void**)&This->protocol_sink, sink);
568  if(prev_sink)
569  IInternetProtocolSink_Release(prev_sink);
570 
571  if(sink)
572  IInternetProtocolSink_QueryInterface(sink, &IID_IServiceProvider, (void**)&service_provider);
573  service_provider = InterlockedExchangePointer((void**)&This->service_provider, service_provider);
574  if(service_provider)
575  IServiceProvider_Release(service_provider);
576 
577  if(bind_info)
578  IInternetBindInfo_AddRef(bind_info);
579  bind_info = InterlockedExchangePointer((void**)&This->bind_info, bind_info);
580  if(bind_info)
581  IInternetBindInfo_Release(bind_info);
582 }
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
smooth NULL
Definition: ftsmooth.c:416
static IServiceProvider service_provider
Definition: mimeole.c:1313
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
static IInternetBindInfo bind_info
Definition: mimeole.c:1273

Referenced by BindProtocol_Release(), BindProtocol_StartEx(), ProtocolHandler_Terminate(), and start_binding().

◆ switch_proc()

static void switch_proc ( BindProtocol bind,
task_header_t t 
)
static

Definition at line 1203 of file bindprot.c.

1204 {
1205  switch_task_t *task = (switch_task_t*)t;
1206 
1207  IInternetProtocol_Continue(bind->protocol_handler, task->data);
1208 
1209  heap_free(task);
1210 }
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36
GLdouble GLdouble t
Definition: gl.h:2047
PROTOCOLDATA * data
Definition: bindprot.c:1200
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by BPInternetProtocolSink_Switch().

◆ unregister_notif_wnd_class()

void unregister_notif_wnd_class ( void  )

Definition at line 105 of file bindprot.c.

106 {
107  if(notif_wnd_class)
109 }
static ATOM notif_wnd_class
Definition: bindprot.c:90
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by process_detach().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( urlmon  )

Variable Documentation

◆ BindProtocolVtbl

const IInternetProtocolExVtbl BindProtocolVtbl
static
Initial value:
= {
}
static HRESULT WINAPI BindProtocol_Suspend(IInternetProtocolEx *iface)
Definition: bindprot.c:414
static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: bindprot.c:428
static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:386
static HRESULT WINAPI BindProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: bindprot.c:440
static HRESULT WINAPI BindProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: bindprot.c:448
static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
Definition: bindprot.c:466
static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: bindprot.c:364
static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface)
Definition: bindprot.c:331
static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
Definition: bindprot.c:255
static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: bindprot.c:457
static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: bindprot.c:405
static HRESULT WINAPI BindProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: bindprot.c:395
static ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface)
Definition: bindprot.c:302
static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface)
Definition: bindprot.c:421

Definition at line 584 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetBindInfoVtbl

const IInternetBindInfoVtbl InternetBindInfoVtbl
static
Initial value:
= {
}
static ULONG WINAPI BindInfo_AddRef(IInternetBindInfo *iface)
Definition: bindprot.c:1062
static ULONG WINAPI BindInfo_Release(IInternetBindInfo *iface)
Definition: bindprot.c:1068
static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
Definition: bindprot.c:1074
static HRESULT WINAPI BindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1055
static HRESULT WINAPI BindInfo_GetBindString(IInternetBindInfo *iface, ULONG ulStringType, LPOLESTR *ppwzStr, ULONG cEl, ULONG *pcElFetched)
Definition: bindprot.c:1103

Definition at line 1113 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetPriorityVtbl

const IInternetPriorityVtbl InternetPriorityVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InternetPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1126
static ULONG WINAPI InternetPriority_Release(IInternetPriority *iface)
Definition: bindprot.c:1139
static HRESULT WINAPI InternetPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: bindprot.c:1145
static HRESULT WINAPI InternetPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: bindprot.c:1155
static ULONG WINAPI InternetPriority_AddRef(IInternetPriority *iface)
Definition: bindprot.c:1133

Definition at line 1165 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolHandlerVtbl

const IInternetProtocolVtbl InternetProtocolHandlerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ProtocolHandler_Resume(IInternetProtocol *iface)
Definition: bindprot.c:733
static ULONG WINAPI ProtocolHandler_AddRef(IInternetProtocol *iface)
Definition: bindprot.c:634
static HRESULT WINAPI ProtocolHandler_Suspend(IInternetProtocol *iface)
Definition: bindprot.c:726
static HRESULT WINAPI ProtocolHandler_UnlockRequest(IInternetProtocol *iface)
Definition: bindprot.c:809
static HRESULT WINAPI ProtocolHandler_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: bindprot.c:740
static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: bindprot.c:646
static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD dwOptions)
Definition: bindprot.c:692
static HRESULT WINAPI ProtocolHandler_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
Definition: bindprot.c:606
static HRESULT WINAPI ProtocolHandler_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: bindprot.c:792
static HRESULT WINAPI ProtocolHandler_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
Definition: bindprot.c:679
static ULONG WINAPI ProtocolHandler_Release(IInternetProtocol *iface)
Definition: bindprot.c:640
static HRESULT WINAPI ProtocolHandler_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:654
static HRESULT WINAPI ProtocolHandler_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
Definition: bindprot.c:800

Definition at line 818 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolSinkHandlerVtbl

const IInternetProtocolSinkVtbl InternetProtocolSinkHandlerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ProtocolSinkHandler_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:859
static HRESULT WINAPI ProtocolSinkHandler_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppvObject)
Definition: bindprot.c:839
static ULONG WINAPI ProtocolSinkHandler_Release(IInternetProtocolSink *iface)
Definition: bindprot.c:853
static HRESULT WINAPI ProtocolSinkHandler_ReportProgress(IInternetProtocolSink *iface, ULONG status_code, LPCWSTR status_text)
Definition: bindprot.c:874
static ULONG WINAPI ProtocolSinkHandler_AddRef(IInternetProtocolSink *iface)
Definition: bindprot.c:847
static HRESULT WINAPI ProtocolSinkHandler_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
Definition: bindprot.c:1021
static HRESULT WINAPI ProtocolSinkHandler_ReportData(IInternetProtocolSink *iface, DWORD bscf, ULONG progress, ULONG progress_max)
Definition: bindprot.c:915

Definition at line 1040 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolSinkVtbl

const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl
static
Initial value:
= {
}
static ULONG WINAPI BPInternetProtocolSink_AddRef(IInternetProtocolSink *iface)
Definition: bindprot.c:1186
static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:1212
static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
Definition: bindprot.c:1305
static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
Definition: bindprot.c:1352
static HRESULT WINAPI BPInternetProtocolSink_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1179
static ULONG WINAPI BPInternetProtocolSink_Release(IInternetProtocolSink *iface)
Definition: bindprot.c:1192
static HRESULT WINAPI BPInternetProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: bindprot.c:1265

Definition at line 1381 of file bindprot.c.

Referenced by create_binding_protocol().

◆ notif_wnd_class

ATOM notif_wnd_class
static

Definition at line 90 of file bindprot.c.

Referenced by get_notif_hwnd(), register_notif_wnd_class(), and unregister_notif_wnd_class().

◆ ServiceProviderVtbl

const IServiceProviderVtbl ServiceProviderVtbl
static
Initial value:
= {
}
static HRESULT WINAPI BPServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1396
static ULONG WINAPI BPServiceProvider_Release(IServiceProvider *iface)
Definition: bindprot.c:1409
static HRESULT WINAPI BPServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: bindprot.c:1415
static ULONG WINAPI BPServiceProvider_AddRef(IServiceProvider *iface)
Definition: bindprot.c:1403

Definition at line 1428 of file bindprot.c.

Referenced by create_binding_protocol().

◆ wszURLMonikerNotificationWindow

const WCHAR wszURLMonikerNotificationWindow[]
static
Initial value:
=
{'U','R','L',' ','M','o','n','i','k','e','r',' ',
'N','o','t','i','f','i','c','a','t','i','o','n',' ','W','i','n','d','o','w',0}

Definition at line 86 of file bindprot.c.

Referenced by get_notif_hwnd(), and register_notif_wnd_class().