Commit 8b69bf72 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added Switch implementation.

parent 675fd219
......@@ -78,6 +78,7 @@ struct ProtocolStream {
#define STREAM(x) ((IStream*) &(x)->lpStreamVtbl)
#define WM_MK_ONPROGRESS (WM_USER+100)
#define WM_MK_CONTINUE (WM_USER+101)
typedef struct {
Binding *binding;
......@@ -87,6 +88,11 @@ typedef struct {
LPWSTR status_text;
} on_progress_data;
typedef struct {
Binding *binding;
PROTOCOLDATA *data;
} switch_data;
static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
......@@ -104,6 +110,15 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return 0;
}
case WM_MK_CONTINUE: {
switch_data *data = (switch_data*)lParam;
IInternetProtocol_Continue(data->binding->protocol, data->data);
IBinding_Release(BINDING(data->binding));
HeapFree(GetProcessHeap(), 0, data);
return 0;
}
}
return DefWindowProcW(hwnd, msg, wParam, lParam);
......@@ -631,8 +646,19 @@ static HRESULT WINAPI InternetProtocolSink_Switch(IInternetProtocolSink *iface,
PROTOCOLDATA *pProtocolData)
{
Binding *This = PROTSINK_THIS(iface);
FIXME("(%p)->(%p)\n", This, pProtocolData);
return E_NOTIMPL;
switch_data *data;
TRACE("(%p)->(%p)\n", This, pProtocolData);
data = HeapAlloc(GetProcessHeap(), 0, sizeof(switch_data));
IBinding_AddRef(BINDING(This));
data->binding = This;
data->data = pProtocolData;
PostMessageW(This->notif_hwnd, WM_MK_CONTINUE, 0, (LPARAM)data);
return S_OK;
}
static HRESULT WINAPI InternetProtocolSink_ReportProgress(IInternetProtocolSink *iface,
......
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