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
f6d2495c
Commit
f6d2495c
authored
Mar 21, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Rename HID driver identifiers and files.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4c336655
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
28 deletions
+40
-28
Makefile.in
dlls/dinput/tests/Makefile.in
+4
-4
dinput_test.h
dlls/dinput/tests/dinput_test.h
+2
-2
driver.c
dlls/dinput/tests/driver.c
+0
-0
driver.spec
dlls/dinput/tests/driver.spec
+0
-0
force_feedback.c
dlls/dinput/tests/force_feedback.c
+2
-2
hid.c
dlls/dinput/tests/hid.c
+25
-13
hotplug.c
dlls/dinput/tests/hotplug.c
+2
-2
joystick8.c
dlls/dinput/tests/joystick8.c
+5
-5
No files found.
dlls/dinput/tests/Makefile.in
View file @
f6d2495c
TESTDLL
=
dinput.dll
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
driver_IMPORTS
=
winecrt0 ntoskrnl hal hidclass
driver_EXTRADLLFLAGS
=
-nodefaultlibs
-nostartfiles
-Wl
,--subsystem,native
SOURCES
=
\
device.c
\
device8.c
\
dinput.c
\
driver
_hid
.c
\
driver
_hid
.spec
\
driver.c
\
driver.spec
\
force_feedback.c
\
hid.c
\
hotplug.c
\
...
...
dlls/dinput/tests/dinput_test.h
View file @
f6d2495c
...
...
@@ -52,8 +52,8 @@ extern const WCHAR expect_path_end[];
extern
HINSTANCE
instance
;
extern
BOOL
localized
;
/* object names get translated */
BOOL
pnp_driver_start
(
const
WCHAR
*
resource
);
void
pnp_driver
_stop
(
void
);
BOOL
hid_device_start
(
void
);
void
hid_device
_stop
(
void
);
void
cleanup_registry_keys
(
void
);
...
...
dlls/dinput/tests/driver
_hid
.c
→
dlls/dinput/tests/driver.c
View file @
f6d2495c
File moved
dlls/dinput/tests/driver
_hid
.spec
→
dlls/dinput/tests/driver.spec
View file @
f6d2495c
File moved
dlls/dinput/tests/force_feedback.c
View file @
f6d2495c
...
...
@@ -2999,7 +2999,7 @@ static BOOL test_force_feedback_joystick( DWORD version )
CloseHandle
(
file
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
winetest_pop_context
();
...
...
@@ -4317,7 +4317,7 @@ static void test_device_managed_effect(void)
CloseHandle
(
file
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
winetest_pop_context
();
...
...
dlls/dinput/tests/hid.c
View file @
f6d2495c
...
...
@@ -415,8 +415,9 @@ static void unload_driver( SC_HANDLE service )
CloseServiceHandle
(
service
);
}
void
pnp_driver_stop
(
void
)
static
void
pnp_driver_stop
(
void
)
{
const
WCHAR
*
service_name
=
L"winetest"
;
SP_DEVINFO_DATA
device
=
{
sizeof
(
SP_DEVINFO_DATA
)};
WCHAR
path
[
MAX_PATH
],
dest
[
MAX_PATH
],
*
filepart
;
SC_HANDLE
manager
,
service
;
...
...
@@ -453,7 +454,7 @@ void pnp_driver_stop(void)
manager
=
OpenSCManagerW
(
NULL
,
NULL
,
SC_MANAGER_CONNECT
);
ok
(
!!
manager
,
"failed to open service manager, error %lu
\n
"
,
GetLastError
()
);
service
=
OpenServiceW
(
manager
,
L"winetest"
,
SERVICE_STOP
|
DELETE
);
service
=
OpenServiceW
(
manager
,
service_name
,
SERVICE_STOP
|
DELETE
);
if
(
service
)
unload_driver
(
service
);
else
ok
(
GetLastError
()
==
ERROR_SERVICE_DOES_NOT_EXIST
,
"got error %lu
\n
"
,
GetLastError
()
);
...
...
@@ -488,11 +489,12 @@ void pnp_driver_stop(void)
ok
(
ret
||
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Failed to delete file, error %lu
\n
"
,
GetLastError
()
);
}
BOOL
pnp_driver_start
(
const
WCHAR
*
resource
)
static
BOOL
pnp_driver_start
(
void
)
{
static
const
WCHAR
hardware_id
[]
=
L"test_hardware_id
\0
"
;
SP_DEVINFO_DATA
device
=
{
sizeof
(
SP_DEVINFO_DATA
)};
WCHAR
path
[
MAX_PATH
],
filename
[
MAX_PATH
];
const
WCHAR
*
service_name
=
L"winetest"
;
SC_HANDLE
manager
,
service
;
const
CERT_CONTEXT
*
cert
;
int
old_mute_threshold
;
...
...
@@ -504,7 +506,7 @@ BOOL pnp_driver_start( const WCHAR *resource )
old_mute_threshold
=
winetest_mute_threshold
;
winetest_mute_threshold
=
1
;
load_resource
(
resource
,
filename
);
load_resource
(
L"driver.dll"
,
filename
);
ret
=
MoveFileExW
(
filename
,
L"winetest.sys"
,
MOVEFILE_COPY_ALLOWED
|
MOVEFILE_REPLACE_EXISTING
);
ok
(
ret
,
"failed to move file, error %lu
\n
"
,
GetLastError
()
);
...
...
@@ -570,7 +572,7 @@ BOOL pnp_driver_start( const WCHAR *resource )
manager
=
OpenSCManagerW
(
NULL
,
NULL
,
SC_MANAGER_CONNECT
);
ok
(
!!
manager
,
"failed to open service manager, error %lu
\n
"
,
GetLastError
()
);
service
=
OpenServiceW
(
manager
,
L"winetest"
,
SERVICE_START
);
service
=
OpenServiceW
(
manager
,
service_name
,
SERVICE_START
);
ok
(
!!
service
,
"failed to open service, error %lu
\n
"
,
GetLastError
()
);
ret
=
StartServiceW
(
service
,
0
,
NULL
);
...
...
@@ -590,6 +592,16 @@ BOOL pnp_driver_start( const WCHAR *resource )
return
ret
||
GetLastError
()
==
ERROR_SERVICE_ALREADY_RUNNING
;
}
void
hid_device_stop
(
void
)
{
pnp_driver_stop
();
}
BOOL
hid_device_start
(
void
)
{
return
pnp_driver_start
();
}
#define check_hidp_caps( a, b ) check_hidp_caps_( __LINE__, a, b )
static
inline
void
check_hidp_caps_
(
int
line
,
HIDP_CAPS
*
caps
,
const
HIDP_CAPS
*
exp
)
{
...
...
@@ -2809,9 +2821,9 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
status
=
RegSetValueExW
(
hkey
,
L"Context"
,
0
,
REG_BINARY
,
(
void
*
)
context
,
sizeof
(
context
)
);
ok
(
!
status
,
"RegSetValueExW returned %#lx
\n
"
,
status
);
if
(
pnp_driver_start
(
L"driver_hid.dll"
))
test_hid_device
(
report_id
,
polled
,
&
caps
);
if
(
hid_device_start
())
test_hid_device
(
report_id
,
polled
,
&
caps
);
hid_device_stop
();
pnp_driver_stop
();
SetCurrentDirectoryW
(
cwd
);
}
...
...
@@ -3169,7 +3181,7 @@ static void test_hidp_kdr(void)
status
=
RegSetValueExW
(
hkey
,
L"Context"
,
0
,
REG_BINARY
,
(
void
*
)
context
,
sizeof
(
context
)
);
ok
(
!
status
,
"RegSetValueExW returned %#lx
\n
"
,
status
);
if
(
!
pnp_driver_start
(
L"driver_hid.dll"
))
goto
done
;
if
(
!
hid_device_start
(
))
goto
done
;
set
=
SetupDiGetClassDevsW
(
&
GUID_DEVINTERFACE_HID
,
NULL
,
NULL
,
DIGCF_DEVICEINTERFACE
|
DIGCF_PRESENT
);
ok
(
set
!=
INVALID_HANDLE_VALUE
,
"failed to get device list, error %#lx
\n
"
,
GetLastError
()
);
...
...
@@ -3286,7 +3298,7 @@ static void test_hidp_kdr(void)
CloseHandle
(
file
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
SetCurrentDirectoryW
(
cwd
);
}
...
...
@@ -3360,7 +3372,7 @@ BOOL dinput_driver_start_( const char *file, int line, const BYTE *desc_buf, ULO
status
=
RegSetValueExW
(
hkey
,
L"Context"
,
0
,
REG_BINARY
,
(
void
*
)
context
,
sizeof
(
context
)
);
ok_
(
file
,
line
)(
!
status
,
"RegSetValueExW returned %#lx
\n
"
,
status
);
return
pnp_driver_start
(
L"driver_hid.dll"
);
return
hid_device_start
(
);
}
BOOL
dinput_test_init_
(
const
char
*
file
,
int
line
)
...
...
@@ -3395,7 +3407,7 @@ BOOL dinput_test_init_( const char *file, int line )
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
okfile
!=
INVALID_HANDLE_VALUE
,
"failed to create file, error %lu
\n
"
,
GetLastError
()
);
subtest
(
"driver
_hid
"
);
subtest
(
"driver"
);
return
TRUE
;
}
...
...
@@ -3555,9 +3567,9 @@ DWORD WINAPI dinput_test_device_thread( void *stop_event )
status
=
RegSetValueExW
(
hkey
,
L"Context"
,
0
,
REG_BINARY
,
(
void
*
)
context
,
sizeof
(
context
)
);
ok
(
!
status
,
"RegSetValueExW returned %#lx
\n
"
,
status
);
pnp_driver_start
(
L"driver_hid.dll"
);
hid_device_start
(
);
WaitForSingleObject
(
stop_event
,
INFINITE
);
pnp_driver
_stop
();
hid_device
_stop
();
SetCurrentDirectoryW
(
cwd
);
...
...
dlls/dinput/tests/hotplug.c
View file @
f6d2495c
...
...
@@ -185,7 +185,7 @@ static BOOL test_input_lost( DWORD version )
ok
(
hr
==
DI_OK
,
"GetDeviceData returned %#lx
\n
"
,
hr
);
ok
(
count
==
0
,
"got %lu expected 0
\n
"
,
count
);
pnp_driver
_stop
();
hid_device
_stop
();
hr
=
IDirectInputDevice8_GetDeviceState
(
device
,
sizeof
(
state
),
&
state
);
ok
(
hr
==
DIERR_INPUTLOST
,
"GetDeviceState returned %#lx
\n
"
,
hr
);
...
...
@@ -218,7 +218,7 @@ static BOOL test_input_lost( DWORD version )
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
...
...
dlls/dinput/tests/joystick8.c
View file @
f6d2495c
...
...
@@ -2084,7 +2084,7 @@ static void test_simple_joystick( DWORD version )
CloseHandle
(
file
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
winetest_pop_context
();
...
...
@@ -2616,7 +2616,7 @@ static BOOL test_device_types( DWORD version )
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
winetest_pop_context
();
...
...
@@ -2842,7 +2842,7 @@ static void test_driving_wheel_axes(void)
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
winetest_pop_context
();
...
...
@@ -3200,7 +3200,7 @@ static BOOL test_winmm_joystick(void)
CloseHandle
(
file
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
...
...
@@ -3395,7 +3395,7 @@ static void test_windows_gaming_input(void)
IRawGameControllerStatics_Release
(
controller_statics
);
done:
pnp_driver
_stop
();
hid_device
_stop
();
cleanup_registry_keys
();
SetCurrentDirectoryW
(
cwd
);
}
...
...
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