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/


different to driver attachment

tmtt66tmtt66 Member Posts: 3

Hi,
What is a different between IoGetLowerDeviceObject and IoGetDeviceAttachmentBaseRef?

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,771

    One obvious difference is that IoGetLowerDeviceObject gets the immediate next object down, while IoGetDeviceAttachmentBaseRef goes straight to the bottom.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • tmtt66tmtt66 Member Posts: 3

    so if I have three stack driver on !drvobj sample and then call IoGetDeviceAttachmentBaseRef, I will Attached on level_1?

    !drvobj \filesystem\sample

    Level_1
    sample (lower)
    Level_2
    Level_3
    ?
    or
    Level_1
    Level_2
    Level_3
    sample (upper)

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,771

    No, you misunderstand. Those APIs are only useful when you are already part of a stack. They can tell you what the bottommost device object is, but you can't attach anywhere except the top.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • tmtt66tmtt66 Member Posts: 3

    What happens next after booting the system and on what basis they are placed higher or lower in the drivers stack?

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,771

    Did you search for this information at all? Google is faster than this forum. The rules for file systems are different from the rules for other PnP drivers. For PnP drivers, the order of loading is determined by the order in the LowerFilters and UpperFilters registry values. For file system drivers, it's determined by your load order group, and the order within a single group is random. Note that I am not a file system guy, so I may have misstated the details.

    https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/load-order-groups-for-file-system-filter-drivers

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE