none
How To Execute The NVMe Identify Query? RRS feed

  • Question

  • Copying the code located at https://docs.microsoft.com/en-us/windows/desktop/fileio/working-with-nvme-devices#pass-through-mechanism with regards to the NVMe Identify Query, and running it seems to not return any identify information. 

    When I step through the code, I see that the first instance of DeviceIoControl

    result = DeviceIoControl(DeviceList[Index].Handle,
                                 IOCTL_STORAGE_QUERY_PROPERTY,
                                 buffer,
                                 bufferLength,
                                 buffer,
                                 bufferLength,
                                 &returnedLength,
                                 NULL
                                 );

    fails with a GetLastError value of 1 (ERROR_INVALID_FUNCTION).

    If I change the value of

    query->PropertyId = StorageAdapterProtocolSpecificProperty;

    to

    query->PropertyId = StorageDeviceProtocolSpecificProperty;

    this first DeviceIoControl function passes, but I still end up with invalid ProtocolDataLengths later on.

    When I scan the list of attached drives, I can see that my NVMe drive is attached as \\.\PHYSICALDRIVE1.

    Could it possibly be a driver issue?  I'm currently using the Microsoft Inbox driver, which the NVM Express organization says is only compliant to 1.0e?  And I believe my drive is compliant with the 1.2 specifcation.

    Thanks for any insight anyone may be able to offer.

    Friday, June 28, 2019 5:49 PM

All replies

  • can you please let us know what OS version and SDK version you are using?
    Monday, July 8, 2019 8:17 PM
  • For which ProtocolDataRequestValue?
    Tuesday, February 11, 2020 4:24 AM
  • For the system that your compiling the code from would be what were looking for. 

    Additionally to track the ETW logging of the command been send, the user could enable diagnostic events of Stordiag/StorPort through Event Viewer.

    Thursday, March 26, 2020 5:26 PM