Trouble unloading IFS

Hi all,

I am working on a new IFS and I would like to be able to load and unload it
for debug purposes.

I couldn’t ever get it to unload, so, just to test things out I coded up a
very simple driver, actually just a DriverEntry routine. The DriverEntry
routine sets up a DriverUnload routine.

As long as I don’t call IoRegisterFileSystem in DriverEntry, all is fine. I
can load and unload as much as I want. However, as soon as I call
IoRegisterFileSystem in DriverEntry, my DriverUnload is never called
again.
This happens even if I call IoUnregisterFileSystem immediately after I call
IoRegisterFileSystem in DriverEntry.

Am I missing something obvious?

Thanks in advance for any help.

Don


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

This is by design - if you are a base filesystem driver, you cannot
really unload until all your device objects are gone.
The unload routine should be invoked after you delete your last device
(and all references to it are gone).

IoUnregisterFileSystem currently does not ‘dis-remember’ that you were
once a filesystem.

I understand you need it for debug purposes - but unfortunately there’s
no special casing in the kernel that will let you do the unload for
debug purposes without the above condition.

Ravi
-----Original Message-----
From: xxxxx@pinnaclesys.com [mailto:xxxxx@pinnaclesys.com]
Sent: Thursday, October 11, 2001 6:00 PM
To: File Systems Developers
Subject: [ntfsd] Trouble unloading IFS

Hi all,

I am working on a new IFS and I would like to be able to load and unload
it
for debug purposes.

I couldn’t ever get it to unload, so, just to test things out I coded up
a
very simple driver, actually just a DriverEntry routine. The DriverEntry

routine sets up a DriverUnload routine.

As long as I don’t call IoRegisterFileSystem in DriverEntry, all is
fine. I
can load and unload as much as I want. However, as soon as I call
IoRegisterFileSystem in DriverEntry, my DriverUnload is never called
again.
This happens even if I call IoUnregisterFileSystem immediately after I
call
IoRegisterFileSystem in DriverEntry.

Am I missing something obvious?

Thanks in advance for any help.

Don


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks for the response.

I thought I was supposed to delete the FileSystemDeviceObject in the unload
routine. Obviously this is not correct.

So does this mean that it is impossible to unload the driver, or just that
there is something else I need to do. For example, would it be appropriate
to use a custom IOCTL to direct the driver to delete the
FileSystemDeviceObject? In this case there is only one DeviceObject since I
have never mounted any file systems.

Thanks for your help.

Don


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com