Rob Shearman : ole32: Add more tests for global interface table
functions.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed May 23 08:10:55 CDT 2007
Module: wine
Branch: master
Commit: 05230781b006ed94cbf5e34bc6366595f55d0d8e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=05230781b006ed94cbf5e34bc6366595f55d0d8e
Author: Rob Shearman <rob at codeweavers.com>
Date: Tue May 22 10:31:45 2007 +0100
ole32: Add more tests for global interface table functions.
---
dlls/ole32/tests/marshal.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 1fd2fbb..d0735fc 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -2588,10 +2588,11 @@ static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
hr);
CoInitialize(NULL);
+
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
ok_ole_success(hr, IGlobalInterfaceTable_GetInterfaceFromGlobal);
- IGlobalInterfaceTable_Release(params->git);
+ IClassFactory_Release(cf);
CoUninitialize();
@@ -2607,6 +2608,10 @@ static void test_globalinterfacetable(void)
DWORD tid;
struct git_params params;
DWORD ret;
+ IUnknown *object;
+
+ trace("test_globalinterfacetable\n");
+ cLocks = 0;
hr = CoCreateInstance(&CLSID_StdGlobalInterfaceTable, NULL, CLSCTX_INPROC_SERVER, &IID_IGlobalInterfaceTable, (void **)&git);
ok_ole_success(hr, CoCreateInstance);
@@ -2614,6 +2619,8 @@ static void test_globalinterfacetable(void)
hr = IGlobalInterfaceTable_RegisterInterfaceInGlobal(git, (IUnknown *)&Test_ClassFactory, &IID_IClassFactory, &cookie);
ok_ole_success(hr, IGlobalInterfaceTable_RegisterInterfaceInGlobal);
+ ok_more_than_one_lock();
+
params.cookie = cookie;
params.git = git;
/* note: params is on stack so we MUST wait for get_global_interface_proc
@@ -2630,6 +2637,25 @@ static void test_globalinterfacetable(void)
}
CloseHandle(thread);
+
+ /* test getting interface from global with different iid */
+ hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(git, cookie, &IID_IUnknown, (void **)&object);
+ todo_wine
+ ok_ole_success(hr, IGlobalInterfaceTable_GetInterfaceFromGlobal);
+ if (SUCCEEDED(hr)) IUnknown_Release(object);
+
+ /* test getting interface from global with same iid */
+ hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(git, cookie, &IID_IClassFactory, (void **)&object);
+ ok_ole_success(hr, IGlobalInterfaceTable_GetInterfaceFromGlobal);
+ IUnknown_Release(object);
+
+ hr = IGlobalInterfaceTable_RevokeInterfaceFromGlobal(git, cookie);
+ ok_ole_success(hr, IGlobalInterfaceTable_RevokeInterfaceFromGlobal);
+
+ todo_wine
+ ok_no_locks();
+
+ IGlobalInterfaceTable_Release(git);
}
static const char *debugstr_iid(REFIID riid)
More information about the wine-cvs
mailing list