none
DRIVER_POWER_STATE_FAILURE (9f) RRS feed

  • 问题

  • *******************************************************************************
    *                                                                             *
    *                        Bugcheck Analysis                                    *
    *                                                                             *
    *******************************************************************************

    Use !analyze -v to get detailed debugging information.

    BugCheck 9F, {500, 2, fffffade70c0d8e0, fffffade70c14a60}

    Probably caused by : diskperf.sys

    Followup: MachineOwner
    ---------

    1: kd> !analyze -v
    *******************************************************************************
    *                                                                             *
    *                        Bugcheck Analysis                                    *
    *                                                                             *
    *******************************************************************************

    DRIVER_POWER_STATE_FAILURE (9f)
    A driver is causing an inconsistent power state.
    Arguments:
    Arg1: 0000000000000500, The device object completed the irp for the system power
     state request, but failed to call PoStartNextPowerIrp.
    Arg2: 0000000000000002
    Arg3: fffffade70c0d8e0, Optional Target device's DEVICE_OBJECT
    Arg4: fffffade70c14a60, DeviceObject

    Debugging Details:
    ------------------


    DRVPOWERSTATE_SUBCODE:  500

    DEVICE_OBJECT: fffffade70c0d8e0

    DRIVER_OBJECT: fffffade70cea5c0

    IMAGE_NAME:  diskperf.sys

    DEBUG_FLR_IMAGE_TIMESTAMP:  53c91c22

    MODULE_NAME: diskperf

    FAULTING_MODULE: fffffade5ba7b000 diskperf

    DEFAULT_BUCKET_ID:  DRIVER_FAULT

    BUGCHECK_STR:  0x9F

    PROCESS_NAME:  System

    CURRENT_IRQL:  0

    LAST_CONTROL_TRANSFER:  from fffff800013dabd7 to fffff8000102e950

    STACK_TEXT: 
    fffffade`5be9bb28 fffff800`013dabd7 : 00000000`0000009f 00000000`00000500 00000000`00000002 fffffade`70c0d8e0 : nt!KeBugCheckEx
    fffffade`5be9bb30 fffff800`013db152 : fffffade`6deb6401 fffffade`6e752f00 fffffade`6deb6450 fffffade`6ec94850 : nt!PopWaitForSystemPowerIrp+0x6a3
    fffffade`5be9bbb0 fffff800`013dad56 : fffffade`6deb6818 00000000`00000002 fffffade`6deb6450 fffffade`6deb6450 : nt!PopNotifyDevice+0xa5
    fffffade`5be9bbe0 fffff800`013da186 : 00000000`00000001 00000000`00000007 00000000`00000000 fffffade`6deb6450 : nt!PopSleepDeviceList+0x14f
    fffffade`5be9bc10 fffff800`013d5a3a : 00000000`00000000 fffff800`013d5760 00000000`00000000 fffff800`011ce980 : nt!PopSetDevicesSystemState+0x318
    fffffade`5be9bc80 fffff800`0103768a : 00000000`00000000 fffff800`011d2300 fffffade`70eea040 fffff800`011d4100 : nt!PopGracefulShutdown+0x2da
    fffffade`5be9bd00 fffff800`0124b972 : fffffade`70eea040 00000000`00000080 fffffade`70eea040 fffffade`5bac3680 : nt!ExpWorkerThread+0x13b
    fffffade`5be9bd70 fffff800`010202d6 : fffffade`5babb180 fffffade`70eea040 fffffade`5bac3680 00000000`00000000 : nt!PspSystemThreadStartup+0x3e
    fffffade`5be9bdd0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!KxStartSystemThread+0x16

    diskperf.sys 是我仿照简单改写的一个磁盘过滤驱动,并没有对IRP_MJ_POWER有任何特殊的处理,一直比较稳定,今天一次普通的覆盖安装,重启的时候机器蓝屏了,系统是Windows server 2003 x64,没搞明白,请大家帮忙分析一下,多谢啦!
    2014年7月19日 2:54

答案

  • Comments

    Beginning with Windows Vista, the driver is not required to call PoStartNextPowerIrp and a call to this routine does not perform a power management operation. However, on Windows Server 2003, Windows XP, and Windows 2000, PoStartNextPowerIrp must be called by every driver in a device stack after the driver is finished with the previous power IRP, if any, and is ready to handle the next power IRP. It must be called once by each driver for every IRP_MN_QUERY_POWER or IRP_MN_SET_POWER request.

    Although power IRPs are completed only once, typically by the bus driver for a device, each driver in the device stack must call PoStartNextPowerIrp as the IRP travels down or back up the stack. Even if a driver fails the IRP, the driver must nevertheless call PoStartNextPowerIrp to signal the power manager that it is ready to handle another power IRP.

    The driver must call PoStartNextPowerIrp while the current IRP stack location points to the current driver. Therefore, this routine must be called before IoCompleteRequest, IoSkipCurrentIrpStackLocation, and PoCallDriver. As a general rule, a driver should call PoStartNextPowerIrp from its IoCompletion routine associated with the IRP or from the callback routine it passed to PoRequestPowerIrp.

    Bus drivers must call PoStartNextPowerIrp before completing each IRP.

    Callers of PoStartNextPowerIrp must be running at IRQL <= DISPATCH_LEVEL.

    IRP_MJ_POWER派遣函数的代码:

    NTSTATUS 
    DiskPerfDispatchPower(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp) {
        PDEVICE_EXTENTION pDeviceExtention = (PDEVICE_EXTENTION)pDeviceObject->DeviceExtension;
    #if (NTDDI_VERSION < NTDDI_VISTA)
        PoStartNextPowerIrp(pIrp);
        IoSkipCurrentIrpStackLocation(pIrp);
        return PoCallDriver(pDeviceExtention->TargetDeviceObject, pIrp);
    #else
        IoSkipCurrentIrpStackLocation(pIrp);
        return IoCallDriver(pDeviceExtention->TargetDeviceObject, pIrp);
    #endif
    } 

    2014年7月19日 3:41