WdipSemSqmLogInflightLimitExceededDataPoints

INT64 __fastcall WdipSemSqmLogInflightLimitExceededDataPoints(){
  _ETHREAD *CurrentThread; 
  int v1; 
  UINT64 v2; 
  __int64 v3; 
  unsigned int i; 
  const _GUID **v6; 
  const _GUID *v7; 
  __int64 v8; 
  UINT64 Key; 
  UINT64 StreamEntries; 
  int v11; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  LODWORD(Key) = 0;
  v1 = 0;
  --*((_WORD *)CurrentThread + 242);
  ExAcquirePushLockExclusiveEx((UINT64)&qword_140C1C7E8, 0i64);
  v3 = (unsigned int)dword_140C1C7E0;
  if( dword_140C1C7E0 )
  {
    v1 = WdipSemSqmIncrementDword(v2);
    if( v1 < 0 )
      v1 = 0;
    if( (_DWORD)v3 )
    {
      v6 = (const _GUID **)&WdipSemFrequentScenarioTable;
      do
      {
        v7 = *v6;
        if( (int)WdipSemGetGuidKey(*v6, &Key) >= 0 )
        {
          LODWORD(StreamEntries) = Key;
          HIDWORD(StreamEntries) = LOWORD(v7[1].Data1);
          v11 = *(_DWORD *)&v7[1].Data2;
          v1 = WdipSemSqmAddToStream(0x426ui64, 3ui64, &StreamEntries);
          if( v1 < 0 )
            v1 = 0;
        }
        else
        {
          v1 = 0;
        }
        ++v6;
        --v3;
      }
      while( v3 );
    }
  }
  for( i = 0; i < dword_140C1C7E0; *(&WdipSemFrequentScenarioTable + v8) = 0i64 )
  {
    v8 = i;
    WdipSemFastFree(5i64, (struct SLIST_ENTRY *)*(&WdipSemFrequentScenarioTable + i++));
  }
  dword_140C1C7E0 = 0;
  ExReleasePushLockEx((UINT64)&qword_140C1C7E8, 0i64);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return(unsigned int)v1;
}

Referenced by:

WdipTimeoutCheckRoutine