RtvdbCreateDatabase

RtvdbCreateDatabase creates a database, opens it and its root directory.

Syntax

Copy
DWORD RtvdbCreateDatabase(
  [out]   RTVDB_DATABASE* pDatabase,
  [out]   RTVDB_DIRECTORY* pRootDirectory,
  [in]    const wchar_t* pName,
  [in]    ULONG Size
);

Parameters

[out] pDatabase

A pointer to store the database handle. See RTVDB_DATABASE.

[out] pRootDirectory

A pointer to store the root directory handle. See RTVDB_DIRECTORY.

[in] pName

The database name to create. The maximum length of database names is 63 characters, as defined by RTVDB_MAX_NAME_LENGTH in the header file.

[in] Size

The maximum number of variables that can be added to the root directory.

Return Values

Error code Meaning

ERROR_SUCCESS

The function succeeded.

ERROR_NOT_READY

The calling process has not called RtvdbInitialize.

ERROR_INVALID_PARAMETER

One of the following conditions occurred:

  • Parameter pDatabase, pRootDirectory, or pName is NULL.
  • The value of parameter pName is either empty or exceeds 63 characters in length.
  • The value of parameter Size is zero (0).

ERROR_ALREADY_EXISTS

A database with this name already exists.

ERROR_ABANDONED_WAIT_0

Failed to acquire the synchronization lock.

ERROR_NOT_ENOUGH_MEMORY

Failed to allocate memory.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtvdbApi.h

RtvdbApi_W64.lib (Windows), RtvdbApi.lib (RTSS)

See Also: