RtlRunOnceExecuteOnce

NTSTATUS __stdcall RtlRunOnceExecuteOnce(
        PRTL_RUN_ONCE RunOnce,
        PRTL_RUN_ONCE_INIT_FN InitFn,
        PVOID Parameter,
        PVOID *Context){
  _ETHREAD *CurrentThread; 
  NTSTATUS v9; 
  NTSTATUS v10; 
  VOID *v12; 
  int v13; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  --*((_WORD *)CurrentThread + 242);
  v9 = RtlRunOnceBeginInitialize(RunOnce, 0i64, Context);
  v10 = v9;
  if( v9 < 0 )
    goto LABEL_12;
  if( v9 == 259 )
  {
    if( ((unsigned int(__fastcall *)(PRTL_RUN_ONCE, PVOID, PVOID *))InitFn)(RunOnce, Parameter, Context) )
    {
      if( Context )
        v12 = *Context;
      else
        v12 = 0i64;
      v10 = RtlRunOnceComplete(RunOnce, 0i64, v12);
      if( v10 >= 0 )
      {
        v10 = 0;
        goto LABEL_3;
      }
    }
    else
    {
      v10 = -1073741823;
      v13 = RtlRunOnceComplete(RunOnce, 4ui64, 0i64);
      if( v13 >= 0 )
        goto LABEL_3;
      v10 = v13;
    }
LABEL_12:
    KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
    RtlRaiseStatus(v10);
  }
LABEL_3:
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v10;
}

Referenced by:

ExQueryBootEntropyInformation
ExpCheckTestsigningEnabled
ExpFirmwareAccessAppContainerCheck
RtlpHpMetadataHeapStart
RtlpLogCapabilityCheckLatency
SdbGetIndex
SdbpGetStringTableItemFromStringRef