none
How can I get a class device object instance with the class GUID? RRS feed

  • Question

  • I work on windows 2008 r2 x64. I want to find a class device object instance in kernel.
    For example: disk GUID is {4D36E967-E325-11CE-BFC1-08002BE10318}. Can I get all disk device object instance in kernel with is this GUID?
    • Edited by SoapLee Tuesday, September 3, 2013 6:49 AM
    Tuesday, September 3, 2013 6:48 AM

Answers

  • Drivers do nit have guide, device objects stacks have guids. The guid in the inf is class guid, you can't enumerate that in km. Each pnp.stack can have a device interfacr guid(s), you can call IoGetDeviceInterfaces and then open each sym link to get the top of each stack

    what problem are you trying to solve?


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

    Tuesday, September 3, 2013 2:17 PM

All replies

  • Basically yes though I'm not sure I clearly understand your question.
    Tuesday, September 3, 2013 7:42 AM
  • I found driver config in registry. And every driver has a GUID. So I want to find a way to get PDEVICE_OBJECT address in kernel with this GUID.
    Tuesday, September 3, 2013 7:50 AM
  •  Hi SoapLee

       For WDF  driver,    " WdfFdoInitQueryProperty" DDI help to find out  GUID

        For  WDM driver,    "IoGetDeviceProperty"      DDI help to find out  GUID

    Ranjith



    • Edited by Avata_ Tuesday, September 3, 2013 10:45 AM fffff
    Tuesday, September 3, 2013 10:39 AM
  • Drivers do nit have guide, device objects stacks have guids. The guid in the inf is class guid, you can't enumerate that in km. Each pnp.stack can have a device interfacr guid(s), you can call IoGetDeviceInterfaces and then open each sym link to get the top of each stack

    what problem are you trying to solve?


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

    Tuesday, September 3, 2013 2:17 PM
  • I want to attach a device with could be found with diskpart command. The device could be disk or partition or volume.  So I think I need to find DEVICE_OBJECT with device id first.
    Wednesday, September 4, 2013 2:38 AM
  • you want to enumerate the disk or partition device interface guid, not the device class guid. the API I mentioned above will do that. note that dynamically attaching to pnp stacks after they have started is not supported (although it may appear to work) and you will run into weird scenarios (like not seeing io on existing files already opened before your attach). instead of dynamically attaching, I think your best bet is to install your driver as a class upper filter in the device classes you are interested in so you will be attached to all stacks when they are built up.

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

    Wednesday, September 4, 2013 4:49 AM