Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9a9d73b5
Commit
9a9d73b5
authored
Feb 28, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Make combase.dll dependency optional.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3bfbdc6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
22 deletions
+71
-22
Makefile.in
dlls/dinput/tests/Makefile.in
+1
-1
hotplug.c
dlls/dinput/tests/hotplug.c
+32
-10
joystick8.c
dlls/dinput/tests/joystick8.c
+38
-11
No files found.
dlls/dinput/tests/Makefile.in
View file @
9a9d73b5
TESTDLL
=
dinput.dll
IMPORTS
=
dinput dinput8 ole32 version user32 advapi32 hid uuid crypt32 newdev setupapi wintrust winmm
combase
IMPORTS
=
dinput dinput8 ole32 version user32 advapi32 hid uuid crypt32 newdev setupapi wintrust winmm
driver_hid_IMPORTS
=
winecrt0 ntoskrnl hal hidclass
driver_hid_EXTRADLLFLAGS
=
-nodefaultlibs
-nostartfiles
-Wl
,--subsystem,native
...
...
dlls/dinput/tests/hotplug.c
View file @
9a9d73b5
...
...
@@ -47,6 +47,31 @@
#define WIDL_using_Windows_Gaming_Input
#include "windows.gaming.input.h"
#define MAKE_FUNC(f) static typeof(f) *p ## f
MAKE_FUNC
(
RoGetActivationFactory
);
MAKE_FUNC
(
RoInitialize
);
MAKE_FUNC
(
WindowsCreateString
);
MAKE_FUNC
(
WindowsDeleteString
);
#undef MAKE_FUNC
static
BOOL
load_combase_functions
(
void
)
{
HMODULE
combase
=
GetModuleHandleW
(
L"combase.dll"
);
#define LOAD_FUNC(m, f) if (!(p ## f = (void *)GetProcAddress( m, #f ))) goto failed;
LOAD_FUNC
(
combase
,
RoGetActivationFactory
);
LOAD_FUNC
(
combase
,
RoInitialize
);
LOAD_FUNC
(
combase
,
WindowsCreateString
);
LOAD_FUNC
(
combase
,
WindowsDeleteString
);
#undef LOAD_FUNC
return
TRUE
;
failed:
win_skip
(
"Failed to load combase.dll functions, skipping tests
\n
"
);
return
FALSE
;
}
static
BOOL
test_input_lost
(
DWORD
version
)
{
#include "psh_hid_macros.h"
...
...
@@ -529,20 +554,20 @@ static void test_windows_gaming_input(void)
HRESULT
hr
;
MSG
msg
;
hr
=
RoInitialize
(
RO_INIT_MULTITHREADED
);
if
(
!
load_combase_functions
())
return
;
hr
=
pRoInitialize
(
RO_INIT_MULTITHREADED
);
ok
(
hr
==
RPC_E_CHANGED_MODE
,
"RoInitialize failed, hr %#lx
\n
"
,
hr
);
hr
=
WindowsCreateString
(
class_name
,
wcslen
(
class_name
),
&
str
);
hr
=
p
WindowsCreateString
(
class_name
,
wcslen
(
class_name
),
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString failed, hr %#lx
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IRawGameControllerStatics
,
(
void
**
)
&
statics
);
hr
=
pRoGetActivationFactory
(
str
,
&
IID_IRawGameControllerStatics
,
(
void
**
)
&
statics
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
),
"RoGetActivationFactory failed, hr %#lx
\n
"
,
hr
);
WindowsDeleteString
(
str
);
p
WindowsDeleteString
(
str
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
win_skip
(
"%s runtimeclass not registered, skipping tests.
\n
"
,
wine_dbgstr_w
(
class_name
)
);
RoUninitialize
();
return
;
}
...
...
@@ -551,7 +576,7 @@ static void test_windows_gaming_input(void)
ok
(
hr
==
S_OK
,
"add_RawGameControllerAdded returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
controller_added_token
.
value
,
"got token %I64u
\n
"
,
controller_added_token
.
value
);
if
(
!
controller_added_token
.
value
)
goto
done
;
if
(
!
controller_added_token
.
value
)
return
;
hr
=
IRawGameControllerStatics_add_RawGameControllerRemoved
(
statics
,
&
controller_removed
.
IEventHandler_RawGameController_iface
,
&
controller_removed_token
);
...
...
@@ -642,9 +667,6 @@ static void test_windows_gaming_input(void)
DestroyWindow
(
hwnd
);
UnregisterClassW
(
class
.
lpszClassName
,
class
.
hInstance
);
done:
RoUninitialize
();
}
START_TEST
(
hotplug
)
...
...
dlls/dinput/tests/joystick8.c
View file @
9a9d73b5
...
...
@@ -46,6 +46,33 @@
#define WIDL_using_Windows_Gaming_Input
#include "windows.gaming.input.h"
#define MAKE_FUNC(f) static typeof(f) *p ## f
MAKE_FUNC
(
RoGetActivationFactory
);
MAKE_FUNC
(
RoInitialize
);
MAKE_FUNC
(
WindowsCreateString
);
MAKE_FUNC
(
WindowsDeleteString
);
MAKE_FUNC
(
WindowsGetStringRawBuffer
);
#undef MAKE_FUNC
static
BOOL
load_combase_functions
(
void
)
{
HMODULE
combase
=
GetModuleHandleW
(
L"combase.dll"
);
#define LOAD_FUNC(m, f) if (!(p ## f = (void *)GetProcAddress( m, #f ))) goto failed;
LOAD_FUNC
(
combase
,
RoGetActivationFactory
);
LOAD_FUNC
(
combase
,
RoInitialize
);
LOAD_FUNC
(
combase
,
WindowsCreateString
);
LOAD_FUNC
(
combase
,
WindowsDeleteString
);
LOAD_FUNC
(
combase
,
WindowsGetStringRawBuffer
);
#undef LOAD_FUNC
return
TRUE
;
failed:
win_skip
(
"Failed to load combase.dll functions, skipping tests
\n
"
);
return
FALSE
;
}
struct
check_objects_todos
{
BOOL
type
;
...
...
@@ -3214,9 +3241,9 @@ static void check_runtimeclass_( int line, IInspectable *inspectable, const WCHA
hr
=
IInspectable_GetRuntimeClassName
(
inspectable
,
&
str
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"GetRuntimeClassName returned %#lx
\n
"
,
hr
);
buffer
=
WindowsGetStringRawBuffer
(
str
,
&
length
);
buffer
=
p
WindowsGetStringRawBuffer
(
str
,
&
length
);
ok_
(
__FILE__
,
line
)(
!
wcscmp
(
buffer
,
class_name
),
"got class name %s
\n
"
,
debugstr_w
(
buffer
)
);
WindowsDeleteString
(
str
);
p
WindowsDeleteString
(
str
);
}
static
void
test_windows_gaming_input
(
void
)
...
...
@@ -3284,20 +3311,22 @@ static void test_windows_gaming_input(void)
HSTRING
str
;
HRESULT
hr
;
if
(
!
load_combase_functions
())
return
;
GetCurrentDirectoryW
(
ARRAY_SIZE
(
cwd
),
cwd
);
GetTempPathW
(
ARRAY_SIZE
(
tempdir
),
tempdir
);
SetCurrentDirectoryW
(
tempdir
);
cleanup_registry_keys
();
hr
=
RoInitialize
(
RO_INIT_MULTITHREADED
);
hr
=
p
RoInitialize
(
RO_INIT_MULTITHREADED
);
ok
(
hr
==
RPC_E_CHANGED_MODE
,
"RoInitialize returned %#lx
\n
"
,
hr
);
hr
=
WindowsCreateString
(
controller_class_name
,
wcslen
(
controller_class_name
),
&
str
);
hr
=
p
WindowsCreateString
(
controller_class_name
,
wcslen
(
controller_class_name
),
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString returned %#lx
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IRawGameControllerStatics
,
(
void
**
)
&
controller_statics
);
hr
=
p
RoGetActivationFactory
(
str
,
&
IID_IRawGameControllerStatics
,
(
void
**
)
&
controller_statics
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
),
"RoGetActivationFactory returned %#lx
\n
"
,
hr
);
WindowsDeleteString
(
str
);
p
WindowsDeleteString
(
str
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
...
...
@@ -3336,11 +3365,11 @@ static void test_windows_gaming_input(void)
/* HID gamepads aren't exposed as WGI gamepads on Windows */
hr
=
WindowsCreateString
(
gamepad_class_name
,
wcslen
(
gamepad_class_name
),
&
str
);
hr
=
p
WindowsCreateString
(
gamepad_class_name
,
wcslen
(
gamepad_class_name
),
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString returned %#lx
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IGamepadStatics
,
(
void
**
)
&
gamepad_statics
);
hr
=
p
RoGetActivationFactory
(
str
,
&
IID_IGamepadStatics
,
(
void
**
)
&
gamepad_statics
);
ok
(
hr
==
S_OK
,
"RoGetActivationFactory returned %#lx
\n
"
,
hr
);
WindowsDeleteString
(
str
);
p
WindowsDeleteString
(
str
);
hr
=
IGamepadStatics_get_Gamepads
(
gamepad_statics
,
&
gamepads_view
);
ok
(
hr
==
S_OK
,
"get_Gamepads returned %#lx
\n
"
,
hr
);
hr
=
IVectorView_Gamepad_get_Size
(
gamepads_view
,
&
size
);
...
...
@@ -3384,8 +3413,6 @@ done:
pnp_driver_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
RoUninitialize
();
}
START_TEST
(
joystick8
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment