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
d2ad6274
Commit
d2ad6274
authored
Jul 05, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe/tests: Add some HidD_SetFeature tests.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
48b4b99f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
driver_hid.c
dlls/ntoskrnl.exe/tests/driver_hid.c
+19
-0
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+49
-0
No files found.
dlls/ntoskrnl.exe/tests/driver_hid.c
View file @
d2ad6274
...
...
@@ -424,6 +424,25 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
break
;
}
case
IOCTL_HID_SET_FEATURE
:
{
HID_XFER_PACKET
*
packet
=
irp
->
UserBuffer
;
ULONG
expected_size
=
17
;
todo_wine
ok
(
in_size
==
sizeof
(
*
packet
),
"got input size %u
\n
"
,
in_size
);
todo_wine
ok
(
!
out_size
,
"got output size %u
\n
"
,
out_size
);
todo_wine_if
(
packet
->
reportId
!=
report_id
)
ok
(
packet
->
reportId
==
report_id
,
"got packet report id %u
\n
"
,
packet
->
reportId
);
todo_wine_if
(
packet
->
reportBufferLen
==
0
||
packet
->
reportBufferLen
==
16
)
ok
(
packet
->
reportBufferLen
>=
expected_size
,
"got packet buffer len %u, expected %d or more
\n
"
,
packet
->
reportBufferLen
,
expected_size
);
ok
(
!!
packet
->
reportBuffer
,
"got packet buffer %p
\n
"
,
packet
->
reportBuffer
);
irp
->
IoStatus
.
Information
=
3
;
ret
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_HID_GET_STRING
:
ok
(
!
in_size
,
"got input size %u
\n
"
,
in_size
);
ok
(
out_size
==
128
,
"got output size %u
\n
"
,
out_size
);
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
d2ad6274
...
...
@@ -2531,6 +2531,55 @@ static void test_hidp(HANDLE file, int report_id)
ok
(
report
[
0
]
==
report_id
,
"got report[0] %02x, expected %02x
\n
"
,
report
[
0
],
report_id
);
memset
(
report
,
0xcd
,
sizeof
(
report
));
status
=
HidP_InitializeReportForID
(
HidP_Feature
,
report_id
,
preparsed_data
,
report
,
caps
.
FeatureReportByteLength
);
ok
(
status
==
HIDP_STATUS_SUCCESS
,
"HidP_InitializeReportForID returned %#x
\n
"
,
status
);
SetLastError
(
0xdeadbeef
);
ret
=
HidD_SetFeature
(
file
,
report
,
0
);
todo_wine
ok
(
!
ret
,
"HidD_SetFeature succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"HidD_SetFeature returned error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
HidD_SetFeature
(
file
,
report
,
caps
.
FeatureReportByteLength
-
1
);
todo_wine
ok
(
!
ret
,
"HidD_SetFeature succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
ERROR_CRC
),
"HidD_SetFeature returned error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
memset
(
buffer
,
0x5a
,
sizeof
(
buffer
));
ret
=
HidD_SetFeature
(
file
,
buffer
,
caps
.
FeatureReportByteLength
);
if
(
report_id
||
broken
(
!
ret
))
{
todo_wine
ok
(
!
ret
,
"HidD_SetFeature succeeded, last error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
ERROR_CRC
),
"HidD_SetFeature returned error %u
\n
"
,
GetLastError
());
}
else
{
ok
(
ret
,
"HidD_SetFeature failed, last error %u
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
ret
=
HidD_SetFeature
(
file
,
report
,
caps
.
FeatureReportByteLength
);
ok
(
ret
,
"HidD_SetFeature failed, last error %u
\n
"
,
GetLastError
());
value
=
caps
.
FeatureReportByteLength
*
2
;
SetLastError
(
0xdeadbeef
);
ret
=
sync_ioctl
(
file
,
IOCTL_HID_SET_FEATURE
,
NULL
,
0
,
report
,
&
value
);
todo_wine
ok
(
!
ret
,
"IOCTL_HID_SET_FEATURE succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"IOCTL_HID_SET_FEATURE returned error %u
\n
"
,
GetLastError
());
value
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
sync_ioctl
(
file
,
IOCTL_HID_SET_FEATURE
,
report
,
caps
.
FeatureReportByteLength
*
2
,
NULL
,
&
value
);
ok
(
ret
,
"IOCTL_HID_SET_FEATURE failed, last error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
value
==
3
,
"got length %u, expected 3
\n
"
,
value
);
HidD_FreePreparsedData
(
preparsed_data
);
CloseHandle
(
file
);
}
...
...
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