Zebediah Figura : windows.gaming.input: Link directly to combase.
Alexandre Julliard
julliard at winehq.org
Thu Apr 22 15:55:24 CDT 2021
Module: wine
Branch: master
Commit: ac1c34715368943a39ef20f422125d3d588d5e64
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ac1c34715368943a39ef20f422125d3d588d5e64
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Apr 21 20:34:58 2021 -0500
windows.gaming.input: Link directly to combase.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/windows.gaming.input/tests/Makefile.in | 2 +-
dlls/windows.gaming.input/tests/input.c | 50 ++++++-----------------------
2 files changed, 11 insertions(+), 41 deletions(-)
diff --git a/dlls/windows.gaming.input/tests/Makefile.in b/dlls/windows.gaming.input/tests/Makefile.in
index 7fce9b04551..88e1c05fbcf 100644
--- a/dlls/windows.gaming.input/tests/Makefile.in
+++ b/dlls/windows.gaming.input/tests/Makefile.in
@@ -1,5 +1,5 @@
TESTDLL = windows.gaming.input.dll
-IMPORTS = uuid
+IMPORTS = combase uuid
C_SRCS = \
input.c
diff --git a/dlls/windows.gaming.input/tests/input.c b/dlls/windows.gaming.input/tests/input.c
index 6ce06de346e..b05dc508637 100644
--- a/dlls/windows.gaming.input/tests/input.c
+++ b/dlls/windows.gaming.input/tests/input.c
@@ -34,13 +34,6 @@
#include "wine/test.h"
-static HRESULT (WINAPI *pRoActivateInstance)(HSTRING, IInspectable **);
-static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **);
-static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE);
-static void (WINAPI *pRoUninitialize)(void);
-static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *);
-static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING);
-
struct gamepad_event_handler
{
IEventHandler_Gamepad IEventHandler_Gamepad_iface;
@@ -119,13 +112,13 @@ static void test_Gamepad(void)
gamepad_event_handler.IEventHandler_Gamepad_iface.lpVtbl = &gamepad_event_handler_vtbl;
- hr = pRoInitialize(RO_INIT_MULTITHREADED);
+ hr = RoInitialize(RO_INIT_MULTITHREADED);
ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
- hr = pWindowsCreateString(gamepad_name, wcslen(gamepad_name), &str);
+ hr = WindowsCreateString(gamepad_name, wcslen(gamepad_name), &str);
ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
- hr = pRoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
+ hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
@@ -213,9 +206,9 @@ static void test_Gamepad(void)
IInspectable_Release(inspectable);
IActivationFactory_Release(factory);
- pWindowsDeleteString(str);
+ WindowsDeleteString(str);
- pRoUninitialize();
+ RoUninitialize();
}
struct controller_event_handler
@@ -296,13 +289,13 @@ static void test_RawGameController(void)
controller_event_handler.IEventHandler_RawGameController_iface.lpVtbl = &controller_event_handler_vtbl;
- hr = pRoInitialize(RO_INIT_MULTITHREADED);
+ hr = RoInitialize(RO_INIT_MULTITHREADED);
ok(hr == S_OK || hr == S_FALSE, "RoInitialize failed, hr %#x\n", hr);
- hr = pWindowsCreateString(controller_name, wcslen(controller_name), &str);
+ hr = WindowsCreateString(controller_name, wcslen(controller_name), &str);
ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
- hr = pRoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
+ hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
@@ -390,36 +383,13 @@ static void test_RawGameController(void)
IInspectable_Release(inspectable);
IActivationFactory_Release(factory);
- pWindowsDeleteString(str);
+ WindowsDeleteString(str);
- pRoUninitialize();
+ RoUninitialize();
}
START_TEST(input)
{
- HMODULE combase;
-
- if (!(combase = LoadLibraryW(L"combase.dll")))
- {
- win_skip("Failed to load combase.dll, skipping tests\n");
- return;
- }
-
-#define LOAD_FUNCPTR(x) \
- if (!(p##x = (void*)GetProcAddress(combase, #x))) \
- { \
- win_skip("Failed to find %s in combase.dll, skipping tests.\n", #x); \
- return; \
- }
-
- LOAD_FUNCPTR(RoActivateInstance);
- LOAD_FUNCPTR(RoGetActivationFactory);
- LOAD_FUNCPTR(RoInitialize);
- LOAD_FUNCPTR(RoUninitialize);
- LOAD_FUNCPTR(WindowsCreateString);
- LOAD_FUNCPTR(WindowsDeleteString);
-#undef LOAD_FUNCPTR
-
test_Gamepad();
test_RawGameController();
}
More information about the wine-cvs
mailing list