RtlRunOnceComplete routine
The RtlRunOnceComplete routine completes the one-time initialization began by RtlRunOnceBeginInitialize.
Syntax
NTSTATUS RtlRunOnceComplete( _Inout_ PRTL_RUN_ONCE RunOnce, _In_ ULONG Flags, _In_opt_ PVOID Context );
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 |
|---|---|
|
The operation completed successfully. |
|
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
|
Version | Available in Windows Vista and later versions of Windows. |
|---|---|
|
Header |
|
|
Library |
|
|
IRQL | <= APC_LEVEL |
See also
- RTL_RUN_ONCE
- RtlRunOnceBeginInitialize
- RtlRunOnceExecuteOnce
- RtlRunOnceInitialize
- RunOnceInitialization
Send comments about this topic to Microsoft
Build date: 5/2/2013