Implementing FSD_GetVolumeInfo

In Windows CE 5.0, we added a new FSD API: FSD_GetVolumeInfo. This API is used to populate the CE_VOLUME_INFO structure reported by the CeGetVolumeInfo SDK API. This function is intended to give applications insight into properties of the file system where they're storing data.
Documentation for this API has not yet made it to MSDN (at the time of this posting), and so I've put together a brief description of how this function should be implemented in an FSD.
BOOL
FSD_GetVolumeInfo (
    DWORD dwVolume,
    FSD_VOLUME_INFO *pInfo
};
Parameters:
dwVolume – [in] The volume context passed by the FSD to FSDMGR_RegisterVolume.
pInfo – [out] A structure describing file system specific information about the volume.
Return Values:
Return TRUE on success. FALSE if the cbSize member of the FSD_VOLUME_INFO structure is not as expected.
The FSD_VOLUME_INFO structure returned by FSD_GetVolumeInfo:

typedef struct _FSD_VOLUME_INFO {
    DWORD cbSize;
    DWORD dwFSVersion ;
    TCHAR szFSDDesc[MAX_FSD_DESCRIPTOR];
    TCHAR szFSDSubType[MAX_FSD_DESCRIPTOR];
    DWORD dwAttributes;
    DWORD dwBlockSize;
    DWORD dwFlags;
} FSD_VOLUME_INFO, *PFSD_VOLUME_INFO;

cbSize - [in] This should be set by the caller to sizeof (FSD_VOLUME_INFO) for versioning.
dwFSVersion - [out] Set to FSD_VERSION_0
szFSDDesc - [out] Currently ignored. You can set this to the name of the file system.
szFSDSubType - [out] Currently ignored. You can set this to a sub-name for the file system.
dwAttributes - [out] Bitmask containing FSD_ATTRIBUTE_ values described below.
dwBlockSIze - [out] Set to the optimal I/O buffer size for the file system. For FAT, this would be the cluster size.
dwFlags - [out] Bitmask containing FSD_FLAG_ values described below.
FSD Attributes:
FSD_ATTRIBUTE_READONLY - Add to FSD_VOLUME_INFO.dwAttributes when the volume is readonly.
FSD_ATTRIBUTE_XIP - Add to FSD_VOLUME_INFO.dwAttributes when the volume supports XIP from the file system.
FSD Flags:
FSD_FLAG_TRANSACTION_SAFE - Add to FSD_VOLUME_INFO.dwFlags when the volume supports transaction safe operations. This indicates that the file system meta-data will not become corrupt due to power loss.
FSD_FLAG_TRANSACT_WRITES - Add to FSD_VOLUME_INFO.dwFlags when the volume supports transaction safe WriteFile operations. This indicates that data written to the file system will not become corrupt due to power loss.
FSD_FLAG_WFSC_SUPPORTED - Add to FSD_VOLUME_INFO.dwFlags when the FSD supports the FSD_WriteFileGather and FSD_ReadFileScatter file I/O APIs.
FSD_FLAG_LOCKFILE_SUPPORTED - Add to FSD_VOLUME_INFO.dwFlags when the FSD supports the FSD_LockFileEx and FSD_UnlockFileEx range-locking APIs.
FSD_FLAG_NETWORK - Add to FSD_VOLUME_INFO.dwFlags when the FSD is a network file system.
And of course don't forget to the new export do your .def file or FSDMGR will not find it.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值