FSDMGR Helper Functions for FSD Developers
FSDMGR provides many helper functions to make developing an FSD easier. In particular, registry helper functions provide a simple mechanism for configuring an FSD for a particular storage device and I/O helper functions provide a media-independent mechanism for communicating with a block/disk driver. These functions are defined in public\common\sdk\inc\fsdmgr.h.
Used by an FSD to retrieve the name of the volume that was registered (the name of the folder where it is mounted, e.g. \Storage Card). Typically, the only reason an FSD would need to know the name of its volume is for posting callback file notifications.
A set of registry helper functions that allow an FSD to read registry settings without being aware of the registry key from which it was loaded. It is advised that all FSDs use these registry helper functions to load run-time settings. All three helper functions search the profile file system key and the base file system key (in that order).
; profile file system key:
; base file system key:
Because of the profile key search, it is possible for an FSD to have multiple sets of configurations. These unique configurations can be targeted at different storage devices advertising different storage profile names.
Invoked by an FSD when it is mounted (from FSD_MountDisk), this function associates an instance of an FSD (volume) with a partition on a disk. See more details in the section “Interacting with FSDMGR” below.
Invoked by an FSD when it is ummounted (from FSD_UnmountDisk), this function disassociates an instance of an FSD (volume) with a partition on a disk. See more details in the section “Interacting with FSDMGR” below.
Helper functions used by an FSD in functions that return a HANDLE value: FSD_FindFirstFileW and FSD_CreateFileW. These functions convert the FSD’s handle context object into a search or file handle that can be returned to the caller. See more details in the section “Interacting with FSDMGR” below.
Used by an FSD to retrieve geometry for the underlying disk partition. This function is typically used to retrieve the sector size for the media, which is required information for performing subsequent disk I/O operations. Also provided is the total number of sectors in the partition. The FSD has access to all of these sectors.
A simple disk-read function; reads a number of contiguous sectors and returns them to the FSD.
A simple disk-write function; writes FSD-provided data to a number of contiguous sectors.
A more advanced disk-read function; reads a number of contiguous sectors into multiple FSD-provided buffers.
A more advanced disk-write function; writes data from a number of FSD-provided buffers to contiguous sectors.
A generic disk I/O function for performing storage-driver specific operations. Any disk control code can be passed to this function (IOCTL_DISK_xxx).