Commit c41cf7d6 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

urlmon: COM cleanup for the IInternetProtocolEx iface.

parent 4f574ee9
...@@ -200,7 +200,7 @@ static void mime_available(Binding *This, LPCWSTR mime) ...@@ -200,7 +200,7 @@ static void mime_available(Binding *This, LPCWSTR mime)
static void stop_binding(Binding *binding, HRESULT hres, LPCWSTR str) static void stop_binding(Binding *binding, HRESULT hres, LPCWSTR str)
{ {
if(binding->state & BINDING_LOCKED) { if(binding->state & BINDING_LOCKED) {
IInternetProtocolEx_UnlockRequest(PROTOCOLEX(binding->protocol)); IInternetProtocolEx_UnlockRequest(&binding->protocol->IInternetProtocolEx_iface);
binding->state &= ~BINDING_LOCKED; binding->state &= ~BINDING_LOCKED;
} }
...@@ -342,7 +342,7 @@ static void create_object(Binding *binding) ...@@ -342,7 +342,7 @@ static void create_object(Binding *binding)
stop_binding(binding, hres, NULL); stop_binding(binding, hres, NULL);
if(FAILED(hres)) if(FAILED(hres))
IInternetProtocolEx_Terminate(PROTOCOLEX(binding->protocol), 0); IInternetProtocolEx_Terminate(&binding->protocol->IInternetProtocolEx_iface, 0);
} }
static void cache_file_available(Binding *This, const WCHAR *file_name) static void cache_file_available(Binding *This, const WCHAR *file_name)
...@@ -862,7 +862,7 @@ static ULONG WINAPI Binding_Release(IBinding *iface) ...@@ -862,7 +862,7 @@ static ULONG WINAPI Binding_Release(IBinding *iface)
if(This->callback) if(This->callback)
IBindStatusCallback_Release(This->callback); IBindStatusCallback_Release(This->callback);
if(This->protocol) if(This->protocol)
IInternetProtocolEx_Release(PROTOCOLEX(This->protocol)); IInternetProtocolEx_Release(&This->protocol->IInternetProtocolEx_iface);
if(This->service_provider) if(This->service_provider)
IServiceProvider_Release(This->service_provider); IServiceProvider_Release(This->service_provider);
if(This->stgmed_buf) if(This->stgmed_buf)
...@@ -898,7 +898,8 @@ static HRESULT WINAPI Binding_Abort(IBinding *iface) ...@@ -898,7 +898,8 @@ static HRESULT WINAPI Binding_Abort(IBinding *iface)
if(This->state & BINDING_ABORTED) if(This->state & BINDING_ABORTED)
return E_FAIL; return E_FAIL;
hres = IInternetProtocolEx_Abort(PROTOCOLEX(This->protocol), E_ABORT, ERROR_SUCCESS); hres = IInternetProtocolEx_Abort(&This->protocol->IInternetProtocolEx_iface, E_ABORT,
ERROR_SUCCESS);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -1115,7 +1116,8 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres ...@@ -1115,7 +1116,8 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
HRESULT hres; HRESULT hres;
if(!(This->state & BINDING_LOCKED)) { if(!(This->state & BINDING_LOCKED)) {
HRESULT hres = IInternetProtocolEx_LockRequest(PROTOCOLEX(This->protocol), 0); HRESULT hres = IInternetProtocolEx_LockRequest(
&This->protocol->IInternetProtocolEx_iface, 0);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
This->state |= BINDING_LOCKED; This->state |= BINDING_LOCKED;
} }
...@@ -1156,7 +1158,7 @@ static HRESULT WINAPI InternetProtocolSink_ReportResult(IInternetProtocolSink *i ...@@ -1156,7 +1158,7 @@ static HRESULT WINAPI InternetProtocolSink_ReportResult(IInternetProtocolSink *i
TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult)); TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
stop_binding(This, hrResult, szResult); stop_binding(This, hrResult, szResult);
IInternetProtocolEx_Terminate(PROTOCOLEX(This->protocol), 0); IInternetProtocolEx_Terminate(&This->protocol->IInternetProtocolEx_iface, 0);
return S_OK; return S_OK;
} }
...@@ -1459,7 +1461,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB ...@@ -1459,7 +1461,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
if(binding_ctx) { if(binding_ctx) {
ret->protocol = binding_ctx->protocol; ret->protocol = binding_ctx->protocol;
IInternetProtocolEx_AddRef(PROTOCOLEX(ret->protocol)); IInternetProtocolEx_AddRef(&ret->protocol->IInternetProtocolEx_iface);
}else { }else {
hres = create_binding_protocol(TRUE, &ret->protocol); hres = create_binding_protocol(TRUE, &ret->protocol);
if(FAILED(hres)) { if(FAILED(hres)) {
...@@ -1501,7 +1503,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB ...@@ -1501,7 +1503,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
IUnknown_AddRef(&ret->stgmed_buf->IUnknown_iface); IUnknown_AddRef(&ret->stgmed_buf->IUnknown_iface);
ret->clipboard_format = binding_ctx->clipboard_format; ret->clipboard_format = binding_ctx->clipboard_format;
}else { }else {
ret->stgmed_buf = create_stgmed_buf(PROTOCOLEX(ret->protocol)); ret->stgmed_buf = create_stgmed_buf(&ret->protocol->IInternetProtocolEx_iface);
} }
if(to_obj) { if(to_obj) {
...@@ -1547,8 +1549,8 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, IUri *uri, IBi ...@@ -1547,8 +1549,8 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, IUri *uri, IBi
report_data(binding, BSCF_FIRSTDATANOTIFICATION | (binding_ctx->download_state == END_DOWNLOAD ? BSCF_LASTDATANOTIFICATION : 0), report_data(binding, BSCF_FIRSTDATANOTIFICATION | (binding_ctx->download_state == END_DOWNLOAD ? BSCF_LASTDATANOTIFICATION : 0),
0, 0); 0, 0);
}else { }else {
hres = IInternetProtocolEx_StartEx(PROTOCOLEX(binding->protocol), uri, PROTSINK(binding), hres = IInternetProtocolEx_StartEx(&binding->protocol->IInternetProtocolEx_iface, uri,
BINDINF(binding), PI_APARTMENTTHREADED|PI_MIMEVERIFICATION, 0); PROTSINK(binding), BINDINF(binding), PI_APARTMENTTHREADED|PI_MIMEVERIFICATION, 0);
TRACE("start ret %08x\n", hres); TRACE("start ret %08x\n", hres);
...@@ -1590,7 +1592,7 @@ HRESULT bind_to_storage(IUri *uri, IBindCtx *pbc, REFIID riid, void **ppv) ...@@ -1590,7 +1592,7 @@ HRESULT bind_to_storage(IUri *uri, IBindCtx *pbc, REFIID riid, void **ppv)
if(binding->hres == S_OK && binding->stgmed_buf->init) { if(binding->hres == S_OK && binding->stgmed_buf->init) {
if((binding->state & BINDING_STOPPED) && (binding->state & BINDING_LOCKED)) if((binding->state & BINDING_STOPPED) && (binding->state & BINDING_LOCKED))
IInternetProtocolEx_UnlockRequest(PROTOCOLEX(binding->protocol)); IInternetProtocolEx_UnlockRequest(&binding->protocol->IInternetProtocolEx_iface);
hres = binding->stgmed_obj->vtbl->get_result(binding->stgmed_obj, binding->bindf, ppv); hres = binding->stgmed_obj->vtbl->get_result(binding->stgmed_obj, binding->bindf, ppv);
}else if(binding->bindf & BINDF_ASYNCHRONOUS) { }else if(binding->bindf & BINDF_ASYNCHRONOUS) {
......
...@@ -68,7 +68,7 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -68,7 +68,7 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
This->continue_call--; This->continue_call--;
} }
IInternetProtocolEx_Release(PROTOCOLEX(This)); IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
return 0; return 0;
} }
case WM_MK_RELEASE: { case WM_MK_RELEASE: {
...@@ -167,7 +167,7 @@ static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc) ...@@ -167,7 +167,7 @@ static void push_task(BindProtocol *This, task_header_t *task, task_proc_t proc)
LeaveCriticalSection(&This->section); LeaveCriticalSection(&This->section);
if(do_post) { if(do_post) {
IInternetProtocolEx_AddRef(PROTOCOLEX(This)); IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
PostMessageW(This->notif_hwnd, WM_MK_CONTINUE, 0, (LPARAM)This); PostMessageW(This->notif_hwnd, WM_MK_CONTINUE, 0, (LPARAM)This);
} }
} }
...@@ -244,25 +244,28 @@ static void mime_available(BindProtocol *This, LPCWSTR mime, BOOL verified) ...@@ -244,25 +244,28 @@ static void mime_available(BindProtocol *This, LPCWSTR mime, BOOL verified)
} }
} }
#define PROTOCOL_THIS(iface) DEFINE_THIS(BindProtocol, IInternetProtocolEx, iface) static inline BindProtocol *impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
{
return CONTAINING_RECORD(iface, BindProtocol, IInternetProtocolEx_iface);
}
static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv) static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
*ppv = NULL; *ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = PROTOCOLEX(This); *ppv = &This->IInternetProtocolEx_iface;
}else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
*ppv = PROTOCOLEX(This); *ppv = &This->IInternetProtocolEx_iface;
}else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
*ppv = PROTOCOLEX(This); *ppv = &This->IInternetProtocolEx_iface;
}else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) { }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv); TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
*ppv = PROTOCOLEX(This); *ppv = &This->IInternetProtocolEx_iface;
}else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) { }else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) {
TRACE("(%p)->(IID_IInternetBindInfo %p)\n", This, ppv); TRACE("(%p)->(IID_IInternetBindInfo %p)\n", This, ppv);
*ppv = BINDINFO(This); *ppv = BINDINFO(This);
...@@ -316,7 +319,7 @@ static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, RE ...@@ -316,7 +319,7 @@ static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, RE
static ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface) static ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
LONG ref = InterlockedIncrement(&This->ref); LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
return ref; return ref;
...@@ -324,7 +327,7 @@ static ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface) ...@@ -324,7 +327,7 @@ static ULONG WINAPI BindProtocol_AddRef(IInternetProtocolEx *iface)
static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface) static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
LONG ref = InterlockedDecrement(&This->ref); LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
...@@ -362,7 +365,7 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU ...@@ -362,7 +365,7 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU
IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
DWORD grfPI, HANDLE_PTR dwReserved) DWORD grfPI, HANDLE_PTR dwReserved)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
IUri *uri; IUri *uri;
HRESULT hres; HRESULT hres;
...@@ -373,8 +376,8 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU ...@@ -373,8 +376,8 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = IInternetProtocolEx_StartEx(PROTOCOLEX(This), uri, pOIProtSink, pOIBindInfo, hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
grfPI, (HANDLE*)dwReserved); pOIBindInfo, grfPI, (HANDLE*)dwReserved);
IUri_Release(uri); IUri_Release(uri);
return hres; return hres;
...@@ -382,7 +385,7 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU ...@@ -382,7 +385,7 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szU
static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData) static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)->(%p)\n", This, pProtocolData); TRACE("(%p)->(%p)\n", This, pProtocolData);
...@@ -392,7 +395,7 @@ static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOL ...@@ -392,7 +395,7 @@ static HRESULT WINAPI BindProtocol_Continue(IInternetProtocolEx *iface, PROTOCOL
static HRESULT WINAPI BindProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, static HRESULT WINAPI BindProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason,
DWORD dwOptions) DWORD dwOptions)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions); TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
...@@ -401,7 +404,7 @@ static HRESULT WINAPI BindProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrR ...@@ -401,7 +404,7 @@ static HRESULT WINAPI BindProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrR
static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions) static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)->(%08x)\n", This, dwOptions); TRACE("(%p)->(%08x)\n", This, dwOptions);
...@@ -410,14 +413,14 @@ static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD d ...@@ -410,14 +413,14 @@ static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocolEx *iface, DWORD d
static HRESULT WINAPI BindProtocol_Suspend(IInternetProtocolEx *iface) static HRESULT WINAPI BindProtocol_Suspend(IInternetProtocolEx *iface)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface) static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -425,7 +428,7 @@ static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface) ...@@ -425,7 +428,7 @@ static HRESULT WINAPI BindProtocol_Resume(IInternetProtocolEx *iface)
static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv, static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv,
ULONG cb, ULONG *pcbRead) ULONG cb, ULONG *pcbRead)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
...@@ -437,14 +440,14 @@ static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv, ...@@ -437,14 +440,14 @@ static HRESULT WINAPI BindProtocol_Read(IInternetProtocolEx *iface, void *pv,
static HRESULT WINAPI BindProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, static HRESULT WINAPI BindProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove,
DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI BindProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions) static HRESULT WINAPI BindProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)->(%08x)\n", This, dwOptions); TRACE("(%p)->(%08x)\n", This, dwOptions);
...@@ -453,7 +456,7 @@ static HRESULT WINAPI BindProtocol_LockRequest(IInternetProtocolEx *iface, DWORD ...@@ -453,7 +456,7 @@ static HRESULT WINAPI BindProtocol_LockRequest(IInternetProtocolEx *iface, DWORD
static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocolEx *iface) static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocolEx *iface)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
...@@ -464,7 +467,7 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -464,7 +467,7 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
DWORD grfPI, HANDLE *dwReserved) DWORD grfPI, HANDLE *dwReserved)
{ {
BindProtocol *This = PROTOCOL_THIS(iface); BindProtocol *This = impl_from_IInternetProtocolEx(iface);
IInternetProtocol *protocol = NULL; IInternetProtocol *protocol = NULL;
IInternetProtocolEx *protocolex; IInternetProtocolEx *protocolex;
IInternetPriority *priority; IInternetPriority *priority;
...@@ -579,8 +582,6 @@ void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternet ...@@ -579,8 +582,6 @@ void set_binding_sink(BindProtocol *This, IInternetProtocolSink *sink, IInternet
IInternetBindInfo_Release(bind_info); IInternetBindInfo_Release(bind_info);
} }
#undef PROTOCOL_THIS
static const IInternetProtocolExVtbl BindProtocolVtbl = { static const IInternetProtocolExVtbl BindProtocolVtbl = {
BindProtocol_QueryInterface, BindProtocol_QueryInterface,
BindProtocol_AddRef, BindProtocol_AddRef,
...@@ -612,13 +613,13 @@ static HRESULT WINAPI ProtocolHandler_QueryInterface(IInternetProtocol *iface, R ...@@ -612,13 +613,13 @@ static HRESULT WINAPI ProtocolHandler_QueryInterface(IInternetProtocol *iface, R
static ULONG WINAPI ProtocolHandler_AddRef(IInternetProtocol *iface) static ULONG WINAPI ProtocolHandler_AddRef(IInternetProtocol *iface)
{ {
BindProtocol *This = impl_from_IInternetProtocol(iface); BindProtocol *This = impl_from_IInternetProtocol(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI ProtocolHandler_Release(IInternetProtocol *iface) static ULONG WINAPI ProtocolHandler_Release(IInternetProtocol *iface)
{ {
BindProtocol *This = impl_from_IInternetProtocol(iface); BindProtocol *This = impl_from_IInternetProtocol(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR szUrl, static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR szUrl,
...@@ -777,19 +778,19 @@ static HRESULT WINAPI BindInfo_QueryInterface(IInternetBindInfo *iface, ...@@ -777,19 +778,19 @@ static HRESULT WINAPI BindInfo_QueryInterface(IInternetBindInfo *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
BindProtocol *This = BINDINFO_THIS(iface); BindProtocol *This = BINDINFO_THIS(iface);
return IInternetProtocolEx_QueryInterface(PROTOCOLEX(This), riid, ppv); return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
} }
static ULONG WINAPI BindInfo_AddRef(IInternetBindInfo *iface) static ULONG WINAPI BindInfo_AddRef(IInternetBindInfo *iface)
{ {
BindProtocol *This = BINDINFO_THIS(iface); BindProtocol *This = BINDINFO_THIS(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI BindInfo_Release(IInternetBindInfo *iface) static ULONG WINAPI BindInfo_Release(IInternetBindInfo *iface)
{ {
BindProtocol *This = BINDINFO_THIS(iface); BindProtocol *This = BINDINFO_THIS(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface,
...@@ -836,19 +837,19 @@ static HRESULT WINAPI InternetPriority_QueryInterface(IInternetPriority *iface, ...@@ -836,19 +837,19 @@ static HRESULT WINAPI InternetPriority_QueryInterface(IInternetPriority *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
BindProtocol *This = PRIORITY_THIS(iface); BindProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocolEx_QueryInterface(PROTOCOLEX(This), riid, ppv); return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
} }
static ULONG WINAPI InternetPriority_AddRef(IInternetPriority *iface) static ULONG WINAPI InternetPriority_AddRef(IInternetPriority *iface)
{ {
BindProtocol *This = PRIORITY_THIS(iface); BindProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI InternetPriority_Release(IInternetPriority *iface) static ULONG WINAPI InternetPriority_Release(IInternetPriority *iface)
{ {
BindProtocol *This = PRIORITY_THIS(iface); BindProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
static HRESULT WINAPI InternetPriority_SetPriority(IInternetPriority *iface, LONG nPriority) static HRESULT WINAPI InternetPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
...@@ -888,19 +889,19 @@ static HRESULT WINAPI BPInternetProtocolSink_QueryInterface(IInternetProtocolSin ...@@ -888,19 +889,19 @@ static HRESULT WINAPI BPInternetProtocolSink_QueryInterface(IInternetProtocolSin
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
BindProtocol *This = PROTSINK_THIS(iface); BindProtocol *This = PROTSINK_THIS(iface);
return IInternetProtocolEx_QueryInterface(PROTOCOLEX(This), riid, ppv); return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
} }
static ULONG WINAPI BPInternetProtocolSink_AddRef(IInternetProtocolSink *iface) static ULONG WINAPI BPInternetProtocolSink_AddRef(IInternetProtocolSink *iface)
{ {
BindProtocol *This = PROTSINK_THIS(iface); BindProtocol *This = PROTSINK_THIS(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI BPInternetProtocolSink_Release(IInternetProtocolSink *iface) static ULONG WINAPI BPInternetProtocolSink_Release(IInternetProtocolSink *iface)
{ {
BindProtocol *This = PROTSINK_THIS(iface); BindProtocol *This = PROTSINK_THIS(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
typedef struct { typedef struct {
...@@ -1197,19 +1198,19 @@ static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl = { ...@@ -1197,19 +1198,19 @@ static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl = {
static HRESULT WINAPI WinInetHttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv) static HRESULT WINAPI WinInetHttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
{ {
BindProtocol *This = INETINFO_THIS(iface); BindProtocol *This = INETINFO_THIS(iface);
return IInternetProtocolEx_QueryInterface(PROTOCOLEX(This), riid, ppv); return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
} }
static ULONG WINAPI WinInetHttpInfo_AddRef(IWinInetHttpInfo *iface) static ULONG WINAPI WinInetHttpInfo_AddRef(IWinInetHttpInfo *iface)
{ {
BindProtocol *This = INETINFO_THIS(iface); BindProtocol *This = INETINFO_THIS(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI WinInetHttpInfo_Release(IWinInetHttpInfo *iface) static ULONG WINAPI WinInetHttpInfo_Release(IWinInetHttpInfo *iface)
{ {
BindProtocol *This = INETINFO_THIS(iface); BindProtocol *This = INETINFO_THIS(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
static HRESULT WINAPI WinInetHttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, static HRESULT WINAPI WinInetHttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption,
...@@ -1244,19 +1245,19 @@ static HRESULT WINAPI BPServiceProvider_QueryInterface(IServiceProvider *iface, ...@@ -1244,19 +1245,19 @@ static HRESULT WINAPI BPServiceProvider_QueryInterface(IServiceProvider *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
BindProtocol *This = SERVPROV_THIS(iface); BindProtocol *This = SERVPROV_THIS(iface);
return IInternetProtocolEx_QueryInterface(PROTOCOLEX(This), riid, ppv); return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
} }
static ULONG WINAPI BPServiceProvider_AddRef(IServiceProvider *iface) static ULONG WINAPI BPServiceProvider_AddRef(IServiceProvider *iface)
{ {
BindProtocol *This = SERVPROV_THIS(iface); BindProtocol *This = SERVPROV_THIS(iface);
return IInternetProtocolEx_AddRef(PROTOCOLEX(This)); return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
} }
static ULONG WINAPI BPServiceProvider_Release(IServiceProvider *iface) static ULONG WINAPI BPServiceProvider_Release(IServiceProvider *iface)
{ {
BindProtocol *This = SERVPROV_THIS(iface); BindProtocol *This = SERVPROV_THIS(iface);
return IInternetProtocolEx_Release(PROTOCOLEX(This)); return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
} }
static HRESULT WINAPI BPServiceProvider_QueryService(IServiceProvider *iface, static HRESULT WINAPI BPServiceProvider_QueryService(IServiceProvider *iface,
...@@ -1285,7 +1286,7 @@ HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol) ...@@ -1285,7 +1286,7 @@ HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol)
{ {
BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol)); BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
ret->lpIInternetProtocolExVtbl = &BindProtocolVtbl; ret->IInternetProtocolEx_iface.lpVtbl = &BindProtocolVtbl;
ret->lpInternetBindInfoVtbl = &InternetBindInfoVtbl; ret->lpInternetBindInfoVtbl = &InternetBindInfoVtbl;
ret->lpInternetPriorityVtbl = &InternetPriorityVtbl; ret->lpInternetPriorityVtbl = &InternetPriorityVtbl;
ret->lpServiceProviderVtbl = &ServiceProviderVtbl; ret->lpServiceProviderVtbl = &ServiceProviderVtbl;
......
...@@ -437,7 +437,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface, ...@@ -437,7 +437,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
*ppOInetProt = (IInternetProtocol*)PROTOCOLEX(protocol); *ppOInetProt = (IInternetProtocol*)&protocol->IInternetProtocolEx_iface;
return S_OK; return S_OK;
} }
......
...@@ -169,7 +169,7 @@ HRESULT create_protocol_proxy(IInternetProtocol*,IInternetProtocolSink*,Protocol ...@@ -169,7 +169,7 @@ HRESULT create_protocol_proxy(IInternetProtocol*,IInternetProtocolSink*,Protocol
typedef struct _task_header_t task_header_t; typedef struct _task_header_t task_header_t;
typedef struct { typedef struct {
const IInternetProtocolExVtbl *lpIInternetProtocolExVtbl; IInternetProtocolEx IInternetProtocolEx_iface;
const IInternetBindInfoVtbl *lpInternetBindInfoVtbl; const IInternetBindInfoVtbl *lpInternetBindInfoVtbl;
const IInternetPriorityVtbl *lpInternetPriorityVtbl; const IInternetPriorityVtbl *lpInternetPriorityVtbl;
const IServiceProviderVtbl *lpServiceProviderVtbl; const IServiceProviderVtbl *lpServiceProviderVtbl;
...@@ -210,8 +210,6 @@ typedef struct { ...@@ -210,8 +210,6 @@ typedef struct {
ProtocolProxy *filter_proxy; ProtocolProxy *filter_proxy;
} BindProtocol; } BindProtocol;
#define PROTOCOLEX(x) ((IInternetProtocolEx*) &(x)->lpIInternetProtocolExVtbl)
HRESULT create_binding_protocol(BOOL,BindProtocol**); HRESULT create_binding_protocol(BOOL,BindProtocol**);
void set_binding_sink(BindProtocol*,IInternetProtocolSink*,IInternetBindInfo*); void set_binding_sink(BindProtocol*,IInternetProtocolSink*,IInternetBindInfo*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment