ExAcquireFastMutex and Filemon puzzle

I’m confused: the NT DDK specifically states that in order to call
ExAcquireFastMutex you must be at IRQL < DISPATCH_LEVEL. However, Filemon.c
uses it in a completion routine (see UpdateStore). Unless I am mistaken, it
is completely possible for a completion routine to be called at Dispatch
level. Can someone clarify this?

Thanks.

Neil Weicher

> I’m confused: the NT DDK specifically states that in order to call

ExAcquireFastMutex you must be at IRQL < DISPATCH_LEVEL. However, Filemon.c
uses it in a completion routine (see UpdateStore). Unless I am mistaken, it
is completely possible for a completion routine to be called at Dispatch
level. Can someone clarify this?

Possible, yes, but not certain. Filemon.c doesn’t call it if the IRQL isn’t
Passive, see KeGetCurrentIrql() line.


Regards, Dejan M. CEO Alfa Co. http://www.alfaunits.co.yu and www.register.co.yu

E-mail : xxxxx@alfaunits.co.yu ICQ# : 56570367
Professional file&system related components and libraries for Win32 developers.
Alfa Units - #1 file and system handling units for Delphi.
Alfa File Monitor - #1 file monitoring system for Win32 developers.
Alfa Interceptor - #1 file protection and hiding system for Win32 developers.

Are you looking at old filemon code (v2.x or earlier)? The latest code
calls KeGetCurrentIrql and queues to a worker thread if at DISPATCH_LEVEL.
Old code did make unsafe calls to ExAcquireFastMutex.

-----Original Message-----
From: Neil R. Weicher [mailto:xxxxx@netlib.com]
Sent: Wednesday, October 11, 2000 15:06
To: File Systems Developers
Subject: [ntfsd] ExAcquireFastMutex and Filemon puzzle

I’m confused: the NT DDK specifically states that in order to call
ExAcquireFastMutex you must be at IRQL < DISPATCH_LEVEL. However, Filemon.c
uses it in a completion routine (see UpdateStore). Unless I am mistaken, it
is completely possible for a completion routine to be called at Dispatch
level. Can someone clarify this?

Thanks.

Neil Weicher


You are currently subscribed to ntfsd as: xxxxx@datum.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

> is completely possible for a completion routine to be called at Dispatch

level. Can someone clarify this?

I saw many code which assumes that the CREATE completion routine is called
at < DISPATCH_LEVEL.

Max

This assumption is, of course, not a safe one.

The driver verifier has an optional setting to ensure that all completion
routines for a driver are called at DISPATCH_LEVEL; this can also be enabled
in the kernel debugger (2250) using the “!patch” command.

Completion code should ALWAYS assume that it might be called at
DISPATCH_LEVEL. To write code that assumes otherwise, while it might work
NOW, has the potential for breaking - either in the field with current
versions (e.g., some unusual code path gets exercised) or in a future
version (when, for whatever reason, some FSD developer chooses to perform
the completion at DISPATCH_LEVEL.)

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Wednesday, October 11, 2000 11:53 PM
To: File Systems Developers
Subject: [ntfsd] Re: ExAcquireFastMutex and Filemon puzzle

is completely possible for a completion routine to be called at Dispatch
level. Can someone clarify this?

I saw many code which assumes that the CREATE completion routine is called
at < DISPATCH_LEVEL.

Max


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)