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
d03b8780
Commit
d03b8780
authored
Oct 08, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Implement sending IRP_MJ_POWER to the minidriver.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fdc6db8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
pnp.c
dlls/hidclass.sys/pnp.c
+18
-0
No files found.
dlls/hidclass.sys/pnp.c
View file @
d03b8780
...
...
@@ -86,6 +86,22 @@ static NTSTATUS PNP_SendPnPIRP(DEVICE_OBJECT *device, UCHAR minor)
return
SendDeviceIRP
(
device
,
irp
);
}
static
NTSTATUS
PNP_SendPowerIRP
(
DEVICE_OBJECT
*
device
,
DEVICE_POWER_STATE
power
)
{
IO_STATUS_BLOCK
irp_status
;
IO_STACK_LOCATION
*
irpsp
;
IRP
*
irp
=
IoBuildSynchronousFsdRequest
(
IRP_MJ_POWER
,
device
,
NULL
,
0
,
NULL
,
NULL
,
&
irp_status
);
irpsp
=
IoGetNextIrpStackLocation
(
irp
);
irpsp
->
MinorFunction
=
IRP_MN_SET_POWER
;
irpsp
->
Parameters
.
Power
.
Type
=
DevicePowerState
;
irpsp
->
Parameters
.
Power
.
State
.
DeviceState
=
power
;
return
SendDeviceIRP
(
device
,
irp
);
}
NTSTATUS
WINAPI
PNP_AddDevice
(
DRIVER_OBJECT
*
driver
,
DEVICE_OBJECT
*
PDO
)
{
DEVICE_OBJECT
*
device
=
NULL
;
...
...
@@ -222,6 +238,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
ext
->
ring_buffer
=
RingBuffer_Create
(
sizeof
(
HID_XFER_PACKET
)
+
ext
->
preparseData
->
caps
.
InputReportByteLength
);
HID_StartDeviceThread
(
device
);
PNP_SendPowerIRP
(
device
,
PowerDeviceD0
);
return
STATUS_SUCCESS
;
}
...
...
@@ -236,6 +253,7 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver)
if
(
tracked_device
->
minidriver
->
DriverObject
==
driver
)
{
list_remove
(
&
tracked_device
->
entry
);
PNP_SendPowerIRP
(
tracked_device
->
FDO
,
PowerDeviceD3
);
PNP_SendPnPIRP
(
tracked_device
->
FDO
,
IRP_MN_REMOVE_DEVICE
);
HID_DeleteDevice
(
tracked_device
->
minidriver
,
tracked_device
->
FDO
);
HeapFree
(
GetProcessHeap
(),
0
,
tracked_device
);
...
...
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