Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


IoGetDeviceObjectPointer related Question

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi all,
I have a requirement to sent (irp mn)Query interface calls to the PCI root
bus driver. To obtain the device object for the PCI root bus driver, I am
using IoGetDeviceObjectPointer(). Now my question is, how do I get the
deviceobject name of PCI root bus driver,which is the first parameter for
this API.

The only detail that I could look up from the registry is its device
hardware ID which is PNP0A03. ObjDir did not give any clue as to what its
symbolic link is..Any help in the regard is greatly appreciated.

Thanks
Ajith.

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Comments

  • Eliyas_YakubEliyas_Yakub Member Posts: 229
    >To obtain the device object for the PCI root bus driver, I am using
    IoGetDeviceObjectPointer(). Now my question is, how do I get the
    deviceobject name of PCI root bus driver,which is the first parameter for
    this API.

    You can't do that. The IRP_MN_QUERY_INTERFACE requests are meant to be sent
    to the PCI child devices. For that you need the PDO of the individual PCI
    devices. The FDO or PDO of the bus driver wouldn't help you. What are you
    trying to do?

    -Eliyas


    -----Original Message-----
    From: Ajith JayaMohan [mailto:[email protected]]
    Sent: Monday, July 31, 2000 2:52 PM
    To: NT Developers Interest List
    Subject: [ntdev] IoGetDeviceObjectPointer related Question


    Hi all,
    I have a requirement to sent (irp mn)Query interface calls to the PCI root
    bus driver. To obtain the device object for the PCI root bus driver, I am
    using IoGetDeviceObjectPointer(). Now my question is, how do I get the
    deviceobject name of PCI root bus driver,which is the first parameter for
    this API.

    The only detail that I could look up from the registry is its device
    hardware ID which is PNP0A03. ObjDir did not give any clue as to what its
    symbolic link is..Any help in the regard is greatly appreciated.

    Thanks
    Ajith.

    ________________________________________________________________________
    Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    >You can't do that. The IRP_MN_QUERY_INTERFACE requests are meant to ?>be
    >sent to the PCI child devices. For that you need the PDO of the >individual
    >PCI devices. The FDO or PDO of the bus driver wouldn't help >you. What are
    >you trying to do?

    I have a driver that does a PCI Bus Walk and looks for PCI Hot-Plug Slots
    available in the system. The current driver is a WDM driver installed in the
    "Other Devices" category in device manager and uses "HalGetBusData()" and
    "HalGetBusDataByOffset()" to obtain all the PCI Config space information. I
    am trying to replace these calls with PNP calls (IRP_MN_QUERY_INTERFACE)sent
    to the lower stack lower and after obtaining the pci bus standard interface,
    i intend to use equivalent function defined in them instead of HalXxx..().
    But the problem is lower stack device returns STATUS_NOT_SUPPORTED to these
    calls, that is the lower driver does not have this interface.

    The next thing I tried was to convert my driver into a upper filter driver
    for PCI and sent down the required PNP requests when AddDevice gets called
    for PCI root bus. This approach _works_ PROPERLY and I am able to obtain the
    interface. But I think configuring my driver as a upper filter just to
    perform a bus walk is a kinda overkill and would like to obtain the PCI FDO
    directly thro IoGetDeviceObjectPointer call.

    - ajith

    ________________________________________________________________________
    Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
  • Eliyas_YakubEliyas_Yakub Member Posts: 229
    As you might know, FDOs are unnamed and PDOs have auto-generated names. So
    you cannot get hold of the deviceobject pointer using
    IoGetDeviceObjectPointer function. Unfortunately PCI bus driver also doesn't
    register an interface for it's devnode so that you can use the Notification
    mechanism to get the symbolic link. Therefore, the only option left is to be
    an upper filter of the PCI bus.

    -Eliyas

    -----Original Message-----
    From: Ajith JayaMohan [mailto:[email protected]]
    Sent: Tuesday, August 01, 2000 8:14 AM
    To: NT Developers Interest List
    Subject: [ntdev] RE: IoGetDeviceObjectPointer related Question


    >You can't do that. The IRP_MN_QUERY_INTERFACE requests are meant to ?>be
    >sent to the PCI child devices. For that you need the PDO of the >individual

    >PCI devices. The FDO or PDO of the bus driver wouldn't help >you. What are
    >you trying to do?

    I have a driver that does a PCI Bus Walk and looks for PCI Hot-Plug Slots
    available in the system. The current driver is a WDM driver installed in the

    "Other Devices" category in device manager and uses "HalGetBusData()" and
    "HalGetBusDataByOffset()" to obtain all the PCI Config space information. I
    am trying to replace these calls with PNP calls (IRP_MN_QUERY_INTERFACE)sent

    to the lower stack lower and after obtaining the pci bus standard interface,

    i intend to use equivalent function defined in them instead of HalXxx..().
    But the problem is lower stack device returns STATUS_NOT_SUPPORTED to these
    calls, that is the lower driver does not have this interface.

    The next thing I tried was to convert my driver into a upper filter driver
    for PCI and sent down the required PNP requests when AddDevice gets called
    for PCI root bus. This approach _works_ PROPERLY and I am able to obtain the

    interface. But I think configuring my driver as a upper filter just to
    perform a bus walk is a kinda overkill and would like to obtain the PCI FDO
    directly thro IoGetDeviceObjectPointer call.

    - ajith

    ________________________________________________________________________
    Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online