ReactOS 0.4.16-dev-106-g10b08aa
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 1069 of file bindprot.c.

1070{
1072 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1073}
static BindProtocol * impl_from_IInternetBindInfo(IInternetBindInfo *iface)
Definition: bindprot.c:1057

◆ BindInfo_GetBindInfo()

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

Definition at line 1081 of file bindprot.c.

1083{
1085 HRESULT hres;
1086
1087 TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo);
1088
1089 hres = IInternetBindInfo_GetBindInfo(This->bind_info, grfBINDF, pbindinfo);
1090 if(FAILED(hres)) {
1091 WARN("GetBindInfo failed: %08x\n", hres);
1092 return hres;
1093 }
1094
1095 if((pbindinfo->dwOptions & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS) && !This->redirect_callback) {
1097
1098 hres = IInternetProtocolSink_QueryInterface(This->protocol_sink, &IID_IServiceProvider, (void**)&service_provider);
1099 if(SUCCEEDED(hres)) {
1100 hres = IServiceProvider_QueryService(service_provider, &IID_IBindCallbackRedirect, &IID_IBindCallbackRedirect,
1101 (void**)&This->redirect_callback);
1102 IServiceProvider_Release(service_provider);
1103 }
1104 }
1105
1106 *grfBINDF |= BINDF_FROMURLMON;
1107 return hres;
1108}
#define WARN(fmt,...)
Definition: precomp.h:61
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static IServiceProvider service_provider
Definition: mimeole.c:1313
HRESULT hres
Definition: protocol.c:465
#define TRACE(s)
Definition: solgame.cpp:4

◆ BindInfo_GetBindString()

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

Definition at line 1110 of file bindprot.c.

1112{
1114
1115 TRACE("(%p)->(%d %p %d %p)\n", This, ulStringType, ppwzStr, cEl, pcElFetched);
1116
1117 return IInternetBindInfo_GetBindString(This->bind_info, ulStringType, ppwzStr, cEl, pcElFetched);
1118}

◆ BindInfo_QueryInterface()

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

Definition at line 1062 of file bindprot.c.

1064{
1066 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1067}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ BindInfo_Release()

static ULONG WINAPI BindInfo_Release ( IInternetBindInfo iface)
static

Definition at line 1075 of file bindprot.c.

1076{
1078 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1079}

◆ 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}
static BindProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: bindprot.c:250
DWORD dwOptions
Definition: solitaire.cpp:25

◆ 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}
#define InterlockedIncrement
Definition: armddk.h:53
long LONG
Definition: pedump.c:60
Definition: send.c:48

◆ 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}

◆ 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}

◆ 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;
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) {
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 FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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}
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33

◆ 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);
357
359 }
360
361 return ref;
362}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
static void release_protocol_handler(BindProtocol *This)
Definition: bindprot.c:310
void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
Definition: bindprot.c:564
void release_notif_hwnd(HWND hwnd)
Definition: bindprot.c:141
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static void URLMON_UnlockModule(void)
Definition: urlmon_main.h:69
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ 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 E_NOTIMPL
Definition: ddrawi.h:99

◆ 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}
struct _LARGE_INTEGER::@2299 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;
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}
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5700
#define debugstr_w
Definition: kernel32.h:32
const char * uri
Definition: sec_mgr.c:1588
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ 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;
476 IUnknown *protocol_unk = NULL;
477 LPOLESTR clsid_str;
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) {
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 if(SUCCEEDED(hres)) {
513 hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
514 if(SUCCEEDED(hres))
515 This->protocol_unk = protocol_unk;
516 else
517 IUnknown_Release(protocol_unk);
518 }
519 else if(hres == CLASS_E_NOAGGREGATION)
520 hres = IClassFactory_CreateInstance(cf, NULL, &IID_IInternetProtocol, (void**)&protocol);
521
522 IClassFactory_Release(cf);
523 if(FAILED(hres))
524 return hres;
525 }
526
527 StringFromCLSID(&clsid, &clsid_str);
528 IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_PROTOCOLCLASSID, clsid_str);
529 CoTaskMemFree(clsid_str);
530
531 This->protocol_unk = protocol_unk;
532 This->protocol = protocol;
533
534 if(!protocol_unk)
535 protocol_unk = (IUnknown*)protocol;
536
537 set_binding_sink(This, pOIProtSink, pOIBindInfo);
538
539 hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetPriority, (void**)&priority);
540 if(SUCCEEDED(hres)) {
541 IInternetPriority_SetPriority(priority, This->priority);
542 IInternetPriority_Release(priority);
543 }
544
545 hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocolEx, (void**)&protocolex);
546 if(SUCCEEDED(hres)) {
547 hres = IInternetProtocolEx_StartEx(protocolex, pUri, &This->IInternetProtocolSink_iface,
548 &This->IInternetBindInfo_iface, 0, NULL);
549 IInternetProtocolEx_Release(protocolex);
550 }else {
551 hres = IUri_GetDisplayUri(pUri, &This->display_uri);
552 if(FAILED(hres))
553 return hres;
554
555 hres = IInternetProtocol_Start(protocol, This->display_uri, &This->IInternetProtocolSink_iface,
556 &This->IInternetBindInfo_iface, 0, 0);
557 }
558
559 if(SUCCEEDED(hres))
561 return hres;
562}
static void process_tasks(BindProtocol *This)
Definition: bindprot.c:37
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret)
Definition: session.c:220
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static LPOLESTR
Definition: stg_prop.c:27
static int priority
Definition: timer.c:163
REFCLSID clsid
Definition: msctf.c:82
#define IID_NULL
Definition: guiddef.h:98
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ 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}

◆ 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}

◆ 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}

◆ BPInternetProtocolSink_AddRef()

static ULONG WINAPI BPInternetProtocolSink_AddRef ( IInternetProtocolSink iface)
static

Definition at line 1193 of file bindprot.c.

1194{
1196 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1197}
static BindProtocol * impl_from_IInternetProtocolSink(IInternetProtocolSink *iface)
Definition: bindprot.c:1181

◆ BPInternetProtocolSink_QueryInterface()

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

Definition at line 1186 of file bindprot.c.

1188{
1190 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1191}

◆ BPInternetProtocolSink_Release()

static ULONG WINAPI BPInternetProtocolSink_Release ( IInternetProtocolSink iface)
static

Definition at line 1199 of file bindprot.c.

1200{
1202 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1203}

◆ BPInternetProtocolSink_ReportData()

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

Definition at line 1312 of file bindprot.c.

1314{
1316
1317 TRACE("(%p)->(%x %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax);
1318
1319 if(!This->protocol_sink)
1320 return S_OK;
1321
1322 if(!do_direct_notif(This)) {
1323 report_data_task_t *task;
1324
1325 task = heap_alloc(sizeof(report_data_task_t));
1326 if(!task)
1327 return E_OUTOFMEMORY;
1328
1329 task->bscf = grfBSCF;
1330 task->progress = ulProgress;
1331 task->progress_max = ulProgressMax;
1332
1334 return S_OK;
1335 }
1336
1337 return IInternetProtocolSink_ReportData(This->protocol_sink_handler,
1338 grfBSCF, ulProgress, ulProgressMax);
1339}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
Definition: bindprot.c:159
static void report_data_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1302
static BOOL do_direct_notif(BindProtocol *This)
Definition: bindprot.c:189
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
task_header_t header
Definition: bindprot.c:1296

◆ BPInternetProtocolSink_ReportProgress()

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

Definition at line 1272 of file bindprot.c.

1274{
1276
1277 TRACE("(%p)->(%u %s)\n", This, ulStatusCode, debugstr_w(szStatusText));
1278
1279 if(do_direct_notif(This)) {
1280 IInternetProtocolSink_ReportProgress(This->protocol_sink_handler, ulStatusCode, szStatusText);
1281 }else {
1282 on_progress_task_t *task;
1283
1284 task = heap_alloc(sizeof(on_progress_task_t));
1285
1286 task->status_code = ulStatusCode;
1287 task->status_text = heap_strdupW(szStatusText);
1288
1290 }
1291
1292 return S_OK;
1293}
static void on_progress_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1262
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: edit.c:4312
task_header_t header
Definition: bindprot.c:1256

◆ BPInternetProtocolSink_ReportResult()

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

Definition at line 1359 of file bindprot.c.

1361{
1363
1364 TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
1365
1366 if(!This->protocol_sink)
1367 return E_FAIL;
1368 This->reported_result = TRUE;
1369
1370 if(!do_direct_notif(This)) {
1372
1373 task = heap_alloc(sizeof(report_result_task_t));
1374 if(!task)
1375 return E_OUTOFMEMORY;
1376
1377 task->hres = hrResult;
1378 task->err = dwError;
1379 task->str = heap_strdupW(szResult);
1380
1382 return S_OK;
1383 }
1384
1385 return IInternetProtocolSink_ReportResult(This->protocol_sink_handler, hrResult, dwError, szResult);
1386}
static void report_result_proc(BindProtocol *This, task_header_t *t)
Definition: bindprot.c:1349
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
task_header_t header
Definition: bindprot.c:1342

◆ BPInternetProtocolSink_Switch()

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

Definition at line 1219 of file bindprot.c.

1221{
1223 PROTOCOLDATA *data;
1224
1225 TRACE("(%p)->(%p)\n", This, pProtocolData);
1226
1227 TRACE("flags %x state %x data %p cb %u\n", pProtocolData->grfFlags, pProtocolData->dwState,
1228 pProtocolData->pData, pProtocolData->cbData);
1229
1230 data = heap_alloc(sizeof(PROTOCOLDATA));
1231 if(!data)
1232 return E_OUTOFMEMORY;
1233 memcpy(data, pProtocolData, sizeof(PROTOCOLDATA));
1234
1235 if((This->pi&PI_APARTMENTTHREADED && pProtocolData->grfFlags&PI_FORCE_ASYNC)
1236 || !do_direct_notif(This)) {
1237 switch_task_t *task;
1238
1239 task = heap_alloc(sizeof(switch_task_t));
1240 if(!task)
1241 {
1242 heap_free(data);
1243 return E_OUTOFMEMORY;
1244 }
1245
1246 task->data = data;
1247
1248 push_task(This, &task->header, switch_proc);
1249 return S_OK;
1250 }
1251
1252 return IInternetProtocolSink_Switch(This->protocol_sink_handler, data);
1253}
static void switch_proc(BindProtocol *bind, task_header_t *t)
Definition: bindprot.c:1210
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
task_header_t header
Definition: bindprot.c:1206
PROTOCOLDATA * data
Definition: bindprot.c:1207

◆ BPServiceProvider_AddRef()

static ULONG WINAPI BPServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 1410 of file bindprot.c.

1411{
1413 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1414}
static BindProtocol * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: bindprot.c:1398

◆ BPServiceProvider_QueryInterface()

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

Definition at line 1403 of file bindprot.c.

1405{
1407 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1408}

◆ BPServiceProvider_QueryService()

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

Definition at line 1422 of file bindprot.c.

1424{
1426
1427 TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
1428
1429 if(!This->service_provider)
1430 return E_NOINTERFACE;
1431
1432 return IServiceProvider_QueryService(This->service_provider, guidService, riid, ppv);
1433}

◆ BPServiceProvider_Release()

static ULONG WINAPI BPServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 1416 of file bindprot.c.

1417{
1419 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1420}

◆ create_binding_protocol()

HRESULT create_binding_protocol ( BindProtocol **  protocol)

Definition at line 1442 of file bindprot.c.

1443{
1444 BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
1445
1446 ret->IInternetProtocolEx_iface.lpVtbl = &BindProtocolVtbl;
1447 ret->IInternetBindInfo_iface.lpVtbl = &InternetBindInfoVtbl;
1448 ret->IInternetPriority_iface.lpVtbl = &InternetPriorityVtbl;
1449 ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
1450 ret->IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkVtbl;
1451
1452 ret->default_protocol_handler.IInternetProtocol_iface.lpVtbl = &InternetProtocolHandlerVtbl;
1453 ret->default_protocol_handler.IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkHandlerVtbl;
1454
1455 ret->ref = 1;
1456 ret->apartment_thread = GetCurrentThreadId();
1457 ret->notif_hwnd = get_notif_hwnd();
1458 ret->protocol_handler = &ret->default_protocol_handler.IInternetProtocol_iface;
1459 ret->protocol_sink_handler = &ret->default_protocol_handler.IInternetProtocolSink_iface;
1460 InitializeCriticalSection(&ret->section);
1461 ret->section.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BindProtocol.section");
1462
1464
1465 *protocol = ret;
1466 return S_OK;
1467}
static const IInternetProtocolVtbl InternetProtocolHandlerVtbl
Definition: bindprot.c:825
static const IInternetBindInfoVtbl InternetBindInfoVtbl
Definition: bindprot.c:1120
static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl
Definition: bindprot.c:1388
static const IInternetProtocolExVtbl BindProtocolVtbl
Definition: bindprot.c:588
HWND get_notif_hwnd(void)
Definition: bindprot.c:111
static const IInternetPriorityVtbl InternetPriorityVtbl
Definition: bindprot.c:1172
static const IServiceProviderVtbl ServiceProviderVtbl
Definition: bindprot.c:1435
static const IInternetProtocolSinkVtbl InternetProtocolSinkHandlerVtbl
Definition: bindprot.c:1047
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
static void URLMON_LockModule(void)
Definition: urlmon_main.h:68
int ret
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

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 BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void **context)
Definition: bindprot.c:92
static ATOM notif_wnd_class
Definition: bindprot.c:90
static const WCHAR wszURLMonikerNotificationWindow[]
Definition: bindprot.c:86
BOOL WINAPI InitOnceExecuteOnce(_Inout_ PINIT_ONCE InitOnce, _In_ __callback PINIT_ONCE_FN InitFn, _Inout_opt_ PVOID Parameter, _Outptr_opt_result_maybenull_ LPVOID *Context)
Definition: InitOnce.c:12
HWND notif_hwnd
Definition: urlmon_main.h:226
DWORD notif_hwnd_cnt
Definition: urlmon_main.h:227
tls_data_t * get_tls_data(void)
Definition: urlmon_main.c:62
RTL_RUN_ONCE INIT_ONCE
Definition: winbase.h:3931
#define INIT_ONCE_STATIC_INIT
Definition: winbase.h:612
#define HWND_MESSAGE
Definition: winuser.h:1213
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)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

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 };
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}
unsigned long HANDLE_PTR
Definition: basetsd.h:78
IInternetProtocol * pProtocol
Definition: urlmon.idl:1697
struct _tagPROTOCOLFILTERDATA PROTOCOLFILTERDATA

Referenced by mime_available().

◆ handle_redirect()

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

Definition at line 1005 of file bindprot.c.

1006{
1007 HRESULT hres;
1008
1009 if(This->redirect_callback) {
1010 VARIANT_BOOL cancel = VARIANT_FALSE;
1011 IBindCallbackRedirect_Redirect(This->redirect_callback, url, &cancel);
1012 if(cancel)
1013 return INET_E_REDIRECT_FAILED;
1014 }
1015
1016 if(This->protocol_sink) {
1017 hres = IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_REDIRECTING, url);
1018 if(FAILED(hres))
1019 return hres;
1020 }
1021
1022 IInternetProtocol_Terminate(This->protocol, 0); /* should this be done in StartEx? */
1024
1025 return IInternetProtocolEx_Start(&This->IInternetProtocolEx_iface, url, This->protocol_sink, This->bind_info, This->pi, 0);
1026}
short VARIANT_BOOL
Definition: compat.h:2290
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 1057 of file bindprot.c.

1058{
1059 return CONTAINING_RECORD(iface, BindProtocol, IInternetBindInfo_iface);
1060}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by BindInfo_AddRef(), BindInfo_GetBindInfo(), BindInfo_GetBindString(), BindInfo_QueryInterface(), and BindInfo_Release().

◆ impl_from_IInternetPriority()

static BindProtocol * impl_from_IInternetPriority ( IInternetPriority iface)
inlinestatic

◆ impl_from_IInternetProtocol()

◆ impl_from_IInternetProtocolEx()

◆ impl_from_IInternetProtocolSink()

◆ impl_from_IInternetProtocolSinkHandler()

static BindProtocol * impl_from_IInternetProtocolSinkHandler ( IInternetProtocolSink iface)
inlinestatic

◆ impl_from_IServiceProvider()

static BindProtocol * impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 1398 of file bindprot.c.

1399{
1400 return CONTAINING_RECORD(iface, BindProtocol, IServiceProvider_iface);
1401}

Referenced by BPServiceProvider_AddRef(), BPServiceProvider_QueryInterface(), BPServiceProvider_QueryService(), and BPServiceProvider_Release().

◆ InternetPriority_AddRef()

static ULONG WINAPI InternetPriority_AddRef ( IInternetPriority iface)
static

Definition at line 1140 of file bindprot.c.

1141{
1143 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
1144}
static BindProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: bindprot.c:1128

◆ InternetPriority_GetPriority()

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

Definition at line 1162 of file bindprot.c.

1163{
1165
1166 TRACE("(%p)->(%p)\n", This, pnPriority);
1167
1168 *pnPriority = This->priority;
1169 return S_OK;
1170}

◆ InternetPriority_QueryInterface()

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

Definition at line 1133 of file bindprot.c.

1135{
1137 return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
1138}

◆ InternetPriority_Release()

static ULONG WINAPI InternetPriority_Release ( IInternetPriority iface)
static

Definition at line 1146 of file bindprot.c.

1147{
1149 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
1150}

◆ InternetPriority_SetPriority()

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

Definition at line 1152 of file bindprot.c.

1153{
1155
1156 TRACE("(%p)->(%d)\n", This, nPriority);
1157
1158 This->priority = nPriority;
1159 return S_OK;
1160}

◆ 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}

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{
230
231 heap_free(This->mime);
232 This->mime = heap_strdupW(mime);
233
234 if(This->protocol_handler==&This->default_protocol_handler.IInternetProtocol_iface
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}
static HRESULT handle_mime_filter(BindProtocol *This, IInternetProtocol *mime_filter)
Definition: bindprot.c:194
IInternetProtocol * get_mime_filter(LPCWSTR mime)
Definition: session.c:250
const WCHAR * mime
Definition: mimefilter.c:512

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
84}
#define msg(x)
Definition: auth_time.c:54
#define WM_MK_CONTINUE
Definition: bindprot.c:34
#define WM_MK_RELEASE
Definition: bindprot.c:35
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by register_notif_wnd_class().

◆ on_progress_proc()

static void on_progress_proc ( BindProtocol This,
task_header_t t 
)
static

Definition at line 1262 of file bindprot.c.

1263{
1265
1266 IInternetProtocolSink_ReportProgress(This->protocol_sink_handler, task->status_code, task->status_text);
1267
1268 heap_free(task->status_text);
1269 heap_free(task);
1270}
GLdouble GLdouble t
Definition: gl.h:2047

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}
async_task_proc_t proc
Definition: internet.h:389
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(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 683 of file bindprot.c.

685{
687
688 TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
689
690 if(This->protocol && !This->reported_result)
691 return IInternetProtocol_Abort(This->protocol, hrReason, dwOptions);
692
693 return S_OK;
694}
static BindProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
Definition: bindprot.c:605

◆ ProtocolHandler_AddRef()

static ULONG WINAPI ProtocolHandler_AddRef ( IInternetProtocol iface)
static

Definition at line 638 of file bindprot.c.

639{
641 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
642}

◆ ProtocolHandler_Continue()

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

Definition at line 658 of file bindprot.c.

659{
663
664 TRACE("(%p)->(%p)\n", This, pProtocolData);
665
666 /* FIXME: This should not be needed. */
667 if(!This->protocol) {
668 if(!This->protocol_unk)
669 return E_FAIL;
670 hres = IUnknown_QueryInterface(This->protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
671 if(FAILED(hres))
672 return E_FAIL;
673 }
674
675 hres = IInternetProtocol_Continue(protocol ? protocol : This->protocol, pProtocolData);
676
677 heap_free(pProtocolData);
678 if(protocol)
679 IInternetProtocol_Release(protocol);
680 return hres;
681}

◆ ProtocolHandler_LockRequest()

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

Definition at line 807 of file bindprot.c.

808{
810
811 TRACE("(%p)->(%08x)\n", This, dwOptions);
812
813 return IInternetProtocol_LockRequest(This->protocol, dwOptions);
814}

◆ ProtocolHandler_QueryInterface()

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

Definition at line 610 of file bindprot.c.

611{
613
614 *ppv = NULL;
616 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
617 *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
618 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
619 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
620 *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
621 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
622 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
623 *ppv = &This->default_protocol_handler.IInternetProtocol_iface;
624 }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
625 TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv);
626 *ppv = &This->default_protocol_handler.IInternetProtocolSink_iface;
627 }
628
629 if(*ppv) {
630 IInternetProtocol_AddRef(iface);
631 return S_OK;
632 }
633
634 WARN("not supported interface %s\n", debugstr_guid(riid));
635 return E_NOINTERFACE;
636}

◆ ProtocolHandler_Read()

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

Definition at line 747 of file bindprot.c.

749{
751 ULONG read = 0;
752 HRESULT hres = S_OK;
753
754 TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
755
756 if(This->buf_size) {
757 read = min(cb, This->buf_size);
758 memcpy(pv, This->buf, read);
759
760 if(read == This->buf_size) {
761 heap_free(This->buf);
762 This->buf = NULL;
763 }else {
764 memmove(This->buf, This->buf+cb, This->buf_size-cb);
765 }
766
767 This->buf_size -= read;
768 }
769
770 if(read < cb) {
772 ULONG cread = 0;
773
774 /* FIXME: We shouldn't need it, but out binding code currently depends on it. */
775 if(!This->protocol && This->protocol_unk) {
776 hres = IUnknown_QueryInterface(This->protocol_unk, &IID_IInternetProtocol,
777 (void**)&protocol);
778 if(FAILED(hres))
779 return E_ABORT;
780 }else {
781 protocol = This->protocol;
782 }
783
785 This->continue_call++;
786 hres = IInternetProtocol_Read(protocol, (BYTE*)pv+read, cb-read, &cread);
788 This->continue_call--;
789 read += cread;
790
791 if(!This->protocol)
792 IInternetProtocol_Release(protocol);
793 }
794
795 *pcbRead = read;
796 return hres;
797}
#define read
Definition: acwin.h:96
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define min(a, b)
Definition: monoChain.cc:55
uint32_t ULONG
Definition: typedefs.h:59
#define E_ABORT
Definition: winerror.h:2366
unsigned char BYTE
Definition: xxhash.c:193

◆ ProtocolHandler_Release()

static ULONG WINAPI ProtocolHandler_Release ( IInternetProtocol iface)
static

Definition at line 644 of file bindprot.c.

645{
647 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
648}

◆ ProtocolHandler_Resume()

static HRESULT WINAPI ProtocolHandler_Resume ( IInternetProtocol iface)
static

Definition at line 740 of file bindprot.c.

741{
743 FIXME("(%p)\n", This);
744 return E_NOTIMPL;
745}

◆ ProtocolHandler_Seek()

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

Definition at line 799 of file bindprot.c.

801{
803 FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
804 return E_NOTIMPL;
805}

◆ ProtocolHandler_Start()

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

Definition at line 650 of file bindprot.c.

653{
654 ERR("Should not be called\n");
655 return E_NOTIMPL;
656}
#define ERR(fmt,...)
Definition: precomp.h:57

◆ ProtocolHandler_Suspend()

static HRESULT WINAPI ProtocolHandler_Suspend ( IInternetProtocol iface)
static

Definition at line 733 of file bindprot.c.

734{
736 FIXME("(%p)\n", This);
737 return E_NOTIMPL;
738}

◆ ProtocolHandler_Terminate()

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

Definition at line 696 of file bindprot.c.

697{
699
700 TRACE("(%p)->(%08x)\n", This, dwOptions);
701
702 if(!This->reported_result)
703 return E_FAIL;
704
705 /* This may get released in Terminate call. */
706 IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
707
708 if(This->protocol) {
709 IInternetProtocol_Terminate(This->protocol, 0);
710
711 if (This->protocol_unk) {
712 IInternetProtocol_Release(This->protocol);
713 This->protocol = NULL;
714 }
715 }
716
718
719 if(This->bind_info) {
720 IInternetBindInfo_Release(This->bind_info);
721 This->bind_info = NULL;
722 }
723
724 if(This->redirect_callback) {
725 IBindCallbackRedirect_Release(This->redirect_callback);
726 This->redirect_callback = NULL;
727 }
728
729 IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
730 return S_OK;
731}

◆ ProtocolHandler_UnlockRequest()

static HRESULT WINAPI ProtocolHandler_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 816 of file bindprot.c.

817{
819
820 TRACE("(%p)\n", This);
821
822 return IInternetProtocol_UnlockRequest(This->protocol);
823}

◆ ProtocolSinkHandler_AddRef()

static ULONG WINAPI ProtocolSinkHandler_AddRef ( IInternetProtocolSink iface)
static

Definition at line 854 of file bindprot.c.

855{
857 return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
858}
static BindProtocol * impl_from_IInternetProtocolSinkHandler(IInternetProtocolSink *iface)
Definition: bindprot.c:841

◆ ProtocolSinkHandler_QueryInterface()

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

Definition at line 846 of file bindprot.c.

848{
850 return IInternetProtocol_QueryInterface(&This->default_protocol_handler.IInternetProtocol_iface,
851 riid, ppvObject);
852}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ ProtocolSinkHandler_Release()

static ULONG WINAPI ProtocolSinkHandler_Release ( IInternetProtocolSink iface)
static

Definition at line 860 of file bindprot.c.

861{
863 return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
864}

◆ ProtocolSinkHandler_ReportData()

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

Definition at line 922 of file bindprot.c.

924{
926
927 TRACE("(%p)->(%x %u %u)\n", This, bscf, progress, progress_max);
928
929 This->bscf = bscf;
930 This->progress = progress;
931 This->progress_max = progress_max;
932
933 if(!This->protocol_sink)
934 return S_OK;
935
936 if((This->pi & PI_MIMEVERIFICATION) && !This->reported_mime) {
938 DWORD read = 0;
939 LPWSTR mime;
941
942 do {
943 read = 0;
945 This->continue_call++;
946 hres = IInternetProtocol_Read(This->protocol, buf,
947 sizeof(buf)-This->buf_size, &read);
949 This->continue_call--;
950 if(FAILED(hres) && hres != E_PENDING)
951 return hres;
952
953 if(!This->buf) {
955 if(!This->buf)
956 return E_OUTOFMEMORY;
957 }else if(read + This->buf_size > BUFFER_SIZE) {
958 BYTE *tmp;
959
960 tmp = heap_realloc(This->buf, read+This->buf_size);
961 if(!tmp)
962 return E_OUTOFMEMORY;
963 This->buf = tmp;
964 }
965
966 memcpy(This->buf+This->buf_size, buf, read);
967 This->buf_size += read;
968 }while(This->buf_size < MIME_TEST_SIZE && hres == S_OK);
969
970 if(This->buf_size < MIME_TEST_SIZE && hres != S_FALSE)
971 return S_OK;
972
973 bscf = BSCF_FIRSTDATANOTIFICATION;
974 if(hres == S_FALSE)
975 bscf |= BSCF_LASTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE;
976
977 if(!This->reported_mime) {
978 BSTR raw_uri;
979
980 hres = IUri_GetRawUri(This->uri, &raw_uri);
981 if(FAILED(hres))
982 return hres;
983
984 hres = FindMimeFromData(NULL, raw_uri, This->buf, min(This->buf_size, MIME_TEST_SIZE),
985 This->mime, 0, &mime, 0);
986 SysFreeString(raw_uri);
987 if(FAILED(hres))
988 return hres;
989
990 heap_free(This->mime);
991 This->mime = heap_strdupW(mime);
993 This->reported_mime = TRUE;
994 if(This->protocol_sink)
995 IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_MIMETYPEAVAILABLE, This->mime);
996 }
997 }
998
999 if(!This->protocol_sink)
1000 return S_OK;
1001
1002 return IInternetProtocolSink_ReportData(This->protocol_sink, bscf, progress, progress_max);
1003}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define MIME_TEST_SIZE
Definition: bindprot.c:32
#define BUFFER_SIZE
Definition: bindprot.c:31
cd_progress_ptr progress
Definition: cdjpeg.h:152
#define E_PENDING
Definition: dinput.h:172
OLECHAR * BSTR
Definition: compat.h:2293
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer, DWORD cbSize, LPCWSTR pwzMimeProposed, DWORD dwMimeFlags, LPWSTR *ppwzMimeOut, DWORD dwReserved)
Definition: mimefilter.c:680
#define S_FALSE
Definition: winerror.h:2357
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ ProtocolSinkHandler_ReportProgress()

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

Definition at line 881 of file bindprot.c.

883{
885
886 TRACE("(%p)->(%s %s)\n", This, debugstr_bindstatus(status_code), debugstr_w(status_text));
887
888 if(!This->protocol_sink)
889 return S_OK;
890
891 switch(status_code) {
892 case BINDSTATUS_FINDINGRESOURCE:
893 case BINDSTATUS_CONNECTING:
894 case BINDSTATUS_REDIRECTING:
895 case BINDSTATUS_SENDINGREQUEST:
896 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
897 case BINDSTATUS_DIRECTBIND:
898 case BINDSTATUS_ACCEPTRANGES:
899 case BINDSTATUS_DECODING:
900 IInternetProtocolSink_ReportProgress(This->protocol_sink, status_code, status_text);
901 break;
902
903 case BINDSTATUS_BEGINDOWNLOADDATA:
904 IInternetProtocolSink_ReportData(This->protocol_sink, This->bscf, This->progress, This->progress_max);
905 break;
906
907 case BINDSTATUS_MIMETYPEAVAILABLE:
908 mime_available(This, status_text, FALSE);
909 break;
910
911 case BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE:
912 mime_available(This, status_text, TRUE);
913 break;
914
915 default:
916 FIXME("unsupported ulStatusCode %u\n", status_code);
917 }
918
919 return S_OK;
920}
static void mime_available(BindProtocol *This, LPCWSTR mime, BOOL verified)
Definition: bindprot.c:226
#define FALSE
Definition: types.h:117
const char * debugstr_bindstatus(ULONG status)
Definition: urlmon_main.c:175

◆ ProtocolSinkHandler_ReportResult()

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

Definition at line 1028 of file bindprot.c.

1030{
1032
1033 TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
1034
1035 if(hrResult == INET_E_REDIRECT_FAILED) {
1036 hrResult = handle_redirect(This, szResult);
1037 if(hrResult == S_OK)
1038 return S_OK;
1039 szResult = NULL;
1040 }
1041
1042 if(This->protocol_sink)
1043 return IInternetProtocolSink_ReportResult(This->protocol_sink, hrResult, dwError, szResult);
1044 return S_OK;
1045}
static HRESULT handle_redirect(BindProtocol *This, const WCHAR *url)
Definition: bindprot.c:1005

◆ ProtocolSinkHandler_Switch()

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

Definition at line 866 of file bindprot.c.

868{
870
871 TRACE("(%p)->(%p)\n", This, pProtocolData);
872
873 if(!This->protocol_sink) {
874 IInternetProtocol_Continue(This->protocol_handler, pProtocolData);
875 return S_OK;
876 }
877
878 return IInternetProtocolSink_Switch(This->protocol_sink, pProtocolData);
879}

◆ 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}
unsigned int BOOL
Definition: ntddk_ex.h:94
static HANDLE proc()
Definition: pdb.c:34
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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,
98 };
99
100 wndclass.hInstance = hProxyDll;
102 return TRUE;
103}
static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: bindprot.c:62
HINSTANCE hInstance
Definition: winuser.h:3224
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)

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}

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}

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 1302 of file bindprot.c.

1303{
1305
1306 IInternetProtocolSink_ReportData(This->protocol_sink_handler,
1307 task->bscf, task->progress, task->progress_max);
1308
1309 heap_free(task);
1310}

Referenced by BPInternetProtocolSink_ReportData().

◆ report_result_proc()

static void report_result_proc ( BindProtocol This,
task_header_t t 
)
static

Definition at line 1349 of file bindprot.c.

1350{
1352
1353 IInternetProtocolSink_ReportResult(This->protocol_sink_handler, task->hres, task->err, task->str);
1354
1355 heap_free(task->str);
1356 heap_free(task);
1357}

Referenced by BPInternetProtocolSink_ReportResult().

◆ set_binding_sink()

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

Definition at line 564 of file bindprot.c.

565{
566 IInternetProtocolSink *prev_sink;
568
569 if(sink)
570 IInternetProtocolSink_AddRef(sink);
571 prev_sink = InterlockedExchangePointer((void**)&This->protocol_sink, sink);
572 if(prev_sink)
573 IInternetProtocolSink_Release(prev_sink);
574
575 if(sink)
576 IInternetProtocolSink_QueryInterface(sink, &IID_IServiceProvider, (void**)&service_provider);
579 IServiceProvider_Release(service_provider);
580
581 if(bind_info)
582 IInternetBindInfo_AddRef(bind_info);
583 bind_info = InterlockedExchangePointer((void**)&This->bind_info, bind_info);
584 if(bind_info)
585 IInternetBindInfo_Release(bind_info);
586}
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
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 1210 of file bindprot.c.

1211{
1212 switch_task_t *task = (switch_task_t*)t;
1213
1214 IInternetProtocol_Continue(bind->protocol_handler, task->data);
1215
1216 heap_free(task);
1217}
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36

Referenced by BPInternetProtocolSink_Switch().

◆ unregister_notif_wnd_class()

void unregister_notif_wnd_class ( void  )

Definition at line 105 of file bindprot.c.

106{
109}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

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_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: bindprot.c:448
static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: bindprot.c:364
static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:386
static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: bindprot.c:428
static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: bindprot.c:405
static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface)
Definition: bindprot.c:421
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_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: bindprot.c:395
static HRESULT WINAPI BindProtocol_Suspend(IInternetProtocolEx *iface)
Definition: bindprot.c:414
static HRESULT WINAPI BindProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: bindprot.c:440
static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: bindprot.c:457
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 ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface)
Definition: bindprot.c:302

Definition at line 588 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetBindInfoVtbl

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

Definition at line 1120 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:1133
static HRESULT WINAPI InternetPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: bindprot.c:1152
static HRESULT WINAPI InternetPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: bindprot.c:1162
static ULONG WINAPI InternetPriority_Release(IInternetPriority *iface)
Definition: bindprot.c:1146
static ULONG WINAPI InternetPriority_AddRef(IInternetPriority *iface)
Definition: bindprot.c:1140

Definition at line 1172 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolHandlerVtbl

const IInternetProtocolVtbl InternetProtocolHandlerVtbl
static
Initial value:
= {
}
static ULONG WINAPI ProtocolHandler_AddRef(IInternetProtocol *iface)
Definition: bindprot.c:638
static ULONG WINAPI ProtocolHandler_Release(IInternetProtocol *iface)
Definition: bindprot.c:644
static HRESULT WINAPI ProtocolHandler_UnlockRequest(IInternetProtocol *iface)
Definition: bindprot.c:816
static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: bindprot.c:650
static HRESULT WINAPI ProtocolHandler_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
Definition: bindprot.c:683
static HRESULT WINAPI ProtocolHandler_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
Definition: bindprot.c:807
static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD dwOptions)
Definition: bindprot.c:696
static HRESULT WINAPI ProtocolHandler_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
Definition: bindprot.c:610
static HRESULT WINAPI ProtocolHandler_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: bindprot.c:799
static HRESULT WINAPI ProtocolHandler_Suspend(IInternetProtocol *iface)
Definition: bindprot.c:733
static HRESULT WINAPI ProtocolHandler_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:658
static HRESULT WINAPI ProtocolHandler_Resume(IInternetProtocol *iface)
Definition: bindprot.c:740
static HRESULT WINAPI ProtocolHandler_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: bindprot.c:747

Definition at line 825 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolSinkHandlerVtbl

const IInternetProtocolSinkVtbl InternetProtocolSinkHandlerVtbl
static
Initial value:
= {
}
static ULONG WINAPI ProtocolSinkHandler_AddRef(IInternetProtocolSink *iface)
Definition: bindprot.c:854
static HRESULT WINAPI ProtocolSinkHandler_ReportData(IInternetProtocolSink *iface, DWORD bscf, ULONG progress, ULONG progress_max)
Definition: bindprot.c:922
static HRESULT WINAPI ProtocolSinkHandler_ReportProgress(IInternetProtocolSink *iface, ULONG status_code, LPCWSTR status_text)
Definition: bindprot.c:881
static HRESULT WINAPI ProtocolSinkHandler_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:866
static ULONG WINAPI ProtocolSinkHandler_Release(IInternetProtocolSink *iface)
Definition: bindprot.c:860
static HRESULT WINAPI ProtocolSinkHandler_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppvObject)
Definition: bindprot.c:846
static HRESULT WINAPI ProtocolSinkHandler_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
Definition: bindprot.c:1028

Definition at line 1047 of file bindprot.c.

Referenced by create_binding_protocol().

◆ InternetProtocolSinkVtbl

const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl
static
Initial value:
= {
}
static HRESULT WINAPI BPInternetProtocolSink_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1186
static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink *iface, HRESULT hrResult, DWORD dwError, LPCWSTR szResult)
Definition: bindprot.c:1359
static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface, PROTOCOLDATA *pProtocolData)
Definition: bindprot.c:1219
static ULONG WINAPI BPInternetProtocolSink_Release(IInternetProtocolSink *iface)
Definition: bindprot.c:1199
static HRESULT WINAPI BPInternetProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: bindprot.c:1272
static ULONG WINAPI BPInternetProtocolSink_AddRef(IInternetProtocolSink *iface)
Definition: bindprot.c:1193
static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *iface, DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax)
Definition: bindprot.c:1312

Definition at line 1388 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_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: bindprot.c:1422
static ULONG WINAPI BPServiceProvider_AddRef(IServiceProvider *iface)
Definition: bindprot.c:1410
static HRESULT WINAPI BPServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: bindprot.c:1403
static ULONG WINAPI BPServiceProvider_Release(IServiceProvider *iface)
Definition: bindprot.c:1416

Definition at line 1435 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().