29#define USE_COM_CONTEXT_DEF
41#define DEFINE_EXPECT(func) \
42 static BOOL expect_ ## func = FALSE; static unsigned int called_ ## func = 0
44#define SET_EXPECT(func) \
45 expect_ ## func = TRUE
47#define CHECK_EXPECT2(func) \
49 ok(expect_ ##func, "unexpected call " #func "\n"); \
53#define CHECK_EXPECT(func) \
55 CHECK_EXPECT2(func); \
56 expect_ ## func = FALSE; \
59#define CHECK_CALLED(func, n) \
61 ok(called_ ## func == n, "expected " #func " called %u times, got %u\n", n, called_ ## func); \
62 expect_ ## func = FALSE; \
63 called_ ## func = 0; \
89#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
90#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
91#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks)
93static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
94static const CLSID CLSID_StdFont = { 0x0be35203, 0x8f91, 0x11ce, { 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51 } };
95static const GUID IID_Testiface = { 0x22222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
96static const GUID IID_Testiface2 = { 0x32222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
97static const GUID IID_Testiface3 = { 0x42222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
98static const GUID IID_Testiface4 = { 0x52222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
99static const GUID IID_Testiface5 = { 0x62222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
100static const GUID IID_Testiface6 = { 0x72222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
101static const GUID IID_TestPS = { 0x66666666, 0x8888, 0x7777, { 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 } };
103DEFINE_GUID(CLSID_testclsid, 0xacd014c7,0x9535,0x4fac,0x8b,0x53,0xa4,0x8c,0xa7,0xf4,0xd7,0x26);
106static const WCHAR wszNonExistent[] = {
'N',
'o',
'n',
'E',
'x',
'i',
's',
't',
'e',
'n',
't',0};
109 '{',
'0',
'b',
'e',
'3',
'5',
'2',
'0',
'3',
'-',
'8',
'f',
'9',
'1',
'-',
'1',
'1',
'c',
'e',
'-',
110 '9',
'd',
'e',
'3',
'-',
'0',
'0',
'a',
'a',
'0',
'0',
'4',
'b',
'b',
'8',
'5',
'1',
'}',0
112static const WCHAR progidW[] = {
'P',
'r',
'o',
'g',
'I',
'd',
'.',
'P',
'r',
'o',
'g',
'I',
'd',0};
113static const WCHAR cf_brokenW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'1',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
114 'c',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',
'a',0};
116DEFINE_GUID(
IID_IWineTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd);
117DEFINE_GUID(
CLSID_WineOOPTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd);
132 LPCLASSFACTORY iface,
142 IClassFactory_AddRef(iface);
164 LPCLASSFACTORY iface,
176 LPCLASSFACTORY iface,
224 if (!pCreateActCtxW)
return NULL;
230 actctx.cbSize =
sizeof(ACTCTXW);
235 "handle == INVALID_HANDLE_VALUE, error %u\n",
GetLastError());
238 win_skip(
"activation context generation failed, some tests will be skipped\n");
242 ok(
actctx.cbSize ==
sizeof(ACTCTXW),
"actctx.cbSize=%d\n",
actctx.cbSize);
245 ok(
actctx.wProcessorArchitecture == 0,
"actctx.wProcessorArchitecture=%d\n",
actctx.wProcessorArchitecture);
247 ok(
actctx.lpAssemblyDirectory ==
NULL,
"actctx.lpAssemblyDirectory=%p\n",
actctx.lpAssemblyDirectory);
248 ok(
actctx.lpResourceName ==
NULL,
"actctx.lpResourceName=%p\n",
actctx.lpResourceName);
249 ok(
actctx.lpApplicationName ==
NULL,
"actctx.lpApplicationName=%p\n",
actctx.lpApplicationName);
264"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
265"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\""
266" publicKeyToken=\"6595b6414666f1df\" />"
267"<file name=\"testlib.dll\">"
269" clsid=\"{0000033a-0000-0000-c000-000000000046}\""
270" progid=\"FTMarshal\""
273" clsid=\"{5201163f-8164-4fd0-a1a2-5d5a3654d3bd}\""
274" progid=\"WineOOPTest\""
276" <comClass description=\"Test com class\""
277" clsid=\"{12345678-1234-1234-1234-56789abcdef0}\""
278" progid=\"ProgId.ProgId\""
279" miscStatusIcon=\"recomposeonresize\""
281" <comClass description=\"CustomFont Description\" clsid=\"{0be35203-8f91-11ce-9de3-00aa004bb851}\""
282" progid=\"CustomFont\""
283" miscStatusIcon=\"recomposeonresize\""
284" miscStatusContent=\"insideout\""
286" <comClass description=\"StdFont Description\" clsid=\"{0be35203-8f91-11ce-9de3-00aa004bb852}\""
289" <comClass clsid=\"{62222222-1234-1234-1234-56789abcdef0}\" >"
290" <progid>ProgId.ProgId.1</progid>"
292" <comInterfaceProxyStub "
294" iid=\"{22222222-1234-1234-1234-56789abcdef0}\""
295" proxyStubClsid32=\"{66666666-8888-7777-6666-555555555555}\""
298" <comInterfaceExternalProxyStub "
300" iid=\"{32222222-1234-1234-1234-56789abcdef0}\""
302" <comInterfaceExternalProxyStub "
304" iid=\"{42222222-1234-1234-1234-56789abcdef0}\""
305" proxyStubClsid32=\"{66666666-8888-7777-6666-555555555555}\""
307" <comInterfaceExternalProxyStub "
309" iid=\"{52222222-1234-1234-1234-56789abcdef0}\""
310" proxyStubClsid32=\"{00000000-0000-0000-0000-000000000000}\""
313" clsid=\"{72222222-1234-1234-1234-56789abcdef0}\""
316" <progid>clrprogid.1</progid>"
320DEFINE_GUID(CLSID_Testclass, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0);
330 ok(
hr ==
S_OK,
"ProgIDFromCLSID failed with error 0x%08x\n",
hr);
343 ok(
hr ==
E_INVALIDARG,
"ProgIDFromCLSID should return E_INVALIDARG instead of 0x%08x\n",
hr);
347 static const WCHAR customfontW[] = {
'C',
'u',
's',
't',
'o',
'm',
'F',
'o',
'n',
't',0};
362 progid = (
void *)0xdeadbeef;
366 progid = (
void *)0xdeadbeef;
370 pDeactivateActCtx(0,
cookie);
381 ok(
hr ==
S_OK,
"CLSIDFromProgID failed with error 0x%08x\n",
hr);
391 ok(
hr ==
E_INVALIDARG,
"CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
394 ok(
hr ==
E_INVALIDARG,
"CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
398 ok(
hr ==
CO_E_CLASSSTRING,
"CLSIDFromProgID on nonexistent ProgID should have returned CO_E_CLASSSTRING instead of 0x%08x\n",
hr);
433 clsid1.Data4[7] = 0x52;
437 pDeactivateActCtx(0,
cookie);
445 WCHAR wszCLSID_Broken[50];
465 wszCLSID_Broken[
i] =
'A';
466 wszCLSID_Broken[
i] =
'\0';
496 wszCLSID_Broken[9] =
'*';
503 wszCLSID_Broken[3] =
'*';
510 wszCLSID_Broken[3] =
'\0';
520 static const WCHAR cfW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'1',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
521 'c',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
522 static const WCHAR brokenW[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'1',
'-',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
523 'g',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
524 static const WCHAR broken2W[] = {
'{',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'1',
'=',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
525 'g',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
526 static const WCHAR broken3W[] = {
'b',
'r',
'o',
'k',
'e',
'n',
'0',
'0',
'1',
'=',
'0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
527 'g',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
535 memset(&iid, 0xab,
sizeof(iid));
545 memset(&iid, 0xab,
sizeof(iid));
548 ok(iid.Data1 == 0xabababab,
"Got %08x\n", iid.Data1);
551 memset(&iid, 0xab,
sizeof(iid));
554 ok(iid.Data1 == 0x00000001,
"Got %08x\n", iid.Data1);
556 memset(&iid, 0xab,
sizeof(iid));
559 ok(iid.Data1 == 0x00000001,
"Got %08x\n", iid.Data1);
562 memset(&iid, 0xab,
sizeof(iid));
565 ok(iid.Data1 == 0xabababab,
"Got %08x\n", iid.Data1);
568 memset(&iid, 0xab,
sizeof(iid));
571 ok(iid.Data1 == 0xabababab,
"Got %08x\n", iid.Data1);
574 memset(&iid, 0xab,
sizeof(iid));
577 ok(iid.Data1 == 0xabababab,
"Got %08x\n", iid.Data1);
588 ok(
len == 0,
"len: %d (expected 0)\n",
len);
593 ok(
len == 39,
"len: %d (expected 39)\n",
len);
598 ok(
len == 39,
"len: %d (expected 39)\n",
len);
602 ok(
len == 0,
"len: %d (expected 0)\n",
len);
605 ok(
len == 0,
"len: %d (expected 0)\n",
len);
608#define test_apt_type(t, q) _test_apt_type(t, q, __LINE__)
615 if (!pCoGetApartmentType)
620 ok_(__FILE__,
line)(
type == expected_type,
"Wrong apartment type %d, expected %d\n",
type, expected_type);
629 REFCLSID rclsid = &CLSID_InternetZoneManager;
634 ok(
pUnk ==
NULL,
"CoCreateInstance should have changed the passed in pointer to NULL, instead of %p\n",
pUnk);
640 ok(
hr ==
REGDB_E_CLASSNOTREG,
"CoCreateInstance for non-registered inproc server should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n",
hr);
642 ok(
hr ==
REGDB_E_CLASSNOTREG,
"CoCreateInstance for non-registered inproc handler should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n",
hr);
644 ok(
hr ==
REGDB_E_CLASSNOTREG,
"CoCreateInstance for non-registered local server should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n",
hr);
646 ok(
hr ==
REGDB_E_CLASSNOTREG,
"CoCreateInstance for non-registered remote server should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n",
hr);
651 skip(
"IE not installed so can't test CoCreateInstance\n");
672 REFCLSID rclsid = &CLSID_InternetZoneManager;
678 ok(
pUnk ==
NULL,
"CoGetClassObject should have changed the passed in pointer to NULL, instead of %p\n",
pUnk);
683 "CoGetClassObject should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
687 if (!pRegOverridePredefKey)
689 win_skip(
"RegOverridePredefKey not available\n");
698 IUnknown_Release(
pUnk);
702 ok(!
res,
"RegCreateKeyEx returned %d\n",
res);
705 ok(!
res,
"RegOverridePredefKey returned %d\n",
res);
708 ok(
hr ==
S_OK,
"CoGetClassObject should have returned S_OK instead of 0x%08x\n",
hr);
711 ok(!
res,
"RegOverridePredefKey returned %d\n",
res);
719 IUnknown_Release(
pUnk);
726 IUnknown_Release(
pUnk);
728 pDeactivateActCtx(0,
cookie);
737 MULTI_QI qi_res = { &IID_IMoniker };
783 hwndFrame =
CreateWindowA((
LPCSTR)
MAKEINTATOM(
register_dummy_class()),
"Test", 0,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
NULL,
NULL);
799 IMessageFilter_AddRef(iface);
819 HTASK threadIDCaller,
821 LPINTERFACEINFO lpInterfaceInfo)
823 trace(
"HandleInComingCall\n");
824 return SERVERCALL_ISHANDLED;
829 HTASK threadIDCallee,
833 trace(
"RetryRejectedCall\n");
839 HTASK threadIDCallee,
843 trace(
"MessagePending\n");
846 return PENDINGMSG_WAITNOPROCESS;
868 "CoRegisterMessageFilter should have failed with CO_E_NOT_SUPPORTED instead of 0x%08x\n",
875 "CoRegisterMessageFilter should have failed with CO_E_NOT_SUPPORTED instead of 0x%08x\n",
878 "prev_filter should have been set to %p\n", prev_filter);
889 ok(prev_filter ==
NULL,
"prev_filter should have been set to NULL instead of %p\n", prev_filter);
893 ok(prev_filter ==
NULL,
"prev_filter should have been set to NULL instead of %p\n", prev_filter);
920 ok(0,
"unexpected call\n");
926 ok(0,
"unexpected call\n");
932 ok(0,
"unexpected call\n");
938 ok(0,
"unexpected call\n");
970 IUnknown_AddRef((
IUnknown*)*ppvObj);
1004 IPSFactoryBuffer_AddRef(
This);
1040 ok(pUnkServer == &
Test_Unknown,
"unexpected pUnkServer %p\n", pUnkServer);
1063 {0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd}
1090 DWORD dwRegistrationKey;
1128 ok(
hr ==
E_NOTIMPL,
"CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n",
hr);
1142 ok(
hr ==
S_OK,
"CoMarshalInterface should have returned S_OK instead of 0x%08x\n",
hr);
1146 ok(
hr ==
S_OK,
"CoMarshalInterface should have returned S_OK instead of 0x%08x\n",
hr);
1203 "CoGetPSClsid should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n",
1213 "CoGetPSClsid for random IID returned 0x%08x instead of REGDB_E_IIDNOTREG\n",
1218 "CoGetPSClsid for null clsid returned 0x%08x instead of E_INVALIDARG\n",
1221 if (!pRegOverridePredefKey)
1223 win_skip(
"RegOverridePredefKey not available\n");
1232 ok(!
res,
"RegCreateKeyEx returned %d\n",
res);
1235 ok(!
res,
"RegOverridePredefKey returned %d\n",
res);
1241 ok(!
res,
"RegOverridePredefKey returned %d\n",
res);
1279 pDeactivateActCtx(0,
cookie);
1283 if (pRegDeleteKeyExA &&
1287 static GUID IID_DeadBeef = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}};
1288 static const char clsidDeadBeef[] =
"{deadbeef-dead-beef-dead-beefdeadbeef}";
1289 static const char clsidA[] =
"{66666666-8888-7777-6666-555555555555}";
1290 HKEY hkey_iface, hkey_psclsid;
1298 ok(!
res,
"RegCreateKeyEx returned %d\n",
res);
1303 win_skip(
"Failed to create a key, skipping some of CoGetPSClsid() tests\n");
1307 ok(!
res,
"RegCreateKeyEx returned %d\n",
res);
1310 ok(!
res,
"RegCreateKeyEx returned %d\n",
res);
1312 ok(!
res,
"RegSetValueEx returned %d\n",
res);
1319 res = pRegDeleteKeyExA(hkey,
"ProxyStubClsid32", opposite, 0);
1320 ok(!
res,
"RegDeleteKeyEx returned %d\n",
res);
1322 res = pRegDeleteKeyExA(hkey_iface, clsidDeadBeef, opposite, 0);
1323 ok(!
res,
"RegDeleteKeyEx returned %d\n",
res);
1340 ok(
hr ==
E_INVALIDARG,
"CoUnmarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1352 ok(
hr ==
STG_E_READFAULT,
"CoUnmarshalInterface should have returned STG_E_READFAULT instead of 0x%08x\n",
hr);
1357 ok(
hr ==
E_INVALIDARG,
"CoUnmarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1359 IStream_Release(pStream);
1388 ok(
hr ==
E_INVALIDARG,
"CoMarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1391 ok(
hr ==
E_INVALIDARG,
"CoMarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1398 ok(
hr ==
STG_E_READFAULT,
"CoReleaseMarshalData should have returned STG_E_READFAULT instead of 0x%08x\n",
hr);
1400 hr = IStream_Seek(pStream,
llZero, STREAM_SEEK_SET,
NULL);
1406 IStream_Release(pStream);
1422 ok(
hr ==
E_INVALIDARG,
"CoMarshalInterThreadInterfaceInStream should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1425 ok(
hr ==
E_INVALIDARG,
"CoMarshalInterThreadInterfaceInStream should have returned E_INVALIDARG instead of 0x%08x\n",
hr);
1437 IClassFactory_Release(pProxy);
1438 IStream_Release(pStream);
1518 ok(
hr ==
REGDB_E_CLASSNOTREG,
"object registered in an apartment shouldn't accessible after it is destroyed\n");
1531 IClassFactory_Release(pcf);
1540 pDeactivateActCtx(0, ctxcookie);
1546 IClassFactory_Release(pcf);
1563 IClassFactory_Release(pcf);
1596 hr = IClassFactory_QueryInterface(pcf, &IID_IMultiQI, (
void **)&pMQI);
1598 IMultiQI_Release(pMQI);
1599 IClassFactory_Release(pcf);
1658 "registered in different thread should return REGDB_E_CLASSNOTREG "
1659 "instead of 0x%08x\n",
hr);
1662 ok(
hr ==
S_OK,
"CoGetClassObject on inproc object registered in same "
1663 "thread should return S_OK instead of 0x%08x\n",
hr);
1670 ok(
hr ==
S_OK,
"CoRegisterClassObject with same CLSID but in different thread should return S_OK instead of 0x%08x\n",
hr);
1694 ok(
hr ==
S_OK,
"CoGetClassObject on local server object "
1695 "registered in different thread should return S_OK "
1696 "instead of 0x%08x\n",
hr);
1699 ok(
hr ==
S_OK,
"CoGetClassObject on local server object registered in same "
1700 "thread should return S_OK instead of 0x%08x\n",
hr);
1708 "thread to where registered should return RPC_E_WRONG_THREAD instead of 0x%08x\n",
hr);
1715 ok(
hr ==
S_OK,
"CoRegisterClassObject with same CLSID but in different "
1716 "thread should return S_OK instead of 0x%08x\n",
hr);
1749 skip(
"IE not installed so can't run CoFreeUnusedLibraries test\n");
1759 "Expected a valid pointer\n");
1761 IUnknown_Release(
pUnk);
1789 if (!pCoGetObjectContext)
1791 win_skip(
"CoGetObjectContext not present\n");
1795 hr = pCoGetObjectContext(&IID_IComThreadingInfo, (
void **)&pComThreadingInfo);
1797 ok(pComThreadingInfo ==
NULL,
"pComThreadingInfo should have been set to NULL\n");
1803 hr = pCoGetObjectContext(&IID_IComThreadingInfo, (
void **)&pComThreadingInfo);
1806 threadinginfo2 =
NULL;
1807 hr = pCoGetObjectContext(&IID_IComThreadingInfo, (
void **)&threadinginfo2);
1808 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%08x\n",
hr);
1809 ok(pComThreadingInfo == threadinginfo2,
"got different instance\n");
1810 IComThreadingInfo_Release(threadinginfo2);
1812 hr = IComThreadingInfo_GetCurrentLogicalThreadId(pComThreadingInfo,
NULL);
1816 hr = IComThreadingInfo_GetCurrentLogicalThreadId(pComThreadingInfo, &
id);
1822 hr = IComThreadingInfo_GetCurrentApartmentType(pComThreadingInfo, &apttype);
1824 ok(apttype ==
APTTYPE_MAINSTA,
"apartment type should be APTTYPE_MAINSTA instead of %d\n", apttype);
1826 hr = IComThreadingInfo_GetCurrentThreadType(pComThreadingInfo, &thdtype);
1830 refs = IComThreadingInfo_Release(pComThreadingInfo);
1831 ok(refs == 0,
"pComThreadingInfo should have 0 refs instead of %d refs\n", refs);
1833 hr = pCoGetObjectContext(&IID_IContextCallback, (
void **)&pContextCallback);
1836 refs = IContextCallback_Release(pContextCallback);
1837 ok(refs == 0,
"pContextCallback should have 0 refs instead of %d refs\n", refs);
1843 hr = pCoGetObjectContext(&IID_IComThreadingInfo, (
void **)&pComThreadingInfo);
1846 hr = IComThreadingInfo_GetCurrentApartmentType(pComThreadingInfo, &apttype);
1848 ok(apttype ==
APTTYPE_MTA,
"apartment type should be APTTYPE_MTA instead of %d\n", apttype);
1850 hr = IComThreadingInfo_GetCurrentThreadType(pComThreadingInfo, &thdtype);
1854 refs = IComThreadingInfo_Release(pComThreadingInfo);
1855 ok(refs == 0,
"pComThreadingInfo should have 0 refs instead of %d refs\n", refs);
1857 hr = pCoGetObjectContext(&IID_IContextCallback, (
void **)&pContextCallback);
1860 refs = IContextCallback_Release(pContextCallback);
1861 ok(refs == 0,
"pContextCallback should have 0 refs instead of %d refs\n", refs);
1863 hr = pCoGetObjectContext(&IID_IObjContext, (
void **)&pObjContext);
1866 refs = IObjContext_Release(pObjContext);
1867 ok(refs == 0,
"pObjContext should have 0 refs instead of %d refs\n", refs);
1892 IUnknown_AddRef(iface);
1929 if (!pCoSwitchCallContext)
1931 skip(
"CoSwitchCallContext not present\n");
1948 refs = IUnknown_AddRef(&
test_object->IUnknown_iface);
1949 ok(refs == 2,
"Expected refcount 2, got %d\n", refs);
1957 refs = IUnknown_AddRef(&
test_object->IUnknown_iface);
1958 ok(refs == 3,
"Expected refcount 3, got %d\n", refs);
1960 IUnknown_Release(
pUnk);
1967 refs = IUnknown_AddRef(&
test_object->IUnknown_iface);
1968 ok(refs == 2,
"Expected refcount 2, got %d\n", refs);
1986 if (!pCoGetContextToken)
1988 win_skip(
"CoGetContextToken not present\n");
1993 hr = pCoGetContextToken(&
token);
1995 ok(
token == 0xdeadbeef,
"Expected 0, got 0x%lx\n",
token);
2003 hr = pCoGetContextToken(
NULL);
2007 hr = pCoGetContextToken(&
token);
2008 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%08x\n",
hr);
2009 ok(
token,
"Expected token != 0\n");
2012 hr = pCoGetContextToken(&token2);
2013 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%08x\n",
hr);
2014 ok(token2 ==
token,
"got different token\n");
2017 ok(refs == 1,
"Expected 1, got %u\n", refs);
2019 hr = pCoGetObjectContext(&IID_IObjContext, (
void **)&
ctx);
2020 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%08x\n",
hr);
2023 refs = IObjContext_AddRef(
ctx);
2024 ok(refs == 3,
"Expected 3, got %u\n", refs);
2026 refs = IObjContext_Release(
ctx);
2027 ok(refs == 2,
"Expected 2, got %u\n", refs);
2030 ok(refs == 1,
"Expected 1, got %u\n", refs);
2034 hr = pCoGetContextToken(&
token);
2035 ok(
hr ==
S_OK,
"Expected S_OK, got 0x%08x\n",
hr);
2036 ok(
token,
"Expected token != 0\n");
2039 refs = IObjContext_AddRef(
ctx);
2040 ok(refs == 2,
"Expected 1, got %u\n", refs);
2042 refs = IObjContext_Release(
ctx);
2043 ok(refs == 1,
"Expected 0, got %u\n", refs);
2045 refs = IObjContext_Release(
ctx);
2046 ok(refs == 0,
"Expected 0, got %u\n", refs);
2055 static GUID deadbeef = {0xdeadbeef,0xdead,0xbeef,{0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef}};
2056 static const char deadbeefA[] =
"{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}";
2058 HKEY clsidkey, deadbeefkey;
2061 if (!pCoGetTreatAsClass)
2063 win_skip(
"CoGetTreatAsClass not present\n");
2067 hr = pCoGetTreatAsClass(&deadbeef,&
out);
2075 hr = pCoGetTreatAsClass(&deadbeef,
NULL);
2079 ok(!lr,
"Couldn't open CLSID key, error %d\n", lr);
2083 win_skip(
"CoGetTreatAsClass() tests will be skipped (failed to create a test key, error %d)\n", lr);
2088 hr = pCoTreatAsClass(&deadbeef, &deadbeef);
2091 hr = pCoTreatAsClass(&deadbeef, &CLSID_FileProtocol);
2093 win_skip(
"Insufficient privileges to use CoTreatAsClass\n");
2096 ok(
hr ==
S_OK,
"CoTreatAsClass failed: %08x\n",
hr);
2098 hr = pCoGetTreatAsClass(&deadbeef, &
out);
2099 ok(
hr ==
S_OK,
"CoGetTreatAsClass failed: %08x\n",
hr);
2100 ok(
IsEqualGUID(&
out, &CLSID_FileProtocol),
"expected to get substituted clsid\n");
2107 win_skip(
"IE not installed so can't test CoCreateInstance\n");
2111 ok(
hr ==
S_OK,
"CoCreateInstance failed: %08x\n",
hr);
2113 IInternetProtocol_Release(pIP);
2118 ok(
hr ==
S_OK,
"CoTreatAsClass failed: %08x\n",
hr);
2120 hr = pCoGetTreatAsClass(&deadbeef, &
out);
2131 IInternetProtocol_Release(pIP);
2145 ok(
hr ==
S_OK,
"CoInitializeEx failed with error 0x%08x\n",
hr);
2150 ok(
hr ==
S_OK,
"OleInitialize failed with error 0x%08x\n",
hr);
2166 REFCLSID rclsid = &CLSID_InternetZoneManager;
2170 ok(
hr ==
S_OK,
"CoInitializeEx(COINIT_MULTITHREADED) failed with error 0x%08x\n",
hr);
2178 ok(
hr ==
S_OK,
"CoCreateInstance should have returned 0x%08x instead of 0x%08x\n",
S_OK,
hr);
2185 ok(
hr ==
S_OK,
"CoInitialize() failed with error 0x%08x\n",
hr);
2188 ok(
hr ==
S_OK,
"OleInitialize should have returned 0x%08x instead of 0x%08x\n",
S_OK,
hr);
2195 ok(
hr ==
S_OK,
"CoCreateInstance should have returned 0x%08x instead of 0x%08x\n",
S_OK,
hr);
2207 ok(
hr ==
S_OK,
"CoInitialize() failed with error 0x%08x\n",
hr);
2210 ok(
hr ==
S_OK,
"OleInitialize should have returned 0x%08x instead of 0x%08x\n",
S_OK,
hr);
2222 ok(
hr ==
S_FALSE,
"OleInitialize should have returned 0x%08x instead of 0x%08x\n",
S_FALSE,
hr);
2268 pDeactivateActCtx(0,
cookie);
2275 static const WCHAR stdfont_usertypeW[] = {
'S',
't',
'a',
'n',
'd',
'a',
'r',
'd',
' ',
'F',
'o',
'n',
't',0};
2276 static const WCHAR stdfont2_usertypeW[] = {
'C',
'L',
'S',
'I',
'D',
'_',
'S',
't',
'd',
'F',
'o',
'n',
't',0};
2277 static const WCHAR clsidkeyW[] = {
'C',
'L',
'S',
'I',
'D',0};
2278 static const WCHAR defvalueW[] = {
'D',
'e',
'f',
'a',
'u',
'l',
't',
' ',
'N',
'a',
'm',
'e',0};
2279 static const WCHAR auxvalue0W[] = {
'A',
'u',
'x',
' ',
'N',
'a',
'm',
'e',
' ',
'0',0};
2280 static const WCHAR auxvalue2W[] = {
'A',
'u',
'x',
' ',
'N',
'a',
'm',
'e',
' ',
'2',0};
2281 static const WCHAR auxvalue3W[] = {
'A',
'u',
'x',
' ',
'N',
'a',
'm',
'e',
' ',
'3',0};
2282 static const WCHAR auxvalue4W[] = {
'A',
'u',
'x',
' ',
'N',
'a',
'm',
'e',
' ',
'4',0};
2284 static const char auxvalues[][16] = {
2292 HKEY clsidhkey, hkey, auxhkey, classkey;
2301 for (
form = 0;
form <= USERCLASSTYPE_APPNAME+1;
form++) {
2305 str = (
void*)0xdeadbeef;
2321 for (
form = 0;
form <= USERCLASSTYPE_APPNAME+1;
form++) {
2322 str = (
void*)0xdeadbeef;
2336 pDeactivateActCtx(0,
cookie);
2353 win_skip(
"Failed to create test key, skipping some of OleRegGetUserType() tests.\n");
2357 ok(!
ret,
"failed to create a key, error %d\n",
ret);
2366 for (
i = 0;
i <= 4;
i++) {
2415 for (
i = 0;
i <= 4;
i++)
2485#define cowait_msgs_expect_empty() _cowait_msgs_expect_empty(__LINE__)
2495#define cowait_msgs_expect_notified(a) _cowait_msgs_expect_notified(__LINE__,a)
2499 ok_(__FILE__,
line)(0,
"expected message %u, received none\n", expected_msg);
2502 "expected message %u, received %u \n",
2508#define cowait_msgs_expect_queued(a,b) _cowait_msgs_expect_queued(__LINE__,a,b)
2517 ok_(__FILE__,
line)(
msg.message == expected_msg,
"unexpected message %u, expected %u\n",
2518 msg.message, expected_msg);
2551 ok(
hr ==
S_OK,
"CoUnmarshalInterface failed: %08x\n",
hr);
2554 ok(
hr ==
S_OK,
"QueryInterface failed: %08x\n",
hr);
2556 IEnumOLEVERB_Release(enum_verb);
2557 IUnknown_Release(unk);
2576 ok(
hr ==
S_OK,
"CoInitializeEx failed with error 0x%08x\n",
hr);
2578 hWnd =
CreateWindowExA(0,
cls_name,
"Test (thread)",
WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0);
2587 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2595 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2612 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2618 ok(
hr ==
S_OK,
"CoInitializeEx failed with error 0x%08x\n",
hr);
2621 ok(
hr ==
S_OK,
"CreateStreamOnHGlobal failed: %08x\n",
hr);
2624 ok(
hr ==
S_OK,
"CoMarshalInterface should have returned S_OK instead of 0x%08x\n",
hr);
2632 ok(
hr ==
S_OK,
"CoRegisterMessageFilter failed: %08x\n",
hr);
2643 ok(
hr ==
S_OK,
"CoRegisterMessageFilter failed: %08x\n",
hr);
2663 ok(
hr ==
S_OK,
"CoInitializeEx failed with error 0x%08x\n",
hr);
2665 memset(&wc, 0,
sizeof(wc));
2676 hWnd =
CreateWindowExA(0,
cls_name,
"Test",
WS_TILEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0);
2689 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2697 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2705 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2710 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2713 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2718 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2721 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2729 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2740 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2752 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2765 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2768 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2776 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2786 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2789 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2794 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2797 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2805 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2812 ok(
hr ==
S_OK,
"expected S_OK, got 0x%08x\n",
hr);
2815 ok(
success,
"CoWaitForMultipleHandles unexpectedly pumped messages\n");
2822 ok(
success,
"PeekMessageA returned FALSE\n");
2827 ok(!
success,
"CoWaitForMultipleHandles didn't pump any messages\n");
2832 ok(
success,
"PeekMessageA returned FALSE\n");
2837 "expected RPC_S_CALLPENDING, got 0x%08x\n",
hr);
2842 "CoWaitForMultipleHandles didn't pump any messages\n");
2876 ok(
msg.message ==
WM_QUIT,
"expected msg.message = WM_QUIT, got %u\n",
msg.message);
2877 ok(
msg.wParam == 40,
"expected msg.wParam = 40, got %lu\n",
msg.wParam);
2879 ok(!
success,
"PeekMessageA succeeded\n");
2916 ok(!
success,
"PeekMessageA succeeded\n");
2923 ok(
msg.message ==
WM_QUIT,
"expected msg.message = WM_QUIT, got %u\n",
msg.message);
2924 ok(
msg.wParam == 41,
"expected msg.wParam = 41, got %lu\n",
msg.wParam);
2939 ok(!
success,
"CoWaitForMultipleHandles didn't pump all WM_DDE_FIRST messages\n");
2943 ok(
msg.message ==
WM_QUIT,
"expected msg.message = WM_QUIT, got %u\n",
msg.message);
2944 ok(
msg.wParam == 42,
"expected msg.wParam = 42, got %lu\n",
msg.wParam);
2954 win_skip(
"PostQuitMessage didn't queue a WM_QUIT message, skipping tests\n");
2957 ok(
msg.message ==
WM_QUIT,
"expected msg.message = WM_QUIT, got %u\n",
msg.message);
2958 ok(
msg.wParam == 43,
"expected msg.wParam = 43, got %lu\n",
msg.wParam);
2960 ok(!
success,
"PeekMessageA succeeded\n");
2973 ok(!
success,
"PeekMessageA succeeded\n");
2975 ok(!
success,
"CoWaitForMultipleHandles didn't remove WM_QUIT messages\n");
2991 ok(!
success,
"PeekMessageA succeeded\n");
2993 ok(!
success,
"CoWaitForMultipleHandles didn't remove WM_QUIT messages\n");
3045 imalloc = (
void*)0xdeadbeef;
3048 ok(imalloc ==
NULL,
"got %p\n", imalloc);
3050 imalloc = (
void*)0xdeadbeef;
3053 ok(imalloc ==
NULL,
"got %p\n", imalloc);
3055 imalloc = (
void*)0xdeadbeef;
3058 ok(imalloc ==
NULL,
"got %p\n", imalloc);