mscoree/tests: Test querying interfaces with generated GUID.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-10-23 08:51:45 +02:00 committed by Alexandre Julliard
parent 7612ff5930
commit 6b450f8deb
2 changed files with 17 additions and 1 deletions

View File

@ -33,6 +33,8 @@
HMODULE hmscoree; HMODULE hmscoree;
DEFINE_GUID(IID_ITest2, 0x50adb433, 0xf6c5, 0x3b30, 0x92,0x0a, 0x55,0x57,0x11,0x86,0x75,0x09);
typedef enum _run_type typedef enum _run_type
{ {
run_type_current_working_directory = 0, run_type_current_working_directory = 0,
@ -156,6 +158,7 @@ static void run_registry_test(run_type run)
char buffer[256]; char buffer[256];
ITest *test = NULL; ITest *test = NULL;
HRESULT hr, result_expected; HRESULT hr, result_expected;
IUnknown *unk = NULL;
HKEY hkey; HKEY hkey;
DWORD ret; DWORD ret;
int i = 0; int i = 0;
@ -184,6 +187,9 @@ static void run_registry_test(run_type run)
hr = ITest_Func(test, &i); hr = ITest_Func(test, &i);
ok(hr == S_OK, "Got %x\n", hr); ok(hr == S_OK, "Got %x\n", hr);
ok(i == 42, "Expected 42, got %d\n", i); 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); ITest_Release(test);
} }

View File

@ -30,12 +30,22 @@ namespace DLL
void Func(ref int i); 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)] [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) public void Func(ref int i)
{ {
i = 42; i = 42;
} }
public void Func2(ref int i)
{
i = 43;
}
} }
} }