Expand Minimize

RtlRunOnceExecuteOnce function

The RtlRunOnceExecuteOnce performs a one-time initialization.

Syntax


NTSTATUS RtlRunOnceExecuteOnce(
  _Inout_  PRTL_RUN_ONCE RunOnce,
  _In_     PRTL_RUN_ONCE_INIT_FN InitFn,
  _Inout_  PVOID Parameter,
  _Out_    PVOID *Context
);

Parameters

RunOnce [in, out]

A pointer to the RTL_RUN_ONCE one-time initialization structure.

InitFn [in]

A pointer to a RunOnceInitialization routine.

Parameter [in, out]

The value to pass as the Parameter parameter to the RunOnceInitialization routine.

Context [out]

A pointer to a PVOID variable that receives the initialized data.

Return value

RtlRunOnceExecuteOnce returns STATUS_SUCCESS if the operation succeeds, or the appropriate NTSTATUS error code if the operation fails.

Remarks

For the first call to RtlRunOnceExecuteOnce for a particular RTL_RUN_ONCE structure, RtlRunOnceExecuteOnce calls the RunOnceInitialization routine to initialize the data. Every subsequent call to RtlRunOnceExecuteOnce for that structure supplies the same initialized data. The RunOnceInitialization routine will not be called twice for the same RTL_RUN_ONCE structure.

RtlRunOnceExecuteOnce runs with normal kernel APCs disabled. The routine should not be called within a special kernel APC unless all calls occur at APC_LEVEL.

Requirements

Version

Available starting with Windows Vista.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL (See Remarks section.)

See also

RTL_RUN_ONCE
RtlRunOnceBeginInitialize
RtlRunOnceComplete
RtlRunOnceInitialize
RunOnceInitialization

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft