urlmon: Added Switch implementation.

oldstable
Jacek Caban 2006-05-25 18:39:26 +02:00 committed by Alexandre Julliard
parent 675fd219ad
commit 8b69bf72da
1 changed files with 28 additions and 2 deletions

View File

@ -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,