[OLE32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
[reactos.git] / rostests / winetests / ole32 / compobj.c
index cc230ee..846abea 100644 (file)
@@ -105,6 +105,7 @@ static const GUID IID_TestPS = { 0x66666666, 0x8888, 0x7777, { 0x66, 0x66, 0x55,
 
 DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
 DEFINE_GUID(CLSID_testclsid, 0xacd014c7,0x9535,0x4fac,0x8b,0x53,0xa4,0x8c,0xa7,0xf4,0xd7,0x26);
+DEFINE_GUID(CLSID_GlobalOptions, 0x0000034b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
 
 static const 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};
@@ -363,11 +364,13 @@ static void test_ProgIDFromCLSID(void)
         CoTaskMemFree(progid);
 
         /* classes without default progid, progid list is not used */
+        progid = (void *)0xdeadbeef;
         hr = ProgIDFromCLSID(&IID_Testiface5, &progid);
-        ok(hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", hr);
+        ok(hr == REGDB_E_CLASSNOTREG && progid == NULL, "got 0x%08x, progid %p\n", hr, progid);
 
+        progid = (void *)0xdeadbeef;
         hr = ProgIDFromCLSID(&IID_Testiface6, &progid);
-        ok(hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", hr);
+        ok(hr == REGDB_E_CLASSNOTREG && progid == NULL, "got 0x%08x, progid %p\n", hr, progid);
 
         pDeactivateActCtx(0, cookie);
         pReleaseActCtx(handle);
@@ -3567,6 +3570,32 @@ todo_wine {
     CoUninitialize();
 }
 
+static void test_GlobalOptions(void)
+{
+    IGlobalOptions *global_options;
+    HRESULT hres;
+
+    CoInitialize(NULL);
+
+    hres = CoCreateInstance(&CLSID_GlobalOptions, NULL, CLSCTX_INPROC_SERVER,
+            &IID_IGlobalOptions, (void**)&global_options);
+    ok(hres == S_OK || broken(hres == E_NOINTERFACE), "CoCreateInstance(CLSID_GlobalOptions) failed: %08x\n", hres);
+    if(FAILED(hres))
+    {
+        win_skip("CLSID_GlobalOptions not available\n");
+        CoUninitialize();
+        return;
+    }
+
+    IGlobalOptions_Release(global_options);
+
+    hres = CoCreateInstance(&CLSID_GlobalOptions, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER,
+            &IID_IGlobalOptions, (void**)&global_options);
+    ok(hres == E_INVALIDARG, "CoCreateInstance(CLSID_GlobalOptions) failed: %08x\n", hres);
+
+    CoUninitialize();
+}
+
 static void init_funcs(void)
 {
     HMODULE hOle32 = GetModuleHandleA("ole32");
@@ -3638,4 +3667,5 @@ START_TEST(compobj)
     test_CoGetCurrentLogicalThreadId();
     test_IInitializeSpy();
     test_CoGetInstanceFromFile();
+    test_GlobalOptions();
 }