HalpCmciLoadThresholdConfiguration

INT64 __stdcall HalpCmciLoadThresholdConfiguration(){
  INT64 v0; 
  unsigned int v1; 
  INT64(__stdcall *v2)(UINT64, const WCHAR *, _RTL_QUERY_REGISTRY_TABLE *, PVOID, PVOID); 
  int v3; 
  unsigned int v4; 
  unsigned int v5; 
  unsigned int v6; 
  int v7; 
  int v8; 
  int v9; 
  union _LARGE_INTEGER PerformanceFrequency; 
  struct _UNICODE_STRING DestinationString; 
  INT64 result; 
  int v13; 
  const wchar_t *v14; 
  int *v15; 
  int v16; 
  int *v17; 
  int v18; 
  int v19; 
  const wchar_t *v20; 
  unsigned int *v21; 
  int v22; 
  int *v23; 
  int v24; 
  int v25; 
  const wchar_t *v26; 
  unsigned int *v27; 
  int v28; 
  int *v29; 
  int v30; 
  v4 = 0;
  v6 = 0;
  v5 = 0;
  PerformanceFrequency.QuadPart = 0i64;
  v0 = (unsigned int)_InterlockedCompareExchange(&HalpCmciConfigurationLoaded, 1, 0);
  if( !(_DWORD)v0 )
  {
    memset((INT64)&result, 0i64);
    v9 = -1;
    v14 = L"CMCThresholdCount";
    v16 = 67108868;
    v22 = 67108868;
    v15 = (int *)&v4;
    v1 = 100;
    v28 = 67108868;
    v17 = &v7;
    v8 = 60;
    v20 = L"CMCThresholdSeconds";
    v18 = 4;
    v21 = &v5;
    v24 = 4;
    v23 = &v8;
    v26 = L"CMCPollingLimit";
    v27 = &v6;
    v30 = 4;
    v29 = &v9;
    v7 = 100;
    v13 = 304;
    v19 = 304;
    v25 = 304;
    DestinationString = 0i64;
    RtlInitUnicodeString(&DestinationString, L"RtlQueryRegistryValuesEx", 0x130u);
    LODWORD(v2) = MmGetSystemRoutineAddress(&DestinationString);
    if( !v2 )
      v2 = RtlQueryRegistryValues;
    if( ((int(__fastcall *)(__int64, const wchar_t *, INT64 *, _QWORD, _QWORD))v2)(
           2147483650i64,
           L"Session Manager",
           &result,
           0i64,
           0i64) < 0 )
    {
      v6 = -1;
      v4 = 100;
      v5 = 60;
    }
    else
    {
      v1 = v4;
    }
    v3 = 2;
    if( v1 > 2 )
      v3 = v1;
    HalpCmciThresholdCount = v3;
    KeQueryPerformanceCounter(&PerformanceFrequency);
    HalpCmciThresholdTime = PerformanceFrequency.QuadPart * v5;
    v0 = v6;
    HalpCmcPollCount = v6;
  }
  return v0;
}

Referenced by:

HalpCmciInit