IoDetachDevice in IRQL=Dispatch

Hi,
I wrote a file system filter driver based on the Win 2000 IFS sfilter
sample.
Everything is OK except that on a certain client machine, I get a bug
check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I try to
do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
My code is identical to the one in sfilter.c except for reference counting
of pending IO operations.
Any ideas why the IRQL is 2 or what should I do in such a case ?
The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL

Thanks
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>Sent: Wednesday, May 15, 2002 10:08 AM
>To: File Systems Developers
>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>
>Hi,
>I wrote a file system filter driver based on the Win 2000 IFS sfilter
>sample.
>Everything is OK except that on a certain client machine, I get a bug
>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I try
to
>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>My code is identical to the one in sfilter.c except for reference
counting
>of pending IO operations.
>Any ideas why the IRQL is 2 or what should I do in such a case ?
>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>
>Thanks
>Rami
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

In the dispatch side.
It’s in the “if (irpSp->MinorFunction == IRP_MN_LOAD_FILE_SYSTEM)” block
of the sfilter sample
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>>-----Original Message-----
>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>>Sent: Wednesday, May 15, 2002 10:08 AM
>>To: File Systems Developers
>>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>>
>>Hi,
>>I wrote a file system filter driver based on the Win 2000 IFS sfilter
>>sample.
>>Everything is OK except that on a certain client machine, I get a bug
>>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I try
to
>>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>>My code is identical to the one in sfilter.c except for reference
counting
>>of pending IO operations.
>>Any ideas why the IRQL is 2 or what should I do in such a case ?
>>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>>
>>Thanks
>>Rami
>>
>>—
>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>To unsubscribe send a blank email to %%email.unsub%%

This has been answered countless times in this group. The only place where it’s safe for your file system filter to call IoDetachDevice() is in your FastIoDetachDevice entry point. IoDetachDevice() may work other places, most of the time, when there isn’t any anti-virus software loaded, but it’s not safe, and you certainly shouldn’t release such code to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction == IRP_MN_LOAD_FILE_SYSTEM)” block
of the sfilter sample
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>>-----Original Message-----
>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>>Sent: Wednesday, May 15, 2002 10:08 AM
>>To: File Systems Developers
>>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>>
>>Hi,
>>I wrote a file system filter driver based on the Win 2000 IFS sfilter
>>sample.
>>Everything is OK except that on a certain client machine, I get a bug
>>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I try
to
>>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>>My code is identical to the one in sfilter.c except for reference
counting
>>of pending IO operations.
>>Any ideas why the IRQL is 2 or what should I do in such a case ?
>>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>>
>>Thanks
>>Rami
>>
>>—
>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

Actually, in this particular case it is proper to call IoDetachDevice because this is in the handling of the IRP_MN_LOAD_FILE_SYSTEM FSCTL.

Rami,

I am wondering if you are holding a spin lock while making this call? That is the only reason I can think of that you would be at DPC level.

Just as a side note, is the XP version of the IFSKit and later the samples no longer attach to the Microsoft file system recognizers because there is no reason to. A filter will be properly notified when the real file system activates. We left the code handling IRP_MN_LOAD_FILE_SYSTEM in the samples so developers can see how to do it in case they have a valid reason for it.

Neal Christiansen
Microsoft File System Filter Group
?
This posting is provided “AS IS” with no warranties, and confers no rights.

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Thursday, May 16, 2002 08:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

This has been answered countless times in this group. The only place where it’s safe for your file system filter to call IoDetachDevice() is in your FastIoDetachDevice entry point. IoDetachDevice() may work other places, most of the time, when there isn’t any anti-virus software loaded, but it’s not safe, and you certainly shouldn’t release such code to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction == IRP_MN_LOAD_FILE_SYSTEM)” block
of the sfilter sample
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>>-----Original Message-----
>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>>Sent: Wednesday, May 15, 2002 10:08 AM
>>To: File Systems Developers
>>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>>
>>Hi,
>>I wrote a file system filter driver based on the Win 2000 IFS sfilter
>>sample.
>>Everything is OK except that on a certain client machine, I get a bug
>>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I try
to
>>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>>My code is identical to the one in sfilter.c except for reference
counting
>>of pending IO operations.
>>Any ideas why the IRQL is 2 or what should I do in such a case ?
>>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>>
>>Thanks
>>Rami
>>
>>—
>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

It may also be better to rely on fastiodetachdevice() to remove your
filters. It is the best place to do it; in our experience.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, May 16, 2002 9:28 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

Actually, in this particular case it is proper to call IoDetachDevice
because this is in the handling of the IRP_MN_LOAD_FILE_SYSTEM FSCTL.

Rami,

I am wondering if you are holding a spin lock while making this call?
That is the only reason I can think of that you would be at DPC level.

Just as a side note, is the XP version of the IFSKit and later the
samples no longer attach to the Microsoft file system recognizers
because there is no reason to. A filter will be properly notified when
the real file system activates. We left the code handling
IRP_MN_LOAD_FILE_SYSTEM in the samples so developers can see how to do
it in case they have a valid reason for it.

Neal Christiansen
Microsoft File System Filter Group
?
This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Thursday, May 16, 2002 08:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

This has been answered countless times in this group. The only place
where it’s safe for your file system filter to call IoDetachDevice() is
in your FastIoDetachDevice entry point. IoDetachDevice() may work other
places, most of the time, when there isn’t any anti-virus software
loaded, but it’s not safe, and you certainly shouldn’t release such code
to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction == IRP_MN_LOAD_FILE_SYSTEM)” block
of the sfilter sample
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>>-----Original Message-----
>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>>Sent: Wednesday, May 15, 2002 10:08 AM
>>To: File Systems Developers
>>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>>
>>Hi,
>>I wrote a file system filter driver based on the Win 2000 IFS
sfilter
>>sample.
>>Everything is OK except that on a certain client machine, I get a
bug
>>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I
try
to
>>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>>My code is identical to the one in sfilter.c except for reference
counting
>>of pending IO operations.
>>Any ideas why the IRQL is 2 or what should I do in such a case ?
>>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>>
>>Thanks
>>Rami
>>
>>—
>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

I’m pretty sure calling IoDetachDevice() on dispatch of IRP_MN_LOAD_FILE_SYSTEM is fundamentally wrong. Suppose there is a filter above you that set a completion routine for this IRP. When your filter calls IoDetachDevice() on dispatch, you will invoke the upper filter’s FastIoDetachDevice entry point where a properly written filter will call IoDeleteDevice(). The upper filter’s completion routine will be invoked with its deleted device object. If you’re lucky, the system won’t blue screen.

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Thursday, May 16, 2002 2:18 PM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

It may also be better to rely on fastiodetachdevice() to remove your
filters. It is the best place to do it; in our experience.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, May 16, 2002 9:28 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

Actually, in this particular case it is proper to call IoDetachDevice
because this is in the handling of the IRP_MN_LOAD_FILE_SYSTEM FSCTL.

Rami,

I am wondering if you are holding a spin lock while making this call?
That is the only reason I can think of that you would be at DPC level.

Just as a side note, is the XP version of the IFSKit and later the
samples no longer attach to the Microsoft file system recognizers
because there is no reason to. A filter will be properly notified when
the real file system activates. We left the code handling
IRP_MN_LOAD_FILE_SYSTEM in the samples so developers can see how to do
it in case they have a valid reason for it.

Neal Christiansen
Microsoft File System Filter Group
?
This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Thursday, May 16, 2002 08:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

This has been answered countless times in this group. The only place
where it’s safe for your file system filter to call IoDetachDevice() is
in your FastIoDetachDevice entry point. IoDetachDevice() may work other
places, most of the time, when there isn’t any anti-virus software
loaded, but it’s not safe, and you certainly shouldn’t release such code
to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction == IRP_MN_LOAD_FILE_SYSTEM)” block
of the sfilter sample
Rami

Are you in the dispatch or completion side?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>>-----Original Message-----
>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
>>Sent: Wednesday, May 15, 2002 10:08 AM
>>To: File Systems Developers
>>Subject: [ntfsd] IoDetachDevice in IRQL=Dispatch
>>
>>Hi,
>>I wrote a file system filter driver based on the Win 2000 IFS
sfilter
>>sample.
>>Everything is OK except that on a certain client machine, I get a
bug
>>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I
try
to
>>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
>>My code is identical to the one in sfilter.c except for reference
counting
>>of pending IO operations.
>>Any ideas why the IRQL is 2 or what should I do in such a case ?
>>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
>>
>>Thanks
>>Rami
>>
>>—
>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

Neal,
I’m not holding a spinlock but I have an ERESOURCE acquired using
ExAcquireResourceExclusiveLite.
Do I still need to attach to the MS file system recognizer in Win NT/2000
?

I’m pretty sure calling IoDetachDevice() on dispatch of =
IRP_MN_LOAD_FILE_SYSTEM is fundamentally wrong. Suppose there is a =
filter above you that set a completion routine for this IRP. When your =
filter calls IoDetachDevice() on dispatch, you will invoke the upper =
filter’s FastIoDetachDevice entry point where a properly written filter =
will call IoDeleteDevice(). The upper filter’s completion routine will =
be invoked with its deleted device object. If you’re lucky, the system =
won’t blue screen.

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Thursday, May 16, 2002 2:18 PM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

It may also be better to rely on fastiodetachdevice() to remove your
filters. It is the best place to do it; in our experience.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, May 16, 2002 9:28 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

Actually, in this particular case it is proper to call IoDetachDevice
because this is in the handling of the IRP_MN_LOAD_FILE_SYSTEM FSCTL.

Rami,

I am wondering if you are holding a spin lock while making this call?
That is the only reason I can think of that you would be at DPC level.

Just as a side note, is the XP version of the IFSKit and later the
samples no longer attach to the Microsoft file system recognizers
because there is no reason to. A filter will be properly notified when
the real file system activates. We left the code handling
IRP_MN_LOAD_FILE_SYSTEM in the samples so developers can see how to do
it in case they have a valid reason for it.

Neal Christiansen
Microsoft File System Filter Group
=A0
This posting is provided “AS IS” with no warranties, and confers no
rights.
=20
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]=20
Sent: Thursday, May 16, 2002 08:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

This has been answered countless times in this group. The only place
where it’s safe for your file system filter to call IoDetachDevice() is
in your FastIoDetachDevice entry point. IoDetachDevice() may work other
places, most of the time, when there isn’t any anti-virus software
loaded, but it’s not safe, and you certainly shouldn’t release such code
to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction =3D=3D IRP_MN_LOAD_FILE_SYSTEM)” =
block
of the sfilter sample
Rami

> Are you in the dispatch or completion side?
>=20
> Pete
>=20
> Peter Scott
> xxxxx@KernelDrivers.com
> http://www.KernelDrivers.com
>=20
>=20
> >>-----Original Message-----
> >>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
> >>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
> >>Sent: Wednesday, May 15, 2002 10:08 AM
> >>To: File Systems Developers
> >>Subject: [ntfsd] IoDetachDevice in IRQL=3DDispatch
> >>
> >>Hi,
> >>I wrote a file system filter driver based on the Win 2000 IFS
sfilter
> >>sample.
> >>Everything is OK except that on a certain client machine, I get a
bug
> >>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I
try
> to
> >>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
> >>My code is identical to the one in sfilter.c except for reference
> counting
> >>of pending IO operations.
> >>Any ideas why the IRQL is 2 or what should I do in such a case ?
> >>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
> >>
> >>Thanks
> >>Rami
> >>
> >>—
> >>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
> >>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

There is no reason to attach to the file system recognizers in any
version of NT.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Sunday, May 19, 2002 1:59 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=Dispatch

Neal,
I’m not holding a spinlock but I have an ERESOURCE acquired using
ExAcquireResourceExclusiveLite.
Do I still need to attach to the MS file system recognizer in Win
NT/2000
?

I’m pretty sure calling IoDetachDevice() on dispatch of =
IRP_MN_LOAD_FILE_SYSTEM is fundamentally wrong. Suppose there is a =
filter above you that set a completion routine for this IRP. When
your =
filter calls IoDetachDevice() on dispatch, you will invoke the upper =
filter’s FastIoDetachDevice entry point where a properly written
filter =
will call IoDeleteDevice(). The upper filter’s completion routine
will =
be invoked with its deleted device object. If you’re lucky, the
system =
won’t blue screen.

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Thursday, May 16, 2002 2:18 PM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

It may also be better to rely on fastiodetachdevice() to remove your
filters. It is the best place to do it; in our experience.

Jamey Kirby
StorageCraft, inc.
xxxxx@storagecraft.com
www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal
Christiansen
Sent: Thursday, May 16, 2002 9:28 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

Actually, in this particular case it is proper to call IoDetachDevice
because this is in the handling of the IRP_MN_LOAD_FILE_SYSTEM FSCTL.

Rami,

I am wondering if you are holding a spin lock while making this call?
That is the only reason I can think of that you would be at DPC level.

Just as a side note, is the XP version of the IFSKit and later the
samples no longer attach to the Microsoft file system recognizers
because there is no reason to. A filter will be properly notified
when
the real file system activates. We left the code handling
IRP_MN_LOAD_FILE_SYSTEM in the samples so developers can see how to do
it in case they have a valid reason for it.

Neal Christiansen
Microsoft File System Filter Group
=A0
This posting is provided “AS IS” with no warranties, and confers no
rights.
=20
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]=20
Sent: Thursday, May 16, 2002 08:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

This has been answered countless times in this group. The only place
where it’s safe for your file system filter to call IoDetachDevice()
is
in your FastIoDetachDevice entry point. IoDetachDevice() may work
other
places, most of the time, when there isn’t any anti-virus software
loaded, but it’s not safe, and you certainly shouldn’t release such
code
to paying customers.

-----Original Message-----
From: xxxxx@aliroo.com [mailto:xxxxx@aliroo.com]
Sent: Thursday, May 16, 2002 2:44 AM
To: File Systems Developers
Subject: [ntfsd] RE: IoDetachDevice in IRQL=3DDispatch

In the dispatch side.
It’s in the “if (irpSp->MinorFunction =3D=3D IRP_MN_LOAD_FILE_SYSTEM)”
=
block
of the sfilter sample
Rami

> Are you in the dispatch or completion side?
>=20
> Pete
>=20
> Peter Scott
> xxxxx@KernelDrivers.com
> http://www.KernelDrivers.com
>=20
>=20
> >>-----Original Message-----
> >>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
> >>xxxxx@lists.osr.com] On Behalf Of xxxxx@aliroo.com
> >>Sent: Wednesday, May 15, 2002 10:08 AM
> >>To: File Systems Developers
> >>Subject: [ntfsd] IoDetachDevice in IRQL=3DDispatch
> >>
> >>Hi,
> >>I wrote a file system filter driver based on the Win 2000 IFS
sfilter
> >>sample.
> >>Everything is OK except that on a certain client machine, I get a
bug
> >>check of IRQL_NOT_LESS_OR_EQUAL when the current IRQL is 2 when I
try
> to
> >>do an IoDetachDevice in my IRP_MJ_FILE_SYSTEM_CONTROL handler.
> >>My code is identical to the one in sfilter.c except for reference
> counting
> >>of pending IO operations.
> >>Any ideas why the IRQL is 2 or what should I do in such a case ?
> >>The IFS help says IoDetachDevice mush be called in PASSIVE_LEVEL
> >>
> >>Thanks
> >>Rami
> >>
> >>—
> >>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
> >>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%