存储发展促使WinCE需要一种管理不同文件系统的方法。管理这些文件系统的存储管理器,提供了一系列方法使应用程序可以管理文件系统和文件系统卷。
1.对象存储
2.使用文件API访问卷
CeGetVolumeInfo()获得卷的信息。
WINBASEAPI BOOL CeGetVolumeInfo( LPCSTR pszRootPath, CE_VOLUME_INFO_LEVEL InfoLevel, LPCE_VOLUME_INFO lpVolumeInfo );
Parameters
-
pszRootPath
- [in] Pointer to a string that contains the root directory of the volume to be described. InfoLevel
- [in] Type of information requested. Currently, this value can only be CeVolumeInfoLevelStandard. lpVolumeInfo
- [out] Pointer to a CE_VOLUME_INFO structure that retrieves information about the volume.
Return Values
Returns TRUE if successful, otherwise FALSE.
typedef struct _CE_VOLUME_INFO{ DWORD cbSize; DWORD dwAttributes; DWORD dwFlags; DWORD dwBlockSize; TCHAR szStoreName[STORENAMESIZE]; TCHAR szPartitionName[PARTITIONNAMESIZE]; } CE_VOLUME_INFO, *PCE_VOLUME_INFO, *LPCE_VOLUME_INFO;
Members
-
cbSize
- Set to sizeof(CE_VOLUME_INFO). dwAttributes
-
Specifies attributes of a volume.
The following table shows the possible values.
Value
DesriptionCE_VOLUME_ATTRIBUTE_READONLY
Volume is read only.CE_VOLUME_ATTRIBUTE_HIDDEN
Volume is hidden.CE_VOLUME_ATTRIBUTE_REMOVABLE
Volume is removable.CE_VOLUME_ATTRIBUTE_SYSTEM
Volume is marked as a system volume.CE_VOLUME_ATTRIBUTE_BOOT
Volume is the boot volume and contains the hive-based registry.
dwFlags
-
Specifies additional properties of a volume.
The following table shows the possible values.
Value
DescriptionCE_VOLUME_TRANSACTION_SAFE
Performs transaction-safe operations.CE_VOLUME_FLAG_TRANSACT_WRITE
Transacts WriteFile operation.CE_VOLUME_FLAG_WFSC_SUPPORTED
Supports WriteFileScatterGather and ReadFileScatterGather operations.CE_VOLUME_FLAG_LOCKFILE_SUPPORTED
Supports file locking.CE_VOLUME_FLAG_NETWORK
Specifies that the volume is a network volume.CE_VOLUME_FLAG_STORE
Specifies that the volume has a back-up store.
dwBlockSize
- Size of the block, in bytes. szStoreName
- Name of the store. Maximum length is 32. szPartitionName
- Name of the partition. Maximum length is 32.
3.存储管理器
存储管理器为应用程序提供了一个使用存储设备以及其分区的方法。可以打开并查询设备与分区,来获得大小、属性、和其他有用信息。
存储管理器也提供了重分区设备以及格式化设备、分区的功能。在格式化一个设备,或是在格式化分区,或是在设定分区类型时,格式化操作将会清除分区表。实际上在一个分区上放置一个文件系统的操作是由特定文件系统驱动来完成的。
1)打开、查询存储设备;要使用一个设备必须先打开它。OpenStore();一旦打开了,就可以使用GetStoreInfo()来查询设备信息。在调用之前,必须先设置好STOREINFO结构体中的cbSize字段。
BOOL WINAPI GetStoreInfo( HANDLE hStore, PSTOREINFO pStoreInfo );
Parameters
-
hStore
- [in] Handle to the store returned from OpenStore</