Jacek Caban : urlmon: Return E_FAIL in Binding::Switch implementation.
Alexandre Julliard
julliard at winehq.org
Tue May 12 09:08:46 CDT 2009
Module: wine
Branch: master
Commit: 00376b5b72c89fb5cbf2a8e326f97bd5315c561c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=00376b5b72c89fb5cbf2a8e326f97bd5315c561c
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon May 11 22:01:05 2009 +0200
urlmon: Return E_FAIL in Binding::Switch implementation.
---
dlls/urlmon/binding.c | 27 ++-------------------------
dlls/urlmon/tests/url.c | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c
index cd843b4..2e07f96 100644
--- a/dlls/urlmon/binding.c
+++ b/dlls/urlmon/binding.c
@@ -1127,37 +1127,14 @@ static ULONG WINAPI InternetProtocolSink_Release(IInternetProtocolSink *iface)
return IBinding_Release(BINDING(This));
}
-typedef struct {
- task_header_t header;
- PROTOCOLDATA data;
-} switch_task_t;
-
-static void switch_proc(Binding *binding, task_header_t *t)
-{
- switch_task_t *task = (switch_task_t*)t;
-
- IInternetProtocol_Continue(binding->protocol, &task->data);
-
- heap_free(task);
-}
-
static HRESULT WINAPI InternetProtocolSink_Switch(IInternetProtocolSink *iface,
PROTOCOLDATA *pProtocolData)
{
Binding *This = PROTSINK_THIS(iface);
- switch_task_t *task;
-
- TRACE("(%p)->(%p)\n", This, pProtocolData);
- task = heap_alloc(sizeof(switch_task_t));
- task->data = *pProtocolData;
+ WARN("(%p)->(%p)\n", This, pProtocolData);
- push_task(This, &task->header, switch_proc);
-
- IBinding_AddRef(BINDING(This));
- PostMessageW(This->notif_hwnd, WM_MK_CONTINUE, 0, (LPARAM)This);
-
- return S_OK;
+ return E_FAIL;
}
typedef struct {
diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c
index 6d3832e..7b9c89f 100644
--- a/dlls/urlmon/tests/url.c
+++ b/dlls/urlmon/tests/url.c
@@ -324,6 +324,28 @@ static ULONG WINAPI Protocol_Release(IInternetProtocol *iface)
return 1;
}
+static void test_switch_fail(void)
+{
+ IInternetProtocolSink *binding_sink;
+ PROTOCOLDATA protocoldata;
+ HRESULT hres;
+
+ static BOOL tested_switch_fail;
+
+ if(tested_switch_fail)
+ return;
+
+ tested_switch_fail = TRUE;
+
+ hres = IBinding_QueryInterface(current_binding, &IID_IInternetProtocolSink, (void**)&binding_sink);
+ ok(hres == S_OK, "Could not get IInternetProtocolSink iface: %08x\n", hres);
+ if(SUCCEEDED(hres)) {
+ hres = IInternetProtocolSink_Switch(binding_sink, &protocoldata);
+ ok(hres == E_FAIL, "Switch failed: %08x, expected E_FAIL\n", hres);
+ IInternetProtocolSink_Release(binding_sink);
+ }
+}
+
static DWORD WINAPI thread_proc(PVOID arg)
{
PROTOCOLDATA protocoldata;
@@ -368,6 +390,8 @@ static DWORD WINAPI thread_proc(PVOID arg)
else
CHECK_CALLED(OnProgress_SENDINGREQUEST);
+ test_switch_fail();
+
SET_EXPECT(Continue);
prot_state = 1;
hres = IInternetProtocolSink_Switch(protocol_sink, &protocoldata);
More information about the wine-cvs
mailing list