Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
97c92595
Commit
97c92595
authored
Nov 07, 2017
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Handle opportunistic reads.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
92d2ebe6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
device.c
dlls/hidclass.sys/device.c
+24
-4
No files found.
dlls/hidclass.sys/device.c
View file @
97c92595
...
...
@@ -316,7 +316,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
rc
=
WaitForSingleObject
(
ext
->
halt_event
,
ext
->
poll_interval
);
rc
=
WaitForSingleObject
(
ext
->
halt_event
,
ext
->
poll_interval
?
ext
->
poll_interval
:
DEFAULT_POLL_INTERVAL
);
if
(
rc
==
WAIT_OBJECT_0
)
break
;
...
...
@@ -546,9 +546,7 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp)
break
;
}
poll_interval
=
*
(
ULONG
*
)
irp
->
AssociatedIrp
.
SystemBuffer
;
if
(
poll_interval
==
0
)
FIXME
(
"Handle opportunistic reads
\n
"
);
else
if
(
poll_interval
<=
MAX_POLL_INTERVAL_MSEC
)
if
(
poll_interval
<=
MAX_POLL_INTERVAL_MSEC
)
{
extension
->
poll_interval
=
poll_interval
;
irp
->
IoStatus
.
u
.
Status
=
STATUS_SUCCESS
;
...
...
@@ -668,6 +666,7 @@ NTSTATUS WINAPI HID_Device_read(DEVICE_OBJECT *device, IRP *irp)
BASE_DEVICE_EXTENSION
*
ext
=
device
->
DeviceExtension
;
UINT
buffer_size
=
RingBuffer_GetBufferSize
(
ext
->
ring_buffer
);
NTSTATUS
rc
=
STATUS_SUCCESS
;
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
int
ptr
=
-
1
;
packet
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buffer_size
);
...
...
@@ -691,10 +690,31 @@ NTSTATUS WINAPI HID_Device_read(DEVICE_OBJECT *device, IRP *irp)
}
else
{
BASE_DEVICE_EXTENSION
*
extension
=
device
->
DeviceExtension
;
if
(
extension
->
poll_interval
)
{
TRACE_
(
hid_report
)(
"Queue irp
\n
"
);
InsertTailList
(
&
ext
->
irp_queue
,
&
irp
->
Tail
.
Overlay
.
s
.
ListEntry
);
rc
=
STATUS_PENDING
;
}
else
{
HID_XFER_PACKET
packet
;
TRACE
(
"No packet, but opportunistic reads enabled
\n
"
);
packet
.
reportId
=
((
BYTE
*
)
irp
->
AssociatedIrp
.
SystemBuffer
)[
0
];
packet
.
reportBuffer
=
&
((
BYTE
*
)
irp
->
AssociatedIrp
.
SystemBuffer
)[
1
];
packet
.
reportBufferLen
=
irpsp
->
Parameters
.
Read
.
Length
-
1
;
rc
=
call_minidriver
(
IOCTL_HID_GET_INPUT_REPORT
,
device
,
NULL
,
0
,
&
packet
,
sizeof
(
packet
));
if
(
rc
==
STATUS_SUCCESS
)
{
((
BYTE
*
)
irp
->
AssociatedIrp
.
SystemBuffer
)[
0
]
=
packet
.
reportId
;
irp
->
IoStatus
.
Information
=
packet
.
reportBufferLen
+
1
;
irp
->
IoStatus
.
u
.
Status
=
rc
;
}
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
packet
);
return
rc
;
...
...
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