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
d40d8d96
Commit
d40d8d96
authored
Sep 14, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Drop input packets with unexpected length in non-polled mode.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
880d7a11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
hid.c
dlls/dinput8/tests/hid.c
+0
-3
device.c
dlls/hidclass.sys/device.c
+6
-4
No files found.
dlls/dinput8/tests/hid.c
View file @
d40d8d96
...
...
@@ -2187,7 +2187,6 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
/* first read should be completed */
ret
=
GetOverlappedResult
(
async_file
,
&
overlapped
,
&
value
,
TRUE
);
ok
(
ret
,
"GetOverlappedResult failed, last error %u
\n
"
,
GetLastError
()
);
todo_wine
ok
(
value
==
caps
.
InputReportByteLength
,
"got length %u, expected %u
\n
"
,
value
,
caps
.
InputReportByteLength
);
/* second read should still be pending */
Sleep
(
50
);
...
...
@@ -2206,13 +2205,11 @@ static void test_hidp( HANDLE file, HANDLE async_file, int report_id, BOOL polle
ret
=
GetOverlappedResult
(
async_file
,
&
overlapped2
,
&
value
,
TRUE
);
ok
(
ret
,
"GetOverlappedResult failed, last error %u
\n
"
,
GetLastError
()
);
todo_wine
ok
(
value
==
caps
.
InputReportByteLength
,
"got length %u, expected %u
\n
"
,
value
,
caps
.
InputReportByteLength
);
off
=
report_id
?
0
:
1
;
todo_wine
ok
(
memcmp
(
report
,
buffer
,
caps
.
InputReportByteLength
),
"expected different report
\n
"
);
todo_wine
ok
(
!
memcmp
(
report
+
off
,
report
+
caps
.
InputReportByteLength
,
caps
.
InputReportByteLength
-
off
),
"expected identical reports
\n
"
);
todo_wine
...
...
dlls/hidclass.sys/device.c
View file @
d40d8d96
...
...
@@ -246,7 +246,8 @@ static DWORD CALLBACK hid_device_thread(void *args)
HIDP_COLLECTION_DESC
*
desc
=
ext
->
u
.
pdo
.
device_desc
.
CollectionDesc
;
HIDP_REPORT_IDS
*
reports
=
ext
->
u
.
pdo
.
device_desc
.
ReportIDs
;
ULONG
report_count
=
ext
->
u
.
pdo
.
device_desc
.
ReportIDsLength
;
ULONG
i
,
report_id
=
0
,
poll_interval
=
0
;
BOOL
polled
=
ext
->
u
.
pdo
.
information
.
Polled
;
ULONG
i
,
report_id
=
0
,
timeout
=
0
;
HID_XFER_PACKET
*
packet
;
IO_STATUS_BLOCK
io
;
BYTE
*
buffer
;
...
...
@@ -256,7 +257,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
buffer
=
(
BYTE
*
)(
packet
+
1
);
packet
->
reportBuffer
=
buffer
;
if
(
ext
->
u
.
pdo
.
information
.
Polled
)
poll_interval
=
ext
->
u
.
pdo
.
poll_interval
;
if
(
polled
)
timeout
=
ext
->
u
.
pdo
.
poll_interval
;
for
(
i
=
0
;
i
<
report_count
;
++
i
)
{
...
...
@@ -288,10 +289,11 @@ static DWORD CALLBACK hid_device_thread(void *args)
packet
->
reportBuffer
=
buffer
;
packet
->
reportBufferLen
=
io
.
Information
;
hid_device_queue_input
(
device
,
packet
);
if
(
polled
||
io
.
Information
==
desc
->
InputLength
)
hid_device_queue_input
(
device
,
packet
);
}
res
=
WaitForSingleObject
(
ext
->
u
.
pdo
.
halt_event
,
poll_interval
);
res
=
WaitForSingleObject
(
ext
->
u
.
pdo
.
halt_event
,
timeout
);
}
while
(
res
==
WAIT_TIMEOUT
);
TRACE
(
"device thread exiting, res %#x
\n
"
,
res
);
...
...
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