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


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:

Before Posting...

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


MDHMDH Member Posts: 27

Seems like FsRtlIsNameInExpression was made specifically for directory messages but according to the docs, it must be called at PASSIVE while IRP_MJ_DIRECTORY_CONTROL can be called at APC ( Am I missing something here or is it really not safe to call this from the pre-op?


  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,448

    You're fine, FsRtlIsNameInExpression isn't going to do anything that requires an APC. If you want extra proof you can see that FAT calls FsRtlIsNameInExpression in the directory control handler so if it's not safe we're all doomed...(FatQueryDirectory->FatLocateDirent->FsRtlIsNameInExpression)


  • MDHMDH Member Posts: 27

    Thanks Scott. I noticed it also gets called in CDFS as well. So does that mean that it'd also be safe to call when holding a guarded mutex regardless of what this ( says?

    "In particular, kernel routines that are illegal to call at IRQL = APC_LEVEL should not be called from a code path that is protected by either a fast mutex or a guarded mutex."

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,448

    Yes, that would be fine. The Rtl/FsRtl routines are generally overly restrictive in the documentation by saying they require PASSIVE_LEVEL.

    APC_LEVEL or PASSIVE_LEVEL in a Guarded Region mostly don't matter until you try to synchronously call an I/O Zw routine with APCs disabled (because they use APCs to signal completion).


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!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging TBD 2021 Live, Online