The RtlRunOnceBeginInitialize routine begins a one-time initialization.
NTSYSAPI NTSTATUS RtlRunOnceBeginInitialize( PRTL_RUN_ONCE RunOnce, ULONG Flags, PVOID *Context );
Pointer to the RTL_RUN_ONCE one-time initialization structure.
Drivers can optionally specify one or more of the following flags:
Perform initialization asynchronously. The driver can perform multiple completion attempts in parallel. If this flag is used, subsequent calls to this routine will fail unless this flag is also specified.
Do not begin initialization, but check to determine if initialization has already occurred. If RtlRunOnceBeginInitialize returns STATUS_SUCCESS, the initialization succeeded, and *Context contains the initialized data.
Specifies a pointer to a PVOID variable that receives the initialized data. The value of *Context is valid only when the routine returns STATUS_SUCCESS.
RtlRunOnceBeginInitialize returns one of the following NTSTATUS values:
||The one-time initialization has already completed. The initialized data is stored in the memory location that Context points to.|
||The caller has successfully begun one-time initialization. The caller now performs the driver-specific initialization steps and then calls RtlRunOnceComplete to complete the initialization.|
|Minimum supported client||Available in Windows Vista and later versions of Windows.|
|Header||ntddk.h (include Ntddk.h)|