none
Driver Verifier fails with power management issue: Previously set IRP_MJ_POWER status has been converted to STATUS_NOT_SUPPORTED... RRS feed

  • Question

  • I've written a KMDF based class storage filter driver. It is simply used to encrypt/decrypt Read/Write Requests. The FilterEvtDeviceAdd function is given below. The release HW function just frees up some memory and returns success. OS: Win8 x64

    Although nothing fancy is done and power management should be handeled by KMDF the driver verifier still stops with the following error. Any ideas?

    Thanks!

    ************************************************************

    Driver Verifier detected violation:

    Previously set IRP_MJ_POWER status has been converted to

    STATUS_NOT_SUPPORTED. This failure status is reserved for use of the OS

    - drivers cannot fail a Power IRP with this value.

    CulpritAddress = FFFFF88001579471, Irp = FFFFF98003022B80.

    ************************************************************

    Break instruction exception - code 80000003 (first chance)

    nt!ViErrorFinishReport+0x72:

    fffff800`f0c506de cc              int     3

    0: kd> u FFFFF88001579471

    CLASSPNP!ClasspPowerDownCompletion+0x931:

    fffff880`01579471 894540          mov     dword ptr [rbp+40h],eax

    fffff880`01579474 488b0d95cc0200  mov     rcx,qword ptr [CLASSPNP!WPP_GLOBAL_Control (fffff880`015a6110)]

    fffff880`0157947b 488d158ecc0200  lea     rdx,[CLASSPNP!WPP_GLOBAL_Control (fffff880`015a6110)]

    fffff880`01579482 483bca          cmp     rcx,rdx

    fffff880`01579485 0f846af9ffff    je      CLASSPNP!ClasspPowerDownCompletion+0x2b5 (fffff880`01578df5)

    fffff880`0157948b 8b512c          mov     edx,dword ptr [rcx+2Ch]

    fffff880`0157948e f6c204          test    dl,4

    fffff880`01579491 0f845ef9ffff    je      CLASSPNP!ClasspPowerDownCompletion+0x2b5 (fffff880`01578df5)

    0: kd> !irp FFFFF98003022B80

    Irp is active with 13 stacks 6 is current (= 0xfffff98003022db8)

    No Mdl: No System Buffer: Thread 00000000:  Irp stack trace. 

         cmd  flg cl Device   File     Completion-Context

    [  0, 0]   0  0 00000000 00000000 00000000-00000000   

                        Args: 00000000 00000000 00000000 00000000

    [  0, 0]   0  0 00000000 00000000 00000000-00000000   

                        Args: 00000000 00000000 00000000 00000000

    [  0, 0]   0  0 00000000 00000000 00000000-00000000   

                        Args: 00000000 00000000 00000000 00000000

    [  0, 0]   0  0 00000000 00000000 00000000-00000000   

                        Args: 00000000 00000000 00000000 00000000

    [ 16, 2]   0 e0 fffffa800da30740 00000000 fffff88001578b40-fffffa800da30c80 Success Error Cancel

                  \Driver\disk CLASSPNP!ClasspPowerDownCompletion

                        Args: 00016600 00000001 00000004 00000005

    >[ 16, 2]   0 e1 fffffa800da30740 00000000 fffff800f0c4d224-fffff98003022e00 Success Error Cancel pending

                  \Driver\disk nt!IovpInternalCompletionTrap

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e0 fffffa800da304b0 00000000 fffff800f0c4d224-fffff98003022e48 Success Error Cancel

                  \DRIVER\VERIFIER_FILTER    nt!IovpInternalCompletionTrap

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e1 fffffa800da30280 00000000 fffff800f0c4d224-fffff98003022e90 Success Error Cancel pending

                  \Driver\dskfltr     nt!IovpInternalCompletionTrap

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e0 fffffa800b5db5c0 00000000 fffff8800126ee40-00000000 Success Error Cancel

                  \DRIVER\VERIFIER_FILTER    partmgr!PmPowerCompletion

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e0 fffffa800b5db090 00000000 fffff800f0c4d224-fffff98003022f20 Success Error Cancel

                  \Driver\partmgr     nt!IovpInternalCompletionTrap

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e0 fffffa800b5e15c0 00000000 fffff800f0c4d224-fffff98003022f68 Success Error Cancel

                  \DRIVER\VERIFIER_FILTER    nt!IovpInternalCompletionTrap

                        Args: 00016600 00000001 00000004 00000005

    [ 16, 2]   0 e1 fffffa800b5e75c0 00000000 fffff800f07200e0-fffffa800b479da0 Success Error Cancel pending

                  \DRIVER\VERIFIER_FILTER    nt!PopRequestCompletion

                        Args: 00016600 00000001 00000004 00000005

    [  0, 0]   0  0 00000000 00000000 00000000-fffffa800b479da0   

                        Args: 00000000 00000000 00000000 00000000

    NTSTATUS
    FilterEvtDeviceAdd(
        IN WDFDRIVER        Driver,
        IN PWDFDEVICE_INIT  DeviceInit
        )
    {
        WDF_OBJECT_ATTRIBUTES deviceAttributes;
        WDF_OBJECT_ATTRIBUTES queueAttributes;
        PFILTER_EXTENSION filterExt;
        NTSTATUS status;
        WDFDEVICE device;
        WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks;

        UNREFERENCED_PARAMETER(Driver);
        WdfFdoInitSetFilter(DeviceInit);
    WdfDeviceInitSetDeviceType(DeviceInit,
                                   FILE_DEVICE_UNKNOWN);

    WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
    pnpPowerCallbacks.EvtDeviceReleaseHardware = FilterEvtReleaseHardware;
        WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);

        WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, FILTER_EXTENSION);

        status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device);
        if (!NT_SUCCESS(status))
    {
            KdPrintEx((DPFLTR_IHVAUDIO_ID, 0, "WdfDeviceCreate failed with status code 0x%x\n", status));
            return status;
        }

        filterExt = FilterGetData(device);

        WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&ioQueueConfig,
                                 WdfIoQueueDispatchSequential);

    ioQueueConfig.EvtIoWrite = FilterEvtIoReadWrite;
    ioQueueConfig.EvtIoRead = FilterEvtIoReadWrite;

    WDF_OBJECT_ATTRIBUTES_INIT(&queueAttributes);

    queueAttributes.ExecutionLevel = WdfExecutionLevelPassive;

    status = WdfIoQueueCreate(device,
                                &ioQueueConfig,
                                &queueAttributes,
    &filterExt->WdfQueue // pointer to default queue
                                );
        if (!NT_SUCCESS(status))
    {
            KdPrintEx((DPFLTR_IHVAUDIO_ID, 0, "WdfIoQueueCreate failed 0x%x\n", status));
            return status;
        }

     [...]
    KdPrintEx((DPFLTR_IHVAUDIO_ID, 0, "Added Device (Drv Version: Build Date(%s) Time(%s))\n", __DATE__, __TIME__));

        return STATUS_SUCCESS;
    }

    Wednesday, November 28, 2012 4:48 PM

Answers

  • This seems to be a known issue in CLASSPNP!ClasspPowerDownCompletion. We will follow up with classpnp.sys. You should be able to ignore this issue for now (via debugger).<o:p></o:p>

    Monday, March 3, 2014 3:48 PM

All replies

  • I suspect the WdfDefault in your drivers case is WdfFalse and since you have not provided power management functions the requests are being failed with STATUS_UNSUCCESSFUL.  You might try changing the PowerManaged value of ioQueueConfig and seeing what occurs.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, November 28, 2012 4:57 PM
  • Thanks for your quick reply!! Unfortunately, driver verifier still stops with the same error. I've also registered some more pnp power event callbacks (see code) - still no luck. Do you have any other idea how I can get closer to the issue? I've also included my Release Hardware event function below.

    Thanks again for your help!

    NTSTATUS FilterEvtReleaseHardware(

    __in WDFDEVICE Device,
    __in WDFCMRESLIST ResourcesTranslated)
    {
        PFILTER_EXTENSION filterExt;

        UNREFERENCED_PARAMETER(ResourcesTranslated);

        filterExt = FilterGetData(Device);

    // No more orders will be received...
    WdfIoQueueDrain(filterExt->WdfQueue, NULL, NULL);

    [...]
    KdPrintEx((DPFLTR_IHVAUDIO_ID, 0, "Release HW done.\n"));
    return STATUS_SUCCESS;
    }

    NTSTATUS
    FilterEvtDeviceAdd(
        IN WDFDRIVER        Driver,
        IN PWDFDEVICE_INIT  DeviceInit
        )
    {

    [...]

    WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
    pnpPowerCallbacks.EvtDeviceReleaseHardware = FilterEvtReleaseHardware;

    // Just return success

    pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware;
    pnpPowerCallbacks.EvtDeviceD0Entry = EvtDeviceD0Entry;
    pnpPowerCallbacks.EvtDeviceD0Exit = EvtDeviceD0Exit;
        WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);

        WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, FILTER_EXTENSION);

        status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device);
        if (!NT_SUCCESS(status))
    {
            KdPrintEx((DPFLTR_IHVAUDIO_ID, 0, "WdfDeviceCreate failed with status code 0x%x\n", status));
            return status;
        }

        filterExt = FilterGetData(device);

        WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&ioQueueConfig,
                                 WdfIoQueueDispatchSequential);

    ioQueueConfig.EvtIoWrite = FilterEvtIoReadWrite;
    ioQueueConfig.EvtIoRead = FilterEvtIoReadWrite;
    ioQueueConfig.PowerManaged = WdfTrue;

    WDF_OBJECT_ATTRIBUTES_INIT(&queueAttributes);

    queueAttributes.ExecutionLevel = WdfExecutionLevelPassive;

    status = WdfIoQueueCreate(device,
                                &ioQueueConfig,
                                &queueAttributes,
    &filterExt->WdfQueue // pointer to default queue
                                );

    [...]

    }

    Thursday, November 29, 2012 11:51 AM
  • I am writing disk filter driver. I am getting same issue. I am not registering pnp callbacks in device add routine. Did you get over this issue? I am not able to reproduce, it occurs sometime on its own and I just can't help it.
    Monday, March 3, 2014 2:10 PM
  • This seems to be a known issue in CLASSPNP!ClasspPowerDownCompletion. We will follow up with classpnp.sys. You should be able to ignore this issue for now (via debugger).<o:p></o:p>

    Monday, March 3, 2014 3:48 PM
  • Thanks.
    Tuesday, March 4, 2014 5:24 AM