2

WinDDK 7600.16385.1 と OSR の ddkbuild.cmd を使用して、PCI デバイス用の機能している KMDF ドライバーを更新しています。WLH をターゲットにして、Win7 x86 および x64 でテストしています。

DEVPKEY_Device_LocationPaths プロパティを取得しようとしています。

デバイス マネージャーの [デバイス プロパティの詳細] タブでは、[場所のパス] に期待される値が表示されます...

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

...しかし、EvtDriverDeviceAdd ハンドラーから IoGetDevicePropertyData() を呼び出す ...

    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 );

... 常に STATUS_OBJECT_NAME_NOT_FOUND を返します。

私が試してみました ...

  • 他の DEVPKEY_Device_* 値に対して IoGetDevicePropertyData() を呼び出します。結果は同じです。

  • EvtDevicePrepareHardware ハンドラーで IoGetDevicePropertyData() を呼び出します。結果は同じです。

  • WdfDeviceWdmGetPhysicalDevice() を呼び出して PDO を取得します。結果は同じです

  • WdfDeviceAllocAndQueryProperty()。正しく動作しますが、必要な情報が提供されません。

  • WdfFdoQueryForInterface( GUID_PNP_LOCATION_INTERFACE )。正しく動作しますが、現在のノード (「PCI(0400)」など) しか提供しません。

  • IoGetDevicePropertyData を呼び出すサンプル コードを検索しています。Windows CDROM ストレージ クラス ドライバーのサンプルを見つけましたが、まだ試していないことは何もしていないようです。

それで...何が足りないのですか?

4

1 に答える 1

0

WinHEC 2006 パワーポイントで MS PnP サポートの電子メール アドレスを見つけ、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.

...私が返信したのは...

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.
于 2013-03-15T19:51:34.653 に答える