RtvdbDeleteDirectory

RtvdbDeleteDirectory deletes a directory.

Syntax

Copy
DWORD RtvdbDeleteDirectory(
  [in]    RTVDB_DIRECTORY Directory,
  [in]    BOOL ForceClose,
  [in]    BOOL ForceDelete,
  [in]    ULONG Timeout
);

Parameters

[in] Directory

A handle for the directory to delete. To retrieve the corresponding handle, use RtvdbOpenDirectory or RtvdbCreateDirectory.

[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 directory 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

One of the following conditions occurred:

  • Parameter Directory is NULL.
  • Parameter Directory is a database root directory.

ERROR_INVALID_HANDLE

Parameter Directory does not point to a directory or points to a closed directory.

ERROR_OPERATION_ABORTED

One of the following conditions occurred:

  • Handles are still opened and ForceClose is FALSE.
  • The Directory 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 Directory 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 directory will remain open.

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

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

If the wait fails and ForceDelete is set to TRUE, calling RtvdbDeleteDirectory will mark the directory as deleted even if handles are still opened in other applications. It could cause unexpected behaviors if a new directory 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: