CeEnumDBVolumes (EDB) (Windows CE 5.0)

Send Feedback

This function is used to enumerate the file names and GUIDs of all mounted volumes.

This function does not work with CEDB databases. For more information about CEDB, see CEDB Reference.

BOOL CeEnumDBVolumes( PCEGUIDpGuid,LPWSTRpwszName,DWORDcchMaxName);

Parameters

  • pGuid
    [in/out] On return, this parameter contains the CEGUID of the volume. Use this CEGUID in successive calls to this function to continue enumeration.
  • pwszName
    [out] On successful return, contains the file name of the volume identified by the CEGUID returned in the pGuid parameter.
  • cchMaxName
    [in] The size of the pwszName buffer. To ensure a large enough buffer, this value should be at least CEDB_MAXDBASENAMELEN in size. This parameter is specified in characters and includes the space needed for the null terminator.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:

Return Value Description
ERROR_INVALID_PARAMETER Indicates one of the following:
  • pGUID is NULL.
  • pwszName is NULL.
ERROR_INSUFFICIENT_BUFFER Indicates that cchMaxName does not specify a length large enough to hold the file name of the volume.
ERROR_NO_MORE_ITEMS Indicates that there are no more volumes to enumerate.
ERROR_KEY_DELETED Enumeration can only start with an invalid GUID or a mounted volume. Any other GUID will fail. For example, deleting a volume and then attempting to enumerate from the deleted volume's GUID causes this error.

Remarks

Enumeration follows these general steps:

  1. To begin the enumeration, the caller sets pGuid to the value returned by CREATE_INVALIDEDBGUID. For each call of this function, it returns the file name and GUID of the mounted volume in the pwszName and pGuid parameters respectively.
  2. To continue enumeration, you call CeEnumDBVolumes with the CEGUID value returned from the previous call.
  3. 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 prevents the necessity of completely restarting the process.

The following list highlights the differences between this function and the CEDB equivalent function:

  • Enumeration can only start with the 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. See "Return Values" earlier in this topic for more information about this error type.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib.

See Also

EDB Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.