FSD unregister/unload questions

Hi,

I have a legacy FSD (not a filter driver), which did a
IoRegisterFileSystem during DriverEntry. It properly
handles mount/dismount requests & cleanly deletes all
device objects after a dismount (except the FSD control
device… I verified this via Sysinternals DeviceTree utility,
and also by walking the DriverObject->DeviceObject list).

I have to questions:

  1. If I call IoUnregisterFileSystem() during DriverUnload
    (like during machine-shutdown), it simply hangs (and hence
    requires a power-reset).

  2. Is “sc.exe stop myFSD” supposed to work?
    I can always start myFSD via “sc.exe start myFSD”.
    If I try the “sc stop” to test the DriverUnload,
    apparently myFSD’s DriverUnload never gets called
    and it dumps something like:

SERVICE_NAME: myFSD
TYPE : 2 FILE_SYSTEM_DRIVER
STATE : 3 STOP_PENDING
(STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE: 0 (0x00)
SERVICE_EXIT_CODE: 0 (0x00)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

Any clues?
Thanks,

-Vipul.

Look at the call in FastFat to the unregister call. Are you doing it
because of the same request? If you don’t have the IFS Kit, get it.

----- Original Message -----
From: “Vipul”
To: “File Systems Developers”
Sent: Tuesday, September 24, 2002 4:00 PM
Subject: [ntfsd] FSD unregister/unload questions

> Hi,
>
> I have a legacy FSD (not a filter driver), which did a
> IoRegisterFileSystem during DriverEntry. It properly
> handles mount/dismount requests & cleanly deletes all
> device objects after a dismount (except the FSD control
> device… I verified this via Sysinternals DeviceTree utility,
> and also by walking the DriverObject->DeviceObject list).
>
> I have to questions:
>
> 1. If I call IoUnregisterFileSystem() during DriverUnload
> (like during machine-shutdown), it simply hangs (and hence
> requires a power-reset).
>
> 2. Is “sc.exe stop myFSD” supposed to work?
> I can always start myFSD via “sc.exe start myFSD”.
> If I try the “sc stop” to test the DriverUnload,
> apparently myFSD’s DriverUnload never gets called
> and it dumps something like:
>
> SERVICE_NAME: myFSD
> TYPE : 2 FILE_SYSTEM_DRIVER
> STATE : 3 STOP_PENDING
> (STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
> WIN32_EXIT_CODE: 0 (0x00)
> SERVICE_EXIT_CODE: 0 (0x00)
> CHECKPOINT : 0x0
> WAIT_HINT : 0x0
>
> Any clues?
> Thanks,
>
> -Vipul.
> —
> You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to %%email.unsub%%

Hi,

your unload routine will not be called as long as you are registered as a
file system. You need to unregister before trying to unload the driver. To
do this write a tool which issues a private IOCTL which unregisters your
FSD. Then unload.

I don’t know what sc.exe is (I guess it), but “net start myFsd” and “net
stop myFsd” work fine, if you’ve unregistered before stopping.

Best regards,
Detlef.