The following table summarizes the IRQL and thread context requirements for file system filter driver dispatch routines.
DriverEntry
Routines are called in the context of a system thread at IRQL = passive_level.
Most drivers 'dispatch routines are called in an arbitrary thread
Context at IRQL = passive_level, with the following exceptions:
- Any highest-level driver's dispatch routines
Are called in the context of the thread that originated the I/O
Request, which is commonly a user-mode application thread.In other words, the dispatch routines of file system drivers
And other highest-level drivers are called in a nonarbitrary thread
Context at IRQL = passive_level.
- TheDispatchread
,Dispatchwrite
, AndDispatchdevicecontrol
Routines of lowest-level device drivers, and of Intermediate Drivers
Layered above them in the system paging path, can be called at IRQL =
Apc_level and in an arbitrary thread context.TheDispatchread
And/orDispatchwrite
Routines, and any other routine that also processes read and/or write
Requests in such a lowest-level device or intermediate driver,Must be resident at all times
.These
Driver routines can neither be pageable or be part of a driver's
Pageable-image section; they must not access any pageable memory
. Furthermore, they shoshould not be dependent on any blocking CALS (suchKewaitforsingleobject
With a nonzero time-out ).
- TheDispatchpower
Routine of drivers in the hibernation and/or paging paths can be called at IRQL = dispatch_level.Dispatchpnp
Routines of such drivers must be prepared to handle PNP irp_mn_device_usage_notification requests.
- TheDispatchpower
Routine of drivers that require inrush power at start-up can be called at IRQL = dispatch_level.
Dispatch routine |
Caller's IRQL: |
Caller's thread context: |
Cleanup |
Passive_level |
Nonarbitrary |
Close |
Apc_level |
Arbitrary |
Create |
Passive_level |
Nonarbitrary |
Devicecontrol (Cipher t paging I/O) |
Passive_level |
Nonarbitrary |
Devicecontrol (paging I/O path) |
Apc_level |
Arbitrary |
Directorycontrol |
Apc_level |
Arbitrary |
Flushbuffers |
Passive_level |
Nonarbitrary |
Fscontrol (generation T paging I/O) |
Passive_level |
Nonarbitrary |
Fscontrol (paging I/O path) |
Apc_level |
Arbitrary |
Lockcontrol |
Passive_level |
Nonarbitrary |
PNP |
Passive_level |
Arbitrary |
Queryea |
Passive_level |
Nonarbitrary |
Queryinformation |
Passive_level |
Nonarbitrary |
Queryquota |
Passive_level |
Nonarbitrary |
Querysecurity |
Passive_level |
Nonarbitrary |
Queryvolumeinfo |
Passive_level |
Nonarbitrary |
Read (partition t paging I/O) |
Passive_level |
Nonarbitrary |
Read (paging I/O path) |
Apc_level |
Arbitrary |
Setea |
Passive_level |
Nonarbitrary |
Setinformation |
Passive_level |
Nonarbitrary |
Setquota |
Passive_level |
Nonarbitrary |
Setsecurity |
Passive_level |
Nonarbitrary |
Setvolumeinfo |
Passive_level |
Nonarbitrary |
Shutdown |
Apc_level |
Arbitrary |
Write (writable t paging I/O) |
Passive_level |
Nonarbitrary |
Write (paging I/O path) |
Apc_level |
Arbitrary |