-
Notifications
You must be signed in to change notification settings - Fork 1
/
power.c
47 lines (40 loc) · 1.25 KB
/
power.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* PROJECT: ReactOS Virtual USB HCI Driver
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Power functions
* PROGRAMMER: Thomas Faber <[email protected]>
*/
#include "usbvhci.h"
_Use_decl_annotations_
NTSTATUS
NTAPI
VhciDispatchPower(
PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
NTSTATUS Status;
PVHCI_FDO_DEVICE_EXTENSION FdoExtension;
PIO_STACK_LOCATION IoStack;
FdoExtension = DeviceObject->DeviceExtension;
NT_ASSERT(FdoExtension->Common.DeviceObject == DeviceObject);
IoStack = IoGetCurrentIrpStackLocation(Irp);
if (FdoExtension->Common.Signature == VHCI_FDO_SIGNATURE)
{
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(FdoExtension->LowerDevice, Irp);
}
NT_ASSERT(FdoExtension->Common.Signature == VHCI_PDO_SIGNATURE);
Status = Irp->IoStatus.Status;
switch (IoStack->MinorFunction)
{
case IRP_MN_QUERY_POWER:
case IRP_MN_SET_POWER:
Status = STATUS_SUCCESS;
break;
}
Irp->IoStatus.Status = Status;
PoStartNextPowerIrp(Irp);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}