#ifndef _NTRTL_H
NTSYSAPI
NTSTATUS
NTAPI
RtlRunOnceComplete(
_Inout_ PRTL_RUN_ONCE RunOnce,
_In_ ULONG Flags,
_In_opt_ PVOID Context
);
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 referenceThis function is documented in Windows Driver Kit.
The RtlRunOnceComplete routine completes the one-time initialization began by RtlRunOnceBeginInitialize.
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:
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.
The initialization attempt failed.
Context [in, optional]Specifies the initialized data.
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. |
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.