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
ae212726
Commit
ae212726
authored
Apr 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Move HID_GET_COLLECTION_* handling inline.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a37cae58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
36 deletions
+19
-36
device.c
dlls/hidclass.sys/device.c
+19
-36
No files found.
dlls/hidclass.sys/device.c
View file @
ae212726
...
...
@@ -375,40 +375,6 @@ void HID_StartDeviceThread(DEVICE_OBJECT *device)
ext
->
u
.
pdo
.
thread
=
CreateThread
(
NULL
,
0
,
hid_device_thread
,
device
,
0
,
NULL
);
}
static
void
handle_IOCTL_HID_GET_COLLECTION_INFORMATION
(
IRP
*
irp
,
BASE_DEVICE_EXTENSION
*
ext
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
sizeof
(
HID_COLLECTION_INFORMATION
))
{
irp
->
IoStatus
.
Status
=
STATUS_BUFFER_OVERFLOW
;
irp
->
IoStatus
.
Information
=
0
;
}
else
{
memcpy
(
irp
->
AssociatedIrp
.
SystemBuffer
,
&
ext
->
u
.
pdo
.
information
,
sizeof
(
HID_COLLECTION_INFORMATION
));
irp
->
IoStatus
.
Information
=
sizeof
(
HID_COLLECTION_INFORMATION
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
}
}
static
void
handle_IOCTL_HID_GET_COLLECTION_DESCRIPTOR
(
IRP
*
irp
,
BASE_DEVICE_EXTENSION
*
ext
)
{
HIDP_COLLECTION_DESC
*
desc
=
ext
->
u
.
pdo
.
device_desc
.
CollectionDesc
;
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
desc
->
PreparsedDataLength
)
{
irp
->
IoStatus
.
Status
=
STATUS_INVALID_BUFFER_SIZE
;
irp
->
IoStatus
.
Information
=
0
;
}
else
{
memcpy
(
irp
->
UserBuffer
,
desc
->
PreparsedData
,
desc
->
PreparsedDataLength
);
irp
->
IoStatus
.
Information
=
desc
->
PreparsedDataLength
;
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
}
}
struct
device_strings
{
const
WCHAR
*
id
;
...
...
@@ -619,12 +585,29 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
}
case
IOCTL_HID_GET_COLLECTION_INFORMATION
:
{
handle_IOCTL_HID_GET_COLLECTION_INFORMATION
(
irp
,
ext
);
irp
->
IoStatus
.
Information
=
sizeof
(
HID_COLLECTION_INFORMATION
);
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
sizeof
(
HID_COLLECTION_INFORMATION
))
irp
->
IoStatus
.
Status
=
STATUS_BUFFER_OVERFLOW
;
else
{
memcpy
(
irp
->
AssociatedIrp
.
SystemBuffer
,
&
ext
->
u
.
pdo
.
information
,
sizeof
(
HID_COLLECTION_INFORMATION
)
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
}
break
;
}
case
IOCTL_HID_GET_COLLECTION_DESCRIPTOR
:
{
handle_IOCTL_HID_GET_COLLECTION_DESCRIPTOR
(
irp
,
ext
);
HIDP_COLLECTION_DESC
*
desc
=
ext
->
u
.
pdo
.
device_desc
.
CollectionDesc
;
irp
->
IoStatus
.
Information
=
desc
->
PreparsedDataLength
;
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
desc
->
PreparsedDataLength
)
irp
->
IoStatus
.
Status
=
STATUS_INVALID_BUFFER_SIZE
;
else
{
memcpy
(
irp
->
UserBuffer
,
desc
->
PreparsedData
,
desc
->
PreparsedDataLength
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
}
break
;
}
case
IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS
:
...
...
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