2

I'm updating a functioning KMDF driver for a PCI device, using WinDDK 7600.16385.1 and OSR's ddkbuild.cmd, targeting WLH, testing on Win7 x86 and x64.

I'm attempting to retrieve the DEVPKEY_Device_LocationPaths property.

The Device Manager Device Properties Details tab displays the expected value in "Location Paths" ...

PCIROOT(0)#PCI(1C00)#PCI(0000)#PCI(0200)#PCI(0000)#PCI(0900)#PCI(0000)#PCI(0400)

... but calling IoGetDevicePropertyData() from the EvtDriverDeviceAdd handler ...

    PDEVICE_OBJECT pWdmPDO = WdfFdoInitWdmGetPhysicalDevice( pDeviceInit );

    [... WdfDeviceCreate succeeds ...]

    WCHAR wszLocationStrings[128] = { 0 }; // Temporary, just to confirm DDI works
    ULONG ulRequiredSize = 0;
    DEVPROPTYPE devPropType = 0;

    status = IoGetDevicePropertyData( pWdmPDO,
                                      &DEVPKEY_Device_LocationPaths,
                                      LOCALE_NEUTRAL,
                                      /*ulFlags*/ 0,
                                      sizeof(wszLocationStrings),
                                      wszLocationStrings,
                                      &ulRequiredSize,
                                      &devPropType );

... always returns STATUS_OBJECT_NAME_NOT_FOUND.

I have tried ...

  • calling IoGetDevicePropertyData() for other DEVPKEY_Device_* values. The result is the same.

  • calling IoGetDevicePropertyData() in the EvtDevicePrepareHardware handler. The result is the same.

  • calling WdfDeviceWdmGetPhysicalDevice() to retrieve the PDO. The result is the same

  • WdfDeviceAllocAndQueryProperty(). It works correctly but does not provide the info I require.

  • WdfFdoQueryForInterface( GUID_PNP_LOCATION_INTERFACE ). It works correctly but only provides the current node (i.e. "PCI(0400)")

  • Searching for sample code that calls IoGetDevicePropertyData. I found the Windows CDROM Storage Class Driver sample but it doesn't appear to do anything I haven't tried already.

So ... what am I missing?

dr-stevep
  • 31
  • 3

1 Answers1

0

I found a MS PnP support email address in a WinHEC 2006 powerpoint and received a response from Microsoft ...

On Vista and Windows 7, IoGetDevicePropertyData cannot retrieve all the DEVPKEY
properties that user-mode can. There is no way for you to directly retrieve that
full path as created by the operating system from kernel mode.

For further questions, the Windows Hardware WDK and Driver Development forum 
(http://social.msdn.microsoft.com/Forums/en-US/wdk/threads ) is a good place to
ask driver development questions.

... to which I responded ...

Thank you very much to your quick response!

It would be very helpful if the IoGetDevicePropertyData online docs could be updated
to include a list of the DEVPKEY properties that are supported and restrictions on
their availability (i.e. only after Start IRP completes as noted in the WinHEC 
powerpoint)

And thanks for the link to the forum, I'll start there next time.
dr-stevep
  • 31
  • 3