Share via


CeMountDBVol

This function issues a mount request for a database volume that contains both data and an integrity log. The function fills a buffer with a CEGUID that is the globally unique identifier (GUID) of a mounted database.

A RAPI version of this function exists called CeMountDBVol (RAPI).

BOOL CeMountDBVol( 
  PCEGUID pceguid, 
  LPWSTR lpszDBVol,
  DWORD dwFlags
);

Parameters

  • pceguid
    [out] Pointer to a buffer that is filled in 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] Specification for opening the database volume. The following table shows the possible values for dwFlags.
    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 Opens the database volume. Once opened, the database volume is truncated so that its size is 0 bytes. The function fails if the database volume does not exist.

Return Values

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

Value Description
ERROR_DISK_FULL Indicates that the mounted volume does not have space to create the new database.
ERROR_PATH_NOT_FOUND Indicates that the specified path was not found.
ERROR_NOT_ENOUGH_MEMORY Indicates that there was not enough memory available to create the volume. If the database volume already exists before the function call and dwFlags is CREATE_ALWAYS or OPEN_ALWAYS, GetLastError returns ERROR_ALREADY_EXISTS, even though the function has succeeded.

Remarks

The CeMountDBVol 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. CeUnmountDBVol must be called to free system resources.

It is not necessary to call CeMountDBVol to access the object store. The object store can be regarded 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.10 and later.
Header: Windbase.h.
Link Library: Coredll.lib.

See Also

CeFlushDBVol | CeUnmountDBVol | CHECK_INVALIDGUID

 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.