Share via


IRAPISession::CeMountDBVol

Send Feedback

This method issues a mount request on a remote Microsoft® Windows® CE–based device.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 the mounted database volume.

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

Parameters

  • pceguid
    [out] Pointer to a CEGUID that is set to the GUID of the mounted database volume.
  • 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.
    Values 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 zero bytes. The function fails if the database volume does not exist.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call IRAPISession::CeGetLastError and IRAPISession::CeRapiGetError. Possible return values for IRAPISession::CeGetLastError include the following:

  • ERROR_DISK_FULL
    The mounted volume does not have space to create the new database.
  • ERROR_INVALID_NAME
    The lpszDBVol parameter contained an empty path.
  • ERROR_PATH_NOT_FOUND
    The lpszDBVol parameter contained an invalid path.
  • ERROR_INVALID_PARAMETER
    A parameter was invalid.
  • ERROR_NOT_ENOUGH_MEMORY
    There was not enough memory available to create volume.

If the database volume already exists before the function call and dwFlags is CREATE_ALWAYS or OPEN_ALWAYS, IRAPISession::CeGetLastError returns ERROR_ALREADY_EXISTS, even though the function has succeeded.

Remarks

The IRAPISession::CeMountDBVol method 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 IRAPISession::CeUnmountDBVol. IRAPISession::CeUnmountDBVol (RAPI) must be called to free up system resources.

All data written to a mounted database volume is cached until one of the following occurs:

  • It is explicitly flushed.
  • It is flushed by the OS because of a low-memory condition.
  • It is unmounted.

CeMountDBVol is not supported for emulated storage cards created for the Device Emulator through folder sharing.

RAPI method calls that access database volumes will fail on devices running in restricted mode unless the database permissions are explicitly set to allow RAPI access. For more information, see RAPI Restricted Mode Security.

Requirements

OS Versions: Windows CE 5.01 and later.
Header: Rapi2.h.
Link Library: Ole32.lib, Rapiuuid.lib

See Also

IRAPISession::IUnknown | IRAPISession::CeFlushDBVol | IRAPISession::CeUnmountDBVol

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.