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.

FSDMGR_GetVolumeName

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.

FSDMGR_GetRegistryValue

FSDMGR_GetRegistryString

FSDMGR_GetRegistryFlag

 

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:
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/MyProfile/MyFSD]
    "RegistryValue1"=dword:1
    
; base file system key:
[HKEY_LOCAL_MACHINE/System/StorageManager/MyFSD]
    "RegistryString1"="test string"

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.

FSDMGR_RegisterVolume

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.

FSDMGR_DeregisterVolume

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.

FSDMGR_CreateSearchHandle

FSDMGR_CreateFileHandle

 

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.

 

FSDMGR_GetDiskInfo

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.

FSDMGR_ReadDisk

A simple disk-read function; reads a number of contiguous sectors and returns them to the FSD.

FSDMGR_WriteDisk

A simple disk-write function; writes FSD-provided data to a number of contiguous sectors.

FSDMGR_ReadDiskEx

A more advanced disk-read function; reads a number of contiguous sectors into multiple FSD-provided buffers.

FSDMGR_WriteDiskEx

A more advanced disk-write function; writes data from a number of FSD-provided buffers to contiguous sectors.

FSDMGR_DiskIoControl

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).

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值