RtlRunOnceComplete - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

NTSYSAPI
NTSTATUS
NTAPI
RtlRunOnceComplete(
    _Inout_ PRTL_RUN_ONCE RunOnce,
    _In_ ULONG Flags,
    _In_opt_ PVOID Context
    );

#endif

View code on GitHub
// ntddk.h

NTSYSAPI NTSTATUS RtlRunOnceComplete(
  [in, out]      PRTL_RUN_ONCE RunOnce,
  [in]           ULONG         Flags,
  [in, optional] PVOID         Context
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntddk-rtlrunoncecomplete)

RtlRunOnceComplete function

Description

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

Parameters

RunOnce [in, out]

Pointer to the RTL_RUN_ONCE one-time initialization structure.

Flags [in]

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 [in, optional]

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.

See also

RTL_RUN_ONCE

RtlRunOnceBeginInitialize

RtlRunOnceExecuteOnce

RtlRunOnceInitialize

RunOnceInitialization