ole32: Add more tests for global interface table functions.
This commit is contained in:
parent
eebf8df601
commit
05230781b0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue