Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
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/
Hello everyone, i am not really familiar with this VPB structure in the FILE_OBJECT structure, i was reading some sample codes and saw a code use the RealDevice and DeviceObject of the Vpb structure of the \systemroot's FILE_OBJECT, these are my questions :
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 |
Comments
Read the docs.
The VPB links a file system device instance to a volume device instance, because the basic PnP parent- child relationship doesn’t adequately handle this. The DeviceObject field of the VPB points to the Device Object for the file system. The RealDevice field points to the Device Object for Volume (disk). It how you can know “which file system is mounted on this device” and “which device is associated with this file system”... easy, right?
Peter
Peter Viscarola
OSR
@OSRDrivers
Thank you for taking the time to respond, one more question i forgot to ask :
What is the difference between file_object->device_object->vpb vs file_object->vpb
and between file_object->device_object->vpb->RealDevice vs file_object->vpb->RealDevice
(both regarding the systemroot file_objects)
What you’re asking, in essence, is “Which Device Object does the File Object point to?”
The answer is: The Device Object to which the Create that instantiated the File Object was directed.
And... keep in mind that for each I/O operation, the I/O Manager will start the Request with the Device Object at the top of the device stack (devnode) of the Device Object to which the File Object points.
Spend some time in the debugger... you can see all this quite clearly.
Peter
Peter Viscarola
OSR
@OSRDrivers