none
How to get "device instance id" by PDO?

    Question

  • My driver get a PDO(which belong to other driver), i want to know the "device instance id", What should I do?

    • Edited by lianglei Tuesday, April 10, 2012 1:46 PM
    Tuesday, April 10, 2012 10:48 AM

Answers

  • do you want the device instance  path, ie <enumerator>\<instance id>\<path> or just the instance id?  Don's link will give you the instance ID, the instance ID path is intentionally not exposed in kernel mode.

    why do you need the path? What bigger problem are you trying to solve?

    if it is to open the registry key, use IoOpenDeviceRegistryKey


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, April 10, 2012 4:24 PM

All replies

  • Why? What's the end result? I do believe there are IOCTLs that allow you to query that information, so why would you not use them?

    Gary G. Little NanoTelesis Systems, LLC

    Tuesday, April 10, 2012 12:27 PM
  • Could you tell me what IOCTL, thanks a lot.
    Tuesday, April 10, 2012 12:45 PM
  • Sorry, but I'll leave the task of doing that research to you. Also look at the SetipApi documentation and functionality. You may need to study the DevCon source that you can find in the WDK.

    Gary G. Little NanoTelesis Systems, LLC

    Tuesday, April 10, 2012 12:51 PM
  • There is no easy documented way to get instance IDs in kernel mode.

    -- pa

    Tuesday, April 10, 2012 2:44 PM
  • Take a look atr http://msdn.microsoft.com/en-us/library/windows/hardware/ff551679(v=vs.85).aspx


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

    Tuesday, April 10, 2012 4:14 PM
  • do you want the device instance  path, ie <enumerator>\<instance id>\<path> or just the instance id?  Don's link will give you the instance ID, the instance ID path is intentionally not exposed in kernel mode.

    why do you need the path? What bigger problem are you trying to solve?

    if it is to open the registry key, use IoOpenDeviceRegistryKey


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, April 10, 2012 4:24 PM
  • I really want device instance path, It's seem I have to look for other method to solve my problem. Thank you very much.
    Wednesday, April 11, 2012 1:04 AM
  • what problem are you trying to solve? there are probably documented ways to solve it that don't directly deal with the device instance path.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, April 11, 2012 3:42 AM