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
8417f634
Commit
8417f634
authored
Apr 10, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl/tests: Handle IRP_MJ_POWER requests.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94037f90
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
driver_pnp.c
dlls/ntoskrnl.exe/tests/driver_pnp.c
+29
-0
No files found.
dlls/ntoskrnl.exe/tests/driver_pnp.c
View file @
8417f634
...
...
@@ -308,6 +308,34 @@ static NTSTATUS WINAPI driver_pnp(DEVICE_OBJECT *device, IRP *irp)
return
pdo_pnp
(
device
,
irp
);
}
static
NTSTATUS
WINAPI
driver_power
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
NTSTATUS
ret
=
STATUS_NOT_SUPPORTED
;
/* We do not expect power IRPs as part of normal operation. */
ok
(
0
,
"unexpected call
\n
"
);
if
(
device
==
bus_fdo
)
{
PoStartNextPowerIrp
(
irp
);
IoSkipCurrentIrpStackLocation
(
irp
);
return
PoCallDriver
(
bus_pdo
,
irp
);
}
if
(
stack
->
MinorFunction
==
IRP_MN_SET_POWER
)
{
if
(
stack
->
Parameters
.
Power
.
Type
==
DevicePowerState
)
PoSetPowerState
(
device
,
DevicePowerState
,
stack
->
Parameters
.
Power
.
State
);
ret
=
STATUS_SUCCESS
;
}
PoStartNextPowerIrp
(
irp
);
irp
->
IoStatus
.
Status
=
ret
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
return
ret
;
}
static
void
test_bus_query_caps
(
DEVICE_OBJECT
*
top_device
)
{
DEVICE_CAPABILITIES
caps
;
...
...
@@ -633,6 +661,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *registry)
driver
->
DriverExtension
->
AddDevice
=
driver_add_device
;
driver
->
DriverUnload
=
driver_unload
;
driver
->
MajorFunction
[
IRP_MJ_PNP
]
=
driver_pnp
;
driver
->
MajorFunction
[
IRP_MJ_POWER
]
=
driver_power
;
driver
->
MajorFunction
[
IRP_MJ_DEVICE_CONTROL
]
=
driver_ioctl
;
driver
->
MajorFunction
[
IRP_MJ_CREATE
]
=
driver_create
;
driver
->
MajorFunction
[
IRP_MJ_CLOSE
]
=
driver_close
;
...
...
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