From: Hans Chen <hxchennz@gmail.com> --- dlls/sxs/tests/Makefile.in | 2 ++ dlls/sxs/tests/sxs.c | 14 ++++++++++++++ dlls/sxs/tests/testlib.c | 38 +++++++++++++++++++++++++++++++++++++ dlls/sxs/tests/testlib.spec | 1 + 4 files changed, 55 insertions(+) create mode 100644 dlls/sxs/tests/testlib.c create mode 100644 dlls/sxs/tests/testlib.spec diff --git a/dlls/sxs/tests/Makefile.in b/dlls/sxs/tests/Makefile.in index 9c93f16da66..3c492b2d2ed 100644 --- a/dlls/sxs/tests/Makefile.in +++ b/dlls/sxs/tests/Makefile.in @@ -6,4 +6,6 @@ SOURCES = \ interfaces.idl \ name.c \ resource.rc \ + testlib.c \ + testlib.spec \ sxs.c diff --git a/dlls/sxs/tests/sxs.c b/dlls/sxs/tests/sxs.c index d9e70722010..75b67fcf25e 100644 --- a/dlls/sxs/tests/sxs.c +++ b/dlls/sxs/tests/sxs.c @@ -38,6 +38,8 @@ #define SXS_GUID_INFORMATION_CLR_FLAG_IS_SURROGATE 0x00000001 #define SXS_GUID_INFORMATION_CLR_FLAG_IS_CLASS 0x00000002 +DEFINE_GUID(CLSID_TestLibClass, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33); + typedef struct _SXS_GUID_INFORMATION_CLR { DWORD cbSize; @@ -147,6 +149,18 @@ static void run_test(void) ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY, (GUID *)&CLSID_SurrogateTest, NULL, NULL, 0, &buffer_size); ok(!ret, "Unexpected return value %d.\n", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %ld\n", GetLastError()); + + info = malloc(buffer_size); + SetLastError(0xdeadbeef); + ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY, (GUID*)&CLSID_TestLibClass, NULL, info, buffer_size, &buffer_size); + ok(ret == TRUE, "Got %d\n", ret); + ok(GetLastError() == 0, "Got %ld\n", GetLastError()); + ok(info->dwFlags == SXS_GUID_INFORMATION_CLR_FLAG_IS_CLASS, "Got %ld\n", info->dwFlags); + ok(!lstrcmpW(info->pcwszTypeName, NULL), "Unexpected typename %s.\n", wine_dbgstr_w(info->pcwszTypeName)); + ok(!lstrcmpW(info->pcwszRuntimeVersion, NULL), "Unexpected runtime version %s.\n", + wine_dbgstr_w(info->pcwszRuntimeVersion)); + + free(info); } static void prepare_and_run_test(void) diff --git a/dlls/sxs/tests/testlib.c b/dlls/sxs/tests/testlib.c new file mode 100644 index 00000000000..a8b1c2e3b21 --- /dev/null +++ b/dlls/sxs/tests/testlib.c @@ -0,0 +1,38 @@ +/* + * Test library + * + * Copyright 2019 Nikolay Sivov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep testdll +#endif + +#include <stdio.h> +#include <windows.h> +#include <initguid.h> + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sxs); +DEFINE_GUID(IID_CoTest, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33); + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **obj) +{ + FIXME("clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), obj); + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/sxs/tests/testlib.spec b/dlls/sxs/tests/testlib.spec new file mode 100644 index 00000000000..8737274e9c6 --- /dev/null +++ b/dlls/sxs/tests/testlib.spec @@ -0,0 +1 @@ +@ stdcall DllGetClassObject(ptr ptr ptr) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9632