RtvdbDeleteVariable

RtvdbDeleteVariable deletes a variable.

Syntax

Copy
DWORD RtvdbDeleteVariable(
  [in]    RTVDB_VARIABLE Variable,
  [in]    BOOL ForceDelete,
  [in]    ULONG Timeout
);

Parameters

[in] Variable

A handle for the variable to delete. To retrieve the corresponding handle, use RtvdbOpenVariable or RtvdbCreateVariable.

[in] ForceDelete

TRUE to mark the variable as deleted even if handles are still opened in other applications, FALSW otherwise. 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 Variable is NULL.

ERROR_INVALID_HANDLE

Parameter Variable does not point to a variable or points to a closed variable.

ERROR_ABANDONED_WAIT_0

Failed to acquire the synchronization lock.

ERROR_ABANDONED_WAIT_63

One of the following conditions occurred:

  • Variable handles are still opened in other applications and parameter ForceDelete is FALSE.
  • The variable is closed but not deleted when this error is returned.

ERROR_NOT_READY

The calling process has not called RtvdbInitialize.

Remarks

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

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

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

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtvdbApi.h

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

See Also: