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
5a066684
Commit
5a066684
authored
Jan 11, 2016
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Implement IOCTL_HID_GET_FEATURE.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ba84b647
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
device.c
dlls/hidclass.sys/device.c
+37
-0
No files found.
dlls/hidclass.sys/device.c
View file @
5a066684
...
...
@@ -430,6 +430,40 @@ static NTSTATUS handle_minidriver_string(DEVICE_OBJECT *device, IRP *irp, SHORT
return
STATUS_SUCCESS
;
}
static
NTSTATUS
HID_get_feature
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
HID_XFER_PACKET
*
packet
;
DWORD
len
;
NTSTATUS
rc
=
STATUS_SUCCESS
;
WCHAR
*
out_buffer
;
irp
->
IoStatus
.
Information
=
0
;
out_buffer
=
(
WCHAR
*
)(((
BYTE
*
)
irp
->
MdlAddress
->
StartVa
)
+
irp
->
MdlAddress
->
ByteOffset
);
TRACE_
(
hid_report
)(
"Device %p Buffer length %i Buffer %p
\n
"
,
device
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
out_buffer
);
len
=
sizeof
(
*
packet
)
+
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
packet
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
packet
->
reportBufferLen
=
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
packet
->
reportBuffer
=
((
BYTE
*
)
packet
)
+
sizeof
(
*
packet
);
packet
->
reportId
=
out_buffer
[
0
];
TRACE_
(
hid_report
)(
"(id %i, len %i buffer %p)
\n
"
,
packet
->
reportId
,
packet
->
reportBufferLen
,
packet
->
reportBuffer
);
rc
=
call_minidriver
(
IOCTL_HID_GET_FEATURE
,
device
,
NULL
,
0
,
packet
,
len
);
irp
->
IoStatus
.
u
.
Status
=
rc
;
if
(
irp
->
IoStatus
.
u
.
Status
==
STATUS_SUCCESS
)
irp
->
IoStatus
.
Information
=
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
else
irp
->
IoStatus
.
Information
=
0
;
TRACE_
(
hid_report
)(
"Result 0x%x get %li bytes
\n
"
,
rc
,
irp
->
IoStatus
.
Information
);
return
rc
;
}
NTSTATUS
WINAPI
HID_Device_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
NTSTATUS
rc
=
STATUS_SUCCESS
;
...
...
@@ -545,6 +579,9 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp)
}
break
;
}
case
IOCTL_HID_GET_FEATURE
:
rc
=
HID_get_feature
(
device
,
irp
);
break
;
default:
{
ULONG
code
=
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
;
...
...
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