RtlRunOnceComplete function

The RtlRunOnceComplete routine completes the one-time initialization began by RtlRunOnceBeginInitialize.

Syntax

NTSYSAPI NTSTATUS RtlRunOnceComplete(
  PRTL_RUN_ONCE RunOnce,
  ULONG         Flags,
  PVOID         Context
);

Parameters

RunOnce

Pointer to the RTL_RUN_ONCE one-time initialization structure.

Flags

Drivers can optionally specify one or more of the following flags:

RTL_RUN_ONCE_ASYNC

Operate in asynchronous mode. This mode enables multiple completion attempts to execute in parallel. If this flag is used, subsequent calls to the RtlRunOnceComplete routine will fail unless this flag is also specified.

RTL_RUN_ONCE_INIT_FAILED

The initialization attempt failed.

Context

Specifies the initialized data.

Return Value

RtlRunOnceComplete returns one of the following NTSTATUS values:

Return code Description
STATUS_SUCCESS
The operation completed successfully.
STATUS_UNSUCCESSFUL
The operation could not be completed. If the caller specified RTL_RUN_ONCE_ASYNC in the Flags parameter, this value can indicate that another thread completed the initialization.

Remarks

If RtlRunOnceComplete returns STATUS_SUCCESS, any subsequent call to RtlRunOnceBeginInitialize for the same RTL_RUN_ONCE structure supplies Context as the initialized data.

If the caller specified RTL_RUN_ONCE_ASYNC in the Flags parameter and RtlRunOnceComplete returns any value other than STATUS_SUCCESS, the caller must clean up any initialization that it attempted.

Requirements

   
Minimum supported client Available in Windows Vista and later versions of Windows.
Target Platform Universal
Header ntddk.h (include Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= APC_LEVEL

See Also

RTL_RUN_ONCE

RtlRunOnceBeginInitialize

RtlRunOnceExecuteOnce

RtlRunOnceInitialize

RunOnceInitialization