[PATCH 2/3] mscoree/tests: Test querying interfaces with generated GUID.

Rémi Bernon rbernon at codeweavers.com
Fri Oct 23 01:51:45 CDT 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/mscoree/tests/comtest.c  |  6 ++++++
 dlls/mscoree/tests/comtest.cs | 12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/mscoree/tests/comtest.c b/dlls/mscoree/tests/comtest.c
index 8c2ae955cef..659eb9059a7 100644
--- a/dlls/mscoree/tests/comtest.c
+++ b/dlls/mscoree/tests/comtest.c
@@ -33,6 +33,8 @@
 
 HMODULE hmscoree;
 
+DEFINE_GUID(IID_ITest2, 0x50adb433, 0xf6c5, 0x3b30, 0x92,0x0a, 0x55,0x57,0x11,0x86,0x75,0x09);
+
 typedef enum _run_type
 {
     run_type_current_working_directory = 0,
@@ -156,6 +158,7 @@ static void run_registry_test(run_type run)
     char buffer[256];
     ITest *test = NULL;
     HRESULT hr, result_expected;
+    IUnknown *unk = NULL;
     HKEY hkey;
     DWORD ret;
     int i = 0;
@@ -184,6 +187,9 @@ static void run_registry_test(run_type run)
         hr = ITest_Func(test, &i);
         ok(hr == S_OK, "Got %x\n", hr);
         ok(i == 42, "Expected 42, got %d\n", i);
+        hr = ITest_QueryInterface(test, &IID_ITest2, (void**)&unk);
+        todo_wine ok(hr == S_OK, "ITest_QueryInterface returned %x\n", hr);
+        if (hr == S_OK) IUnknown_Release(unk);
         ITest_Release(test);
     }
 
diff --git a/dlls/mscoree/tests/comtest.cs b/dlls/mscoree/tests/comtest.cs
index f6461450331..536cd807691 100644
--- a/dlls/mscoree/tests/comtest.cs
+++ b/dlls/mscoree/tests/comtest.cs
@@ -30,12 +30,22 @@ namespace DLL
         void Func(ref int i);
     }
 
+    [ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+    public interface ITest2
+    {
+        void Func2(ref int i);
+    }
+
     [Guid("2e106e50-e7a4-4489-8538-83643f100fdc"), ComVisible(true), ClassInterface(ClassInterfaceType.None)]
-    public class Test : ITest
+    public class Test : ITest, ITest2
     {
         public void Func(ref int i)
         {
             i = 42;
         }
+        public void Func2(ref int i)
+        {
+            i = 43;
+        }
     }
 }
-- 
2.28.0




More information about the wine-devel mailing list