- question from sfilter
- Posted by Min Wang on February 24th, 2005
Hi all,
Suppose I have two file system filters(mostly copied from sfilter): A and B.
A calls IoRegisterFsRegistrationChange before B does. As a result, when a
file system driver C calls IoRegisterFileSystem, B will be notified before
A. Therefore, B will attach to C and A will attach to B.
C<-B<-A
When C calls IoUnregisterFileSystem, B will still be notified before A. B
will call SfDetachFromFileSystemDevice, the same as sfilter does:
VOID SfDetachFromFileSystemDevice(IN PDEVICE_OBJECT DeviceObject)
{
PDEVICE_OBJECT ourAttachedDevice = DeviceObject->AttachedDevice;
while (NULL != ourAttachedDevice) {
if (IS_MY_DEVICE_OBJECT( ourAttachedDevice ))
{
IoDetachDevice( DeviceObject );
IoDeleteDevice( ourAttachedDevice );
return;
}
DeviceObject = ourAttachedDevice;
ourAttachedDevice = ourAttachedDevice->AttachedDevice;
}
}
The problem is, when B calls IoDetachDevice and IoDeleteDevice, it's still
attached by A. So when A get the notification, DeviceObject->AttachedDevice
will be empty and A's filter device object will never have a chance to get
deleted.
Is there anything wrong in my understanding?
Thanks
- Re: I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason s (Desktops) by fastlarry@bellsouth.net
- Re: I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason s (Desktops) by johnvonlaws@hotmail.com
- Re: I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason s (Desktops) by Sammy \The Bull\ Gravano
- Re: I want to ask you the most important question of your life. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? The reason s (Desktops) by David Ames
- Bug in sfilter sample of IFS (Drivers) by finecats

