diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 519cb7435dc..89124980cae 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -55,6 +55,12 @@ static void (WINAPI *pReleaseActCtx)(HANDLE); static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; static const CLSID CLSID_StdFont = { 0x0be35203, 0x8f91, 0x11ce, { 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51 } }; +static const GUID IID_Testiface = { 0x22222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; +static const GUID IID_Testiface2 = { 0x32222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; +static const GUID IID_Testiface3 = { 0x42222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; +static const GUID IID_Testiface4 = { 0x52222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; +static const GUID IID_TestPS = { 0x66666666, 0x8888, 0x7777, { 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 } }; + static WCHAR stdfont[] = {'S','t','d','F','o','n','t',0}; static const WCHAR wszNonExistent[] = {'N','o','n','E','x','i','s','t','e','n','t',0}; static WCHAR wszCLSID_StdFont[] = @@ -230,7 +236,26 @@ static const char actctx_manifest[] = " " +" " "" +" " +" " +" " ""; DEFINE_GUID(CLSID_Testclass, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0); @@ -904,6 +929,8 @@ static void test_CoRegisterPSClsid(void) static void test_CoGetPSClsid(void) { + ULONG_PTR cookie; + HANDLE handle; HRESULT hr; CLSID clsid; HKEY hkey; @@ -952,6 +979,38 @@ static void test_CoGetPSClsid(void) ok(!res, "RegOverridePredefKey returned %d\n", res); RegCloseKey(hkey); + + /* not registered CLSID */ + hr = CoGetPSClsid(&IID_Testiface, &clsid); + ok(hr == REGDB_E_IIDNOTREG, "got 0x%08x\n", hr); + + if ((handle = activate_context(actctx_manifest, &cookie))) + { +todo_wine { + memset(&clsid, 0, sizeof(clsid)); + hr = CoGetPSClsid(&IID_Testiface, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &IID_Testiface), "got clsid %s\n", debugstr_guid(&clsid)); + + memset(&clsid, 0, sizeof(clsid)); + hr = CoGetPSClsid(&IID_Testiface2, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &IID_Testiface2), "got clsid %s\n", debugstr_guid(&clsid)); + + memset(&clsid, 0, sizeof(clsid)); + hr = CoGetPSClsid(&IID_Testiface3, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &IID_TestPS), "got clsid %s\n", debugstr_guid(&clsid)); + + memset(&clsid, 0xaa, sizeof(clsid)); + hr = CoGetPSClsid(&IID_Testiface4, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &GUID_NULL), "got clsid %s\n", debugstr_guid(&clsid)); +} + pDeactivateActCtx(0, cookie); + pReleaseActCtx(handle); + } + CoUninitialize(); }