Microsoft Windows CE 3.0  

Loading and Unloading a File System

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Block device drivers need to perform certain tasks to work correctly with Windows CE file systems. When the driver receives DISK_IOCTL_INITIALIZED in its DSK_IOControlfunction, it also receives a pointer to a POST_INIT_BUFstructure. This structure lists the driver's registry key, which the driver can use to retrieve the name of a file system driver. The driver must pass that name and a device-specific handle also present in the structure to the LoadFSDfunction. The Device Manager then loads the correct file system driver. The file system driver name should never be hard-coded into a block device driver; it should always be retrieved from the registry. Hard-coding the file system driver name means that your block device driver could stop working if later versions of Windows CE use different names for their file system drivers.

The block device driver should be prepared to accept I/O control requests as soon as it calls LoadFSD, even if LoadFSDhas not yet returned. Because of the way the Device Manager implements LoadFSD, it is possible for the file system driver to be loaded and to issue a request to your block device driver before LoadFSDactually returns. It is also possible for LoadFSDto return successfully, even if there are subsequent errors initializing the file system driver. Presently, there are no mechanisms that the block device driver can use to detect such errors. There is a one to one relationship between file system drivers and block device drivers. This means that a block device driver can make only one successful call to LoadFSD; calling LoadFSDmore than once causes unpredictable behavior.

The Device Manager unloads file system drivers at the time that a block device's driver is deregistered by the DeregisterDevicefunction. Once the file system driver is loaded, the block device driver cannot force it to unload or unmount the block device from the system's directory structure.



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.