A version of this page is also available for
This function enumerates the file names and GUIDs of all mounted volumes.
BOOL CeEnumDBVolumes( PCEGUID pGuid, LPWSTR pwszName, DWORD cchMaxName );
[in, out] On return, this parameter contains the CEGUID of the volume. Use this CEGUID in successive calls to this function to continue enumeration.
[out] On successful return, contains the file name of the volume identified by the CEGUID returned in pGuid.
For shared volumes, this value returns SystemHeap.
[in] Size of the pwszName buffer. To ensure a large enough buffer, set this value to at least CEDB_MAXDBASENAMELEN. This parameter is specified in characters and includes the space needed for the null terminator.
TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values.
The cchMaxName parameter does not specify a length large enough to hold the file name of the volume.
Indicates one of the following:
Enumeration can only start with an invalid GUID or a mounted volume. Any other GUID fails. For example, deleting a volume, and then attempting to enumerate from the deleted volume's GUID causes this error.
There are no more volumes to enumerate.
Enumeration follows these general steps:
- To begin the enumeration, the caller sets pGuid to the value returned by CREATE_INVALIDEDBGUID. For each call to this function, it returns the file name and GUID of the mounted volume in pwszName and pGuid respectively.
- To continue enumeration, call CeEnumDBVolumes with the CEGUID value returned from the previous call.
- When there are no more volumes to enumerate, this function returns FALSE, and GetLastError returns ERROR_NO_MORE_ITEMS.
If the return value is ERROR_INSUFFICIENT_BUFFER, reallocate the buffer, and use the CEGUID that was returned from the failure to resume the enumeration. This avoids the necessity of restarting the process.
The following are the differences between this function and the CEDB equivalent function:
- Enumeration can start only with an invalid GUID and continue from the GUID of a mounted volume.
- CREATE_INVALIDEDBGUID is used to enumerate CEDB and EDB volumes.
- An additional error is available to check completion of enumeration: ERROR_KEY_DELETED.
|Windows Embedded CE||Windows CE 5.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|