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
97a6870c
Commit
97a6870c
authored
Sep 10, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8/tests: Read HID_DEVICE_ATTRIBUTES from the registry.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b648e67f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
driver_hid.c
dlls/dinput8/tests/driver_hid.c
+11
-13
hid.c
dlls/dinput8/tests/hid.c
+11
-0
No files found.
dlls/dinput8/tests/driver_hid.c
View file @
97a6870c
...
...
@@ -39,6 +39,7 @@
static
UNICODE_STRING
control_symlink
;
static
unsigned
int
got_start_device
;
static
HID_DEVICE_ATTRIBUTES
attributes
;
static
char
report_descriptor_buf
[
4096
];
static
DWORD
report_descriptor_len
;
static
DWORD
report_id
;
...
...
@@ -228,25 +229,16 @@ static NTSTATUS WINAPI driver_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
break
;
case
IOCTL_HID_GET_DEVICE_ATTRIBUTES
:
{
HID_DEVICE_ATTRIBUTES
*
attr
=
irp
->
UserBuffer
;
ok
(
!
in_size
,
"got input size %u
\n
"
,
in_size
);
ok
(
out_size
==
sizeof
(
*
attr
),
"got output size %u
\n
"
,
out_size
);
ok
(
out_size
==
sizeof
(
attributes
),
"got output size %u
\n
"
,
out_size
);
if
(
out_size
==
sizeof
(
*
attr
))
if
(
out_size
==
sizeof
(
attributes
))
{
ok
(
!
attr
->
Size
,
"got size %u
\n
"
,
attr
->
Size
);
attr
->
Size
=
sizeof
(
*
attr
);
attr
->
VendorID
=
0x1209
;
attr
->
ProductID
=
0x0001
;
attr
->
VersionNumber
=
0xface
;
irp
->
IoStatus
.
Information
=
sizeof
(
*
attr
);
memcpy
(
irp
->
UserBuffer
,
&
attributes
,
sizeof
(
attributes
)
);
irp
->
IoStatus
.
Information
=
sizeof
(
attributes
);
}
ret
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_HID_READ_REPORT
:
{
...
...
@@ -472,6 +464,12 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *registry )
memcpy
(
report_descriptor_buf
,
buffer
+
info_size
,
size
-
info_size
);
report_descriptor_len
=
size
-
info_size
;
RtlInitUnicodeString
(
&
name_str
,
L"Attributes"
);
size
=
info_size
+
sizeof
(
attributes
);
ret
=
ZwQueryValueKey
(
hkey
,
&
name_str
,
KeyValuePartialInformation
,
buffer
,
size
,
&
size
);
ok
(
!
ret
,
"ZwQueryValueKey returned %#x
\n
"
,
ret
);
memcpy
(
&
attributes
,
buffer
+
info_size
,
size
-
info_size
);
driver
->
DriverExtension
->
AddDevice
=
driver_add_device
;
driver
->
DriverUnload
=
driver_unload
;
driver
->
MajorFunction
[
IRP_MJ_PNP
]
=
driver_pnp
;
...
...
dlls/dinput8/tests/hid.c
View file @
97a6870c
...
...
@@ -2301,6 +2301,14 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
#undef REPORT_ID_OR_USAGE_PAGE
#include "pop_hid_macros.h"
static
const
HID_DEVICE_ATTRIBUTES
attributes
=
{
.
Size
=
sizeof
(
HID_DEVICE_ATTRIBUTES
),
.
VendorID
=
0x1209
,
.
ProductID
=
0x0001
,
.
VersionNumber
=
0x0100
,
};
WCHAR
cwd
[
MAX_PATH
],
tempdir
[
MAX_PATH
];
LSTATUS
status
;
HKEY
hkey
;
...
...
@@ -2322,6 +2330,9 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
status
=
RegSetValueExW
(
hkey
,
L"Descriptor"
,
0
,
REG_BINARY
,
(
void
*
)
report_desc
,
sizeof
(
report_desc
)
);
ok
(
!
status
,
"RegSetValueExW returned %#x
\n
"
,
status
);
status
=
RegSetValueExW
(
hkey
,
L"Attributes"
,
0
,
REG_BINARY
,
(
void
*
)
&
attributes
,
sizeof
(
attributes
)
);
ok
(
!
status
,
"RegSetValueExW returned %#x
\n
"
,
status
);
if
(
pnp_driver_start
(
L"driver_hid.dll"
))
test_hid_device
(
report_id
,
polled
);
pnp_driver_stop
();
...
...
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