Compartir a través de


CeFindFirstDatabaseEx (EDB) (Windows CE 5.0)

Send Feedback

This function is used to create a handle which can then be used with the CeFindNextDatabaseEx (EDB) function to enumerate databases in a specific volume, or all of the databases across all mounted volumes.

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

HANDLE CeFindFirstDatabaseEx( PCEGUIDpGuid,DWORDdwDbaseType);

Parameters

  • pGuid
    [in] If pGuid is NULL or is a value generated with CREATE_INVALIDEDBGUID, this function enumerates all volumes. If pGuid is not NULL and not an invalid GUID, then this function searches the specified mounted volume.
  • dwDbaseType
    [in] The type of database to enumerate. If dwDbaseType is not 0, then this function enumerates all databases whose type matches the value of this parameter. A value of 0 results in all databases being enumerated. The type of a database is set when creating a database by using the CeCreateDatabaseWithProps (EDB) function or when setting database information by using the CeSetDatabaseInfo (EDB) function.

Return Values

A return value of INVALID_HANDLE_VALUE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:

Return Value Description
ERROR_NOT_FOUND Indicates one of the following:
  • pGuid is not an invalid GUID and the specified mounted volume does not exist.
  • pGuid is set to CREATE_INVALIDEDBGUID and there are no mounted volumes.
ERROR_NOT_ENOUGH_MEMORY Indicates that there is no memory available to create the enumeration context.

Remarks

This function only returns the handle to an enumeration context. To begin enumerating databases, an application must first call the CeFindNextDatabaseEx function. The handle returned from this function can be used on multiple threads at the same time.

Note   If you call this function by passing NULL, it enumerates through all volumes on the device, including CEDB volumes. Therefore, the handle returned by this function may be to a CEDB volume; this handle cannot be used with EDB functions.

If a new database volume is mounted after calling this function, that new database volume is not included in the enumeration, because this function takes a snapshot of the currently mounted volumes. If a volume is unmounted after calling this function, then the enumeration skips that volume.

The handle returned from this function must be closed by calling the CloseHandle function.

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

  • If the pGuid has no mounted volume associated with it, EDB returns ERROR_NOT_FOUND, while CEDB returns ERROR_INVALID_PARAMETER. NULL and INVALIDGUID are exceptions.
  • CREATE_INVALIDEDBGUID is used to enumerate CEDB and EDB volumes.

Requirements

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

See Also

CeFindNextDatabaseEx (EDB) | CeSetDatabaseInfo (EDB) | CeCreateDatabaseWithProps (EDB) | CloseHandle

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.