?? testpower.c
字號(hào):
#include "usbdriver.h"
NTSTATUS TestPowerIrp(IN PDEVICE_OBJECT fdo,IN PIRP Irp)
{
NTSTATUS ntStatus;
PIO_STACK_LOCATION IrpStack, NextStack;
PDEVICE_EXTENSION pdx;
pdx = fdo->DeviceExtension;
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IrpStack = IoGetCurrentIrpStackLocation (Irp);
switch (IrpStack->MinorFunction) {
case IRP_MN_SET_POWER:
switch (IrpStack->Parameters.Power.Type) {
case SystemPowerState:
break;
case DevicePowerState:
switch (IrpStack->Parameters.Power.State.DeviceState) {
case PowerDeviceD3:
break;
case PowerDeviceD2:
break;
case PowerDeviceD1:
break;
case PowerDeviceD0:
break;
}
break;
}
break;
case IRP_MN_QUERY_POWER:
switch (IrpStack->Parameters.Power.Type) {
case SystemPowerState:
break;
case DevicePowerState:
switch (IrpStack->Parameters.Power.State.DeviceState) {
case PowerDeviceD2:
break;
case PowerDeviceD1:
break;
case PowerDeviceD3:
break;
}
break;
}
break;
default:
;
}
NextStack = IoGetNextIrpStackLocation(Irp);
RtlCopyMemory(NextStack, IrpStack, sizeof(IO_STACK_LOCATION));
ntStatus = IoCallDriver(pdx->LowerDeviceObject, Irp);
if (ntStatus == STATUS_PENDING) {
IoMarkIrpPending(Irp);
}
return ntStatus;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -