Module: wine Branch: refs/heads/master Commit: 723aceb20f8b759340074592da7d3ca4d201fe0b URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=723aceb20f8b759340074592...
Author: Robert Shearman rob@codeweavers.com Date: Wed Jun 28 21:24:58 2006 +0100
ole32: Add a test for CoCreateInstance doing object hosting by automatically creating an appropriate apartment for the object and returning a proxy to it.
---
dlls/ole32/tests/marshal.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index a1be2c3..24f9268 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -26,6 +26,7 @@ #include <stdarg.h> #include "windef.h" #include "winbase.h" #include "objbase.h" +#include "shlguid.h"
#include "wine/test.h"
@@ -59,6 +60,26 @@ static void test_CoGetPSClsid(void) hr); }
+static void test_cocreateinstance_proxy(void) +{ + IUnknown *pProxy; + IMultiQI *pMQI; + HRESULT hr; + + pCoInitializeEx(NULL, COINIT_MULTITHREADED); + + hr = CoCreateInstance(&CLSID_ShellDesktop, NULL, CLSCTX_INPROC, &IID_IUnknown, (void **)&pProxy); + ok_ole_success(hr, CoCreateInstance); + hr = IUnknown_QueryInterface(pProxy, &IID_IMultiQI, (void **)&pMQI); + todo_wine + ok(hr == S_OK, "created object is not a proxy, so was created in the wrong apartment\n"); + if (hr == S_OK) + IMultiQI_Release(pMQI); + IUnknown_Release(pProxy); + + CoUninitialize(); +} + static const LARGE_INTEGER ullZero; static LONG cLocks;
@@ -2214,6 +2235,8 @@ START_TEST(marshal) wndclass.lpszClassName = "WineCOMTest"; RegisterClass(&wndclass);
+ test_cocreateinstance_proxy(); + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
/* FIXME: test CoCreateInstanceEx */