From: Vibhav Pant vibhavp@gmail.com
--- dlls/vccorlib140/tests/vccorlib.c | 42 ++++++++++++++++++++++++++++++- dlls/vccorlib140/vccorlib.c | 8 ++++++ dlls/vccorlib140/vccorlib140.spec | 6 ++--- 3 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/dlls/vccorlib140/tests/vccorlib.c b/dlls/vccorlib140/tests/vccorlib.c index 15347fdc6da..9a1262e32f8 100644 --- a/dlls/vccorlib140/tests/vccorlib.c +++ b/dlls/vccorlib140/tests/vccorlib.c @@ -2,6 +2,7 @@ * Unit tests for miscellaneous vccorlib functions * * Copyright 2025 Piotr Caban + * Copyright 2025 Vibhav Pant * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -58,6 +59,7 @@ DEFINE_EXPECT(PostUninitialize); static HRESULT (__cdecl *pInitializeData)(int); static void (__cdecl *pUninitializeData)(int); static HRESULT (WINAPI *pGetActivationFactoryByPCWSTR)(const WCHAR *, REFIID, void **); +static HRESULT (WINAPI *pGetIidsFn)(UINT32, UINT32 *, const GUID *, GUID **);
static BOOL init(void) { @@ -79,15 +81,26 @@ static BOOL init(void) #ifdef __arm__ pGetActivationFactoryByPCWSTR = (void *)GetProcAddress(hmod, "?GetActivationFactoryByPCWSTR@GetAGGGG@YAJPAXAAVGuid@Platform@@PAPAX@Z"); + pGetIidsFn = (void *)GetProcAddress(hmod, + "?GetIidsFn@@YAJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z"); #else if (sizeof(void *) == 8) /* x86_64 */ + { pGetActivationFactoryByPCWSTR = (void *)GetProcAddress(hmod, "?GetActivationFactoryByPCWSTR@@YAJPEAXAEAVGuid@Platform@@PEAPEAX@Z"); + pGetIidsFn = (void *)GetProcAddress(hmod, + "?GetIidsFn@@YAJHPEAKPEBU__s_GUID@@PEAPEAVGuid@Platform@@@Z"); + } else /* x86 */ + { pGetActivationFactoryByPCWSTR = (void *)GetProcAddress(hmod, "?GetActivationFactoryByPCWSTR@@YGJPAXAAVGuid@Platform@@PAPAX@Z"); + pGetIidsFn = (void *)GetProcAddress(hmod, + "?GetIidsFn@@YGJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z"); + } #endif ok(pGetActivationFactoryByPCWSTR != NULL, "GetActivationFactoryByPCWSTR not available\n"); + ok(pGetIidsFn != NULL, "GetIidsFn not available\n");
return TRUE; } @@ -228,9 +241,10 @@ static void test_InitializeData(void) ok(hr == S_OK, "CoRevokeInitializeSpy returned %lx\n", hr); }
+static const GUID guid_null = {0}; + static void test_GetActivationFactoryByPCWSTR(void) { - static const GUID guid_null = {0}; HRESULT hr; void *out;
@@ -257,6 +271,31 @@ static void test_GetActivationFactoryByPCWSTR(void) pUninitializeData(1); }
+static void test_GetIidsFn(void) +{ + static const GUID guids_src[] = {IID_IUnknown, IID_IInspectable, IID_IAgileObject, IID_IMarshal}; + GUID *guids_dest; + UINT32 copied; + HRESULT hr; + + guids_dest = NULL; + copied = 0xdeadbeef; + hr = pGetIidsFn(0, &copied, NULL, &guids_dest); + todo_wine ok(hr == S_OK, "got hr %#lx\n", hr); + todo_wine ok(copied == 0, "got copied %I32u\n", copied); + todo_wine ok(guids_dest != NULL, "got guids_dest %p\n", guids_dest); + CoTaskMemFree(guids_dest); + + guids_dest = NULL; + copied = 0; + hr = pGetIidsFn(ARRAY_SIZE(guids_src), &copied, guids_src, &guids_dest); + todo_wine ok(hr == S_OK, "got hr %#lx\n", hr); + todo_wine ok(copied == ARRAY_SIZE(guids_src), "got copied %I32u\n", copied); + todo_wine ok(guids_dest != NULL, "got guids_dest %p\n", guids_dest); + ok(!memcmp(guids_src, guids_dest, sizeof(*guids_dest) * copied), "unexpected guids_dest value.\n"); + CoTaskMemFree(guids_dest); +} + START_TEST(vccorlib) { if(!init()) @@ -264,4 +303,5 @@ START_TEST(vccorlib)
test_InitializeData(); test_GetActivationFactoryByPCWSTR(); + test_GetIidsFn(); } diff --git a/dlls/vccorlib140/vccorlib.c b/dlls/vccorlib140/vccorlib.c index c6ffd854e96..f58a38252aa 100644 --- a/dlls/vccorlib140/vccorlib.c +++ b/dlls/vccorlib140/vccorlib.c @@ -1,5 +1,6 @@ /* * Copyright 2025 Piotr Caban + * Copyright 2025 Vibhav Pant * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -56,3 +57,10 @@ HRESULT WINAPI GetActivationFactoryByPCWSTR(const WCHAR *name, REFIID iid, void
return RoGetActivationFactory(str, iid, out); } + +HRESULT WINAPI GetIidsFn(UINT32 len, UINT32 *copied, const GUID *src, GUID **dest) +{ + FIXME("(%I32u, %p, %p, %p) stub\n", len, copied, src, dest); + + return E_NOTIMPL; +} diff --git a/dlls/vccorlib140/vccorlib140.spec b/dlls/vccorlib140/vccorlib140.spec index 0c6a8f21d50..2823d4e15f0 100644 --- a/dlls/vccorlib140/vccorlib140.spec +++ b/dlls/vccorlib140/vccorlib140.spec @@ -136,9 +136,9 @@ @ stub -arch=i386 ?GetIBoxVtable@Details@Platform@@YGPAXPAX@Z @ stub -arch=arm ?GetIBoxVtable@Details@Platform@@YAPAXPAX@Z @ stub -arch=win64 ?GetIBoxVtable@Details@Platform@@YAPEAXPEAX@Z -@ stub -arch=i386 ?GetIidsFn@@YGJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z -@ stub -arch=arm ?GetIidsFn@@YAJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z -@ stub -arch=win64 ?GetIidsFn@@YAJHPEAKPEBU__s_GUID@@PEAPEAVGuid@Platform@@@Z +@ stdcall -arch=i386 ?GetIidsFn@@YGJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z(long ptr ptr ptr) GetIidsFn +@ stdcall -arch=arm ?GetIidsFn@@YAJHPAKPBU__s_GUID@@PAPAVGuid@Platform@@@Z(long ptr ptr ptr) GetIidsFn +@ stdcall -arch=win64 ?GetIidsFn@@YAJHPEAKPEBU__s_GUID@@PEAPEAVGuid@Platform@@@Z(long ptr ptr ptr) GetIidsFn @ stub -arch=i386 ?GetObjectContext@Details@Platform@@YGPAUIUnknown@@XZ @ stub -arch=arm ?GetObjectContext@Details@Platform@@YAPAUIUnknown@@XZ @ stub -arch=win64 ?GetObjectContext@Details@Platform@@YAPEAUIUnknown@@XZ