Split into 3 commits for easier reviewing: 1) Just move the files 2) Fix paths 3) Add test
Feel free to squish.
From: Fabian Maurer dark.shadow4@web.de
--- .../Makefile.in | 0 .../classes.idl | 0 .../geolocation.spec} | 0 .../main.c | 0 .../private.h | 0 .../tests/Makefile.in | 0 .../tests/geolocator.c | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/Makefile.in (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/classes.idl (100%) rename dlls/{windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec => geolocation/geolocation.spec} (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/main.c (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/private.h (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/tests/Makefile.in (100%) rename dlls/{windows.devices.geolocation.geolocator => geolocation}/tests/geolocator.c (100%)
diff --git a/dlls/windows.devices.geolocation.geolocator/Makefile.in b/dlls/geolocation/Makefile.in similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/Makefile.in rename to dlls/geolocation/Makefile.in diff --git a/dlls/windows.devices.geolocation.geolocator/classes.idl b/dlls/geolocation/classes.idl similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/classes.idl rename to dlls/geolocation/classes.idl diff --git a/dlls/windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec b/dlls/geolocation/geolocation.spec similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/windows.devices.geolocation.geolocator.spec rename to dlls/geolocation/geolocation.spec diff --git a/dlls/windows.devices.geolocation.geolocator/main.c b/dlls/geolocation/main.c similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/main.c rename to dlls/geolocation/main.c diff --git a/dlls/windows.devices.geolocation.geolocator/private.h b/dlls/geolocation/private.h similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/private.h rename to dlls/geolocation/private.h diff --git a/dlls/windows.devices.geolocation.geolocator/tests/Makefile.in b/dlls/geolocation/tests/Makefile.in similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/tests/Makefile.in rename to dlls/geolocation/tests/Makefile.in diff --git a/dlls/windows.devices.geolocation.geolocator/tests/geolocator.c b/dlls/geolocation/tests/geolocator.c similarity index 100% rename from dlls/windows.devices.geolocation.geolocator/tests/geolocator.c rename to dlls/geolocation/tests/geolocator.c
From: Fabian Maurer dark.shadow4@web.de
--- configure.ac | 4 ++-- dlls/geolocation/Makefile.in | 2 +- dlls/geolocation/classes.idl | 2 +- dlls/geolocation/private.h | 4 ++-- dlls/geolocation/tests/Makefile.in | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac index 87a05fa903d..d1c5063201f 100644 --- a/configure.ac +++ b/configure.ac @@ -2631,6 +2631,8 @@ WINE_CONFIG_MAKEFILE(dlls/gdi32) WINE_CONFIG_MAKEFILE(dlls/gdi32/tests) WINE_CONFIG_MAKEFILE(dlls/gdiplus) WINE_CONFIG_MAKEFILE(dlls/gdiplus/tests) +WINE_CONFIG_MAKEFILE(dlls/geolocation) +WINE_CONFIG_MAKEFILE(dlls/geolocation/tests) WINE_CONFIG_MAKEFILE(dlls/glu32) WINE_CONFIG_MAKEFILE(dlls/gphoto2.ds) WINE_CONFIG_MAKEFILE(dlls/gpkcsp) @@ -3140,8 +3142,6 @@ WINE_CONFIG_MAKEFILE(dlls/windows.devices.bluetooth) WINE_CONFIG_MAKEFILE(dlls/windows.devices.bluetooth/tests) WINE_CONFIG_MAKEFILE(dlls/windows.devices.enumeration) WINE_CONFIG_MAKEFILE(dlls/windows.devices.enumeration/tests) -WINE_CONFIG_MAKEFILE(dlls/windows.devices.geolocation.geolocator) -WINE_CONFIG_MAKEFILE(dlls/windows.devices.geolocation.geolocator/tests) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input/tests) WINE_CONFIG_MAKEFILE(dlls/windows.gaming.ui.gamebar) diff --git a/dlls/geolocation/Makefile.in b/dlls/geolocation/Makefile.in index 42b5e50442b..b1274a1e2c8 100644 --- a/dlls/geolocation/Makefile.in +++ b/dlls/geolocation/Makefile.in @@ -1,4 +1,4 @@ -MODULE = windows.devices.geolocation.geolocator.dll +MODULE = geolocation.dll IMPORTS = combase uuid
C_SRCS = \ diff --git a/dlls/geolocation/classes.idl b/dlls/geolocation/classes.idl index 9c55cf20446..9a21dba5edc 100644 --- a/dlls/geolocation/classes.idl +++ b/dlls/geolocation/classes.idl @@ -1,4 +1,4 @@ -/* Runtime Classes for windows.devices.geolocation.geolocator.dll +/* Runtime Classes for geolocation.dll * * Copyright 2023 Fabian Maurer * diff --git a/dlls/geolocation/private.h b/dlls/geolocation/private.h index 7250bc1fe36..a188b5dacf3 100644 --- a/dlls/geolocation/private.h +++ b/dlls/geolocation/private.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#ifndef __WINE_WINDOWS_DEVICES_GEOLOCATION_GEOLOCATOR_PRIVATE_H -#define __WINE_WINDOWS_DEVICES_GEOLOCATION_GEOLOCATOR_PRIVATE_H +#ifndef __WINE_GEOLOCATION_PRIVATE_H +#define __WINE_GEOLOCATION_PRIVATE_H
#include <stdarg.h>
diff --git a/dlls/geolocation/tests/Makefile.in b/dlls/geolocation/tests/Makefile.in index 1be5ca78258..216e741fea8 100644 --- a/dlls/geolocation/tests/Makefile.in +++ b/dlls/geolocation/tests/Makefile.in @@ -1,4 +1,4 @@ -TESTDLL = windows.devices.geolocation.geolocator.dll +TESTDLL = geolocation.dll IMPORTS = combase uuid
C_SRCS = \
From: Fabian Maurer dark.shadow4@web.de
--- dlls/geolocation/tests/geolocator.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/dlls/geolocation/tests/geolocator.c b/dlls/geolocation/tests/geolocator.c index ca12f0d3a9d..3d3b9fb832c 100644 --- a/dlls/geolocation/tests/geolocator.c +++ b/dlls/geolocation/tests/geolocator.c @@ -48,10 +48,12 @@ static void check_interface_(unsigned int line, void *obj, const IID *iid) IUnknown_Release(unk); }
+HRESULT (WINAPI *pDllGetActivationFactory)(HSTRING, IActivationFactory **); + void test_basic(void) { static const WCHAR *geolocator_name = L"Windows.Devices.Geolocation.Geolocator"; - IActivationFactory *factory; + IActivationFactory *factory, *factory2; IInspectable *inspectable; IGeolocator *geolocator; IGeolocator *geolocator2; @@ -61,18 +63,34 @@ void test_basic(void) void *dummy; HSTRING str; HRESULT hr; + HMODULE hdll;
hr = WindowsCreateString(geolocator_name, wcslen(geolocator_name), &str); ok(hr == S_OK, "got hr %#lx.\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); - WindowsDeleteString(str); + ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "got hr %#lx.\n", hr); if (hr == REGDB_E_CLASSNOTREG) { - win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(geolocator_name)); - return; + WindowsDeleteString(str); + win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(geolocator_name)); + return; + } + + /* Check what dll the class comes from */ + hdll = LoadLibraryW(L"geolocation.dll"); + ok (!!hdll, "Failed to load library, err %lu.\n", GetLastError()); + + pDllGetActivationFactory = (void *)GetProcAddress(hdll, "DllGetActivationFactory"); + ok(!!pDllGetActivationFactory, "DllGetActivationFactory not found.\n"); + if (pDllGetActivationFactory) + { + hr = pDllGetActivationFactory(str, &factory2); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + IActivationFactory_Release(factory2); } + WindowsDeleteString(str);
/* Don't check IID_IAgileObject since it's ignored on win 8 */ check_interface(factory, &IID_IUnknown);