Export (0) Print
Expand All
Expand Minimize

RtlRunOnceBeginInitialize routine

The RtlRunOnceBeginInitialize routine begins a one-time initialization.

Syntax


NTSTATUS RtlRunOnceBeginInitialize(
  _Inout_  PRTL_RUN_ONCE RunOnce,
  _In_     ULONG Flags,
  _Out_    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

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.

RTL_RUN_ONCE_CHECK_ONLY

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.

Context [out]

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.

Return value

RtlRunOnceBeginInitialize returns one of the following NTSTATUS values:

Return codeDescription
STATUS_SUCCESS

The one-time initialization has already completed. The initialized data is stored in the memory location that Context points to.

STATUS_PENDING

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.

 

Remarks

Drivers can alternatively perform one-time initialization by calling RtlRunOnceExecuteOnce and supplying a RunOnceInitialization routine.

Requirements

Version

Available in Windows Vista and later versions of Windows.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL

See also

RTL_RUN_ONCE
RtlRunOnceComplete
RtlRunOnceExecuteOnce
RtlRunOnceInitialize
RunOnceInitialization

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft