RtvdbDeleteDatabase

RtvdbDeleteDatabase deletes a database.

Syntax

Copy
DWORD RtvdbDeleteDatabase(
  [in]    RTVDB_DATABASE Database,
  [in]    BOOL ForceClose,
  [in]    BOOL ForceDelete,
  [in]    ULONG Timeout
);

Parameters

[in] Database

A handle for the database to delete. To retrieve the corresponding handle, use RtvdbOpenDatabase or RtvdbCreateDatabase.

[in] ForceClose

TRUE to automatically close any opened handles, FALSE to fail the function. See Remarks for more details.

[in] ForceDelete

TRUE to mark the database as deleted even if handles are still opened in other applications, FALSE to fail the function. See Remarks for more details.

[in] Timeout

The timeout duration, in milliseconds, to wait for other applications to close all handles.

Return Values

Error code Meaning

ERROR_SUCCESS

The function succeeded.

ERROR_INVALID_PARAMETER

Parameter Database is NULL.

ERROR_INVALID_HANDLE

Parameter Database does not point to a database or points to a closed database.

ERROR_OPERATION_ABORTED

One of the following conditions occurred:

  • Handles are still opened and ForceClose is FALSE.
  • The Database is still opened when this error is returned.

ERROR_ABANDONED_WAIT_0

One of the following conditions occurred:

  • Failed to acquire the synchronization lock.
  • Sub-directories and variables may have been closed.

ERROR_ABANDONED_WAIT_63

One of the following conditions occurred:

  • Handles are still opened in other applications and ForceDelete is FALSE.
  • The Database is closed but not deleted when this error is returned.

ERROR_NOT_READY

The calling process has not called RtvdbInitialize.

Remarks

If any handles remain open within the application and ForceClose is set to FALSE, the call will fail, and the database will remain open.

If handles are open in other applications, calling RtvdbDeleteDatabase will mark the database invalid and wait for the handles to be released.

If the wait fails and ForceDelete is set to FALSE, calling RtvdbDeleteDatabase will fail, and the database will be closed but not deleted.

If the wait fails and ForceDelete is set to TRUE, calling RtvdbDeleteDatabase will mark the database as deleted even if handles are still opened in other applications. It could cause unexpected behaviors if a new database is created before all handles are closed.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtvdbApi.h

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

See Also: