EtwpSampledProfileRunDown

VOID __stdcall EtwpSampledProfileRunDown(UINT64 LoggerId, UINT8 Start, UINT8 TimeProfile){
  __int16 v3; 
  INT64 *v6; 
  unsigned int v7; 
  __int16 *v8; 
  __int64 v9; 
  int v10; 
  int v11; 
  const WCHAR *v12; 
  const WCHAR *v13; 
  __int64 v14; 
  UINT64 v15; 
  UINT64 v16; 
  PLARGE_INTEGER Timeout; 
  UINT64 Flag; 
  int v19; 
  __int128 v20; 
  const WCHAR *v21; 
  __int64 v22; 
  int v23; 
  EVENT_DATA_DESCRIPTOR EventData; 
  const WCHAR *v25; 
  int v26; 
  int v27; 
  v22 = 0i64;
  v23 = 0;
  v21 = 0i64;
  v3 = 3914 - (Start != 0);
  v19 = 0;
  v20 = 0i64;
  if( TimeProfile )
  {
    v6 = &EtwpProfileObject;
    v7 = 1;
  }
  else
  {
    KeWaitForSingleObject(&EtwpGroupMaskMutex, Executive, 0, 0, 0i64);
    v7 = EtwpPmcProfile;
    v6 = (INT64 *)qword_140C19C28;
    if( !EtwpPmcProfile )
    {
LABEL_14:
      KeReleaseMutex(&EtwpGroupMaskMutex, 0);
      return;
    }
  }
  *(_QWORD *)&EventData.Size = 12i64;
  EventData.Ptr = (unsigned __int64)&v22;
  v8 = (__int16 *)(v6 + 30);
  v27 = 0;
  v9 = v7;
  do
  {
    v10 = *v8;
    v19 = 0;
    LODWORD(v20) = v10;
    if( ((int(__fastcall *)(__int64, __int64, __int128 *, int *))off_140C00A68[0])(1i64, 24i64, &v20, &v19) < 0 )
    {
      v11 = 0;
      v12 = L"Unknown";
    }
    else
    {
      v11 = DWORD2(v20);
      v12 = v21;
    }
    HIDWORD(v22) = v11;
    v13 = L"Unknown";
    v23 = v11;
    if( v12 )
      v13 = v12;
    LODWORD(v22) = v10;
    v25 = v13;
    v14 = -1i64;
    do
      ++v14;
    while( v13[v14] );
    v15 = *(unsigned int *)LoggerId;
    v16 = *(_QWORD *)(LoggerId + 1080);
    LODWORD(Flag) = 4200707;
    v26 = 2 * v14 + 2;
    LOWORD(Timeout) = v3;
    EtwpLogKernelEvent(&EventData, v16, v15, 2u, (UINT64)Timeout, Flag);
    v8 += 124;
    --v9;
  }
  while( v9 );
  if( !TimeProfile )
    goto LABEL_14;
}

Referenced by:

EtwpKernelTraceRundown