From 6b450f8deb984fd4deb1e7e4501855b781d4dff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 23 Oct 2020 08:51:45 +0200 Subject: [PATCH] mscoree/tests: Test querying interfaces with generated GUID. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- 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; + } } }