EtwpAcquireLoggerContextByLoggerId

_WMI_LOGGER_CONTEXT *__stdcall EtwpAcquireLoggerContextByLoggerId(
        _ETW_SILODRIVERSTATE *SiloState,
        UINT64 LoggerId,
        UINT8 WithMutex){
  __int64 v4; 
  __int64 v6; 
  _WMI_LOGGER_CONTEXT *v7; 
  _WMI_LOGGER_CONTEXT *v8; 
  v4 = (unsigned int)LoggerId;
  v6 = (unsigned int)LoggerId;
  if( (unsigned int)LoggerId >= SiloState->MaxLoggers )
    LOBYTE(v7) = 1;
  else
    v7 = SiloState->EtwpLoggerContext[(unsigned int)LoggerId];
  if( ((unsigned __int8)v7 & 1) != 0
    || !ExAcquireRundownProtectionCacheAwareEx(SiloState->EtwpLoggerRundown[(unsigned int)LoggerId], 1u) )
  {
    return 0i64;
  }
  if( (unsigned int)v4 >= SiloState->MaxLoggers )
  {
    v8 = (_WMI_LOGGER_CONTEXT *)1;
  }
  else
  {
    _mm_lfence();
    v8 = SiloState->EtwpLoggerContext[v4];
  }
  if( ((unsigned __int8)v8 & 1) != 0 )
  {
    ExReleaseRundownProtectionCacheAwareEx(SiloState->EtwpLoggerRundown[v6], 1u);
    return 0i64;
  }
  if( WithMutex )
    KeWaitForSingleObject((char *)v8 + 648, Executive, 0, 0, 0i64);
  if( !*((_DWORD *)v8 + 84) )
  {
    EtwpReleaseLoggerContext((unsigned int *)v8, WithMutex);
    return 0i64;
  }
  return v8;
}

Referenced by:

AddDecodeGuidToSessions
EtwQueryPerformanceTraceInformation
EtwRegisterEventCallback
EtwSetPerformanceTraceInformation
EtwShutdown
EtwpAcquireLoggerContext
EtwpAcquireLoggerContextByLoggerName
EtwpAddRegEntryToGroup
EtwpAdjustSiloTraceBuffers
EtwpCheckLoggerAccessAndDoRundown
EtwpEventTracingCounterSetCallback
EtwpGetCompressionSettings
EtwpGetDisallowList
EtwpGetSoftRestartInformation
EtwpKsrCallback
EtwpLookupLoggerIdByName
EtwpQueryReferenceTime
EtwpRealtimeConnect
EtwpRealtimeDisconnectConsumer
EtwpSetCompressionSettings
EtwpSetProviderBinaryTracking
EtwpSetSoftRestartInformation
EtwpStartLogger
EtwpTracingProvEnableCallback
EtwpTrackProviderBinary
EtwpTrackProviderRegistration
EtwpUpdateDisallowList
EtwpUpdateEnableMask
EtwpUpdatePeriodicCaptureState
EtwpValidateEnableNotification
WmiQueryTraceInformation