A version of this page is also available for
This function creates a handle that can be used with the CeFindNextDatabaseEx (EDB) function to enumerate databases in a volume or all databases across all mounted volumes.
HANDLE CeFindFirstDatabaseEx( PCEGUID pGuid, DWORD dwDbaseType );
[in] If this parameter is set to NULL or is a value generated with this parameter set to CREATE_INVALIDEDBGUID, this function enumerates all mounted volumes. If this parameter is not set to NULL or an invalid GUID, this function searches the specified mounted volume.
[in] Type of database to enumerate. If this parameter is not set to zero, this function enumerates all databases whose type matches the value of this parameter. A value of zero causes all databases to be 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 CeSetDatabaseInfoEx (EDB) function.
INVALID_HANDLE_VALUE indicates failure. To get extended error information, call GetLastError. The following table shows possible values.
There is not enough memory available to create the enumeration context.
Indicates one of the following:
This function returns only the handle to an enumeration context. To begin enumerating databases, an application must first call CeFindNextDatabaseEx. The handle returned from this function can be used on multiple threads at the same time.
If you call this function by passing NULL, it enumerates all volumes on the device, including CEDB volumes. Therefore, the handle returned by this function may be to a CEDB volume that 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, 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 pGuid has no mounted volume associated with it, EDB returns ERROR_NOT_FOUND, whereas CEDB returns ERROR_INVALID_PARAMETER. NULL and INVALIDGUID are exceptions.
- CREATE_INVALIDEDBGUID is used to enumerate CEDB and EDB volumes.
|Windows Embedded CE||Windows CE 5.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|