CeMountDBVol (RAPI) (Windows CE 5.0)
This function issues a mount request for a database volume that contains both data and an integrity log. The function returns a CEGUID that is the globally unique identifier of a mounted database.
CeMountDBVol is a remote application interface (RAPI), which enables an application running on a desktop computer to make function calls on a Windows CE–based device.
BOOL CeMountDBVol( PCEGUID pceguid,LPWSTR lpszDBVol,DWORD dwFlags);
Parameters
- pceguid
[out] Pointer to a buffer that is filled with the CEGUID of the globally unique identifier of a mounted database. - lpszDBVol
[in] Pointer to the null-terminated string that contains the file name of the database volume to be mounted. The path is limited to MAX_PATH characters and includes the NULL character. - dwFlags
[in] Specifies how the database volume is opened. It is one of the following flags.Value Description CREATE_NEW Creates a new database volume. The function fails if the specified database volume already exists. CREATE_ALWAYS Creates a new database volume. The function overwrites the database volume if it exists. OPEN_EXISTING Opens the database volume. The function fails if the database volume does not exist. OPEN_ALWAYS Opens the database volume, if it exists. If the database volume does not exist, the function creates the database volume as if CREATE_NEW was specified. TRUNCATE_EXISTING Deletes all data on the volume, including databases and records, and resets the volume locale identifier (LCID). This has the same result as calling DeleteFile on a volume and then calling CeMountDBVol (RAPI) with the CREATE_NEW flag set. The specified volume must not be mounted by an application, or an access denied error will occur.
Return Values
TRUE indicates success. FALSE indicates failure. To get extended error information, call CeGetLastError. Possible values for CeGetLastError include the following.
Value | Description |
---|---|
ERROR_DISK_FULL | Returned if the mounted volume does not have space to create the new database. |
ERROR_INVALID_NAME | Returned if the specified name was invalid. |
ERROR_NOT_ENOUGH_MEMORY | Returned if there was not enough memory available to create the volume. |
ERROR_ACCESS_DENIED | Returned if dwFlags is set to CREATE_ALWAYS or TRUNCATE_EXISTING, and a database volume with the given name is currently mounted by an application. This error is also returned if the file name refers to a file that is not a valid database volume. |
ERROR_ALREADY_EXISTS | Returned if dwFlags is set to CREATE_NEW and a database volume with the given name already exists. This error is also returned if a database volume is already mounted with the same CEGUID as the new volume that is being mounted. |
**Note **If the database volume already exists before the function call and dwFlags is CREATE_ALWAYS or OPEN_ALWAYS, CeGetLastError returns ERROR_ALREADY_EXISTS, even though the function has succeeded.
Remarks
The database volume format used in Windows CE 3.0 has changed for Windows CE .NET 4.0 and later. You can use the Database Conversion Wizard, released as part of the Power Toys for Microsoft Pocket PC 2002 to convert CEDB volumes from Windows CE 3.0 to the new format used in Windows CE .NET 4.0 and later. The conversion wizard works with all Windows CE OS designs, not exclusively with Pocket PC. For more information on the Database Conversion Wizard, see this Microsoft Web site.
The CeMountDBVol (RAPI) function creates a database volume that contains both data and an integrity log. The function can accept any path including Uniform Naming Convention (UNC) names for files on a LAN.
A single database volume can be mounted more than once by a different application. Each time the volume is mounted, a reference count is incremented. A mounted database volume does not unmount until all applications that mounted the volume call CeUnmountDBVol (RAPI). CeUnmountDBVol (RAPI) must be called to free up system resources.
It is not necessary to call CeMountDBVol to access the object store. You can treat the object store as a special database volume that is always mounted.
All data written to a mounted database volume is cached until one of the following occurs:
- It is explicitly flushed. See CeFlushDBVol.
- It is flushed by the OS because of a low memory condition.
- It is unmounted.
Requirements
OS Versions: Windows CE 2.12 and later.
Header: Rapi.h.
Link Library: Rapi.lib.
See Also
RAPI Functions | CeFlushDBVol | CeGetLastError | CeUnmountDBVol (RAPI) | CHECK_INVALIDGUID
Send Feedback on this topic to the authors