Commit 71ada5c6 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Add a test for the retrieved local class object in another thread being a proxy.

parent 07229ed8
......@@ -747,6 +747,31 @@ static DWORD CALLBACK get_class_object_thread(LPVOID pv)
return hr;
}
static DWORD CALLBACK get_class_object_proxy_thread(LPVOID pv)
{
CLSCTX clsctx = (CLSCTX)(DWORD_PTR)pv;
HRESULT hr;
IClassFactory *pcf;
IMultiQI *pMQI;
pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = CoGetClassObject(&CLSID_WineOOPTest, clsctx, NULL, &IID_IClassFactory,
(void **)&pcf);
if (SUCCEEDED(hr))
{
hr = IClassFactory_QueryInterface(pcf, &IID_IMultiQI, (void **)&pMQI);
if (SUCCEEDED(hr))
IMultiQI_Release(pMQI);
IClassFactory_Release(pcf);
}
CoUninitialize();
return hr;
}
static DWORD CALLBACK register_class_object_thread(LPVOID pv)
{
HRESULT hr;
......@@ -821,7 +846,7 @@ static void test_registered_object_thread_affinity(void)
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &cookie);
ok_ole_success(hr, "CoRegisterClassObject");
thread = CreateThread(NULL, 0, get_class_object_thread, (LPVOID)CLSCTX_LOCAL_SERVER, 0, &tid);
thread = CreateThread(NULL, 0, get_class_object_proxy_thread, (LPVOID)CLSCTX_LOCAL_SERVER, 0, &tid);
ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError());
while (MsgWaitForMultipleObjects(1, &thread, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0 + 1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment