PopInitPlatformSettings

NTSTATUS __stdcall PopInitPlatformSettings(){
  VOID **v0; 
  NTSTATUS v1; 
  NTSTATUS v2; 
  VOID **PoolWithTag; 
  int v4; 
  UINT64 v5; 
  int v6; 

  v0 = 0i64;
  ZwQuerySystemInformation();
  v2 = v1;
  if( v1 != -1073741789 )
    goto LABEL_27;
  PoolWithTag = ExAllocatePoolWithTag(1ui64, 0i64, 544040269i64);
  v0 = PoolWithTag;
  if( !PoolWithTag )
  {
    v2 = -1073741670;
    goto LABEL_31;
  }
  *(_DWORD *)PoolWithTag = 1094930505;
  *((_DWORD *)PoolWithTag + 1) = 1;
  *((_DWORD *)PoolWithTag + 2) = 1346584902;
  *((_DWORD *)PoolWithTag + 3) = -16;
  ZwQuerySystemInformation();
  v2 = v4;
  if( v4 < 0 )
LABEL_31:
    KeBugCheckEx(0xA0u, (PVOID)0xE, (PVOID)v2, 0i64, 0i64);
  if( *((_BYTE *)v0 + 24) >= 3u )
    PopFirmwarePlatformRole = *((unsigned __int8 *)v0 + 61);
  if( (unsigned __int8)off_140C00860[0]() )
    PopPlatformAoAc = 1;
  if( PopPlatformRoleOverride != -1 )
    PopFirmwarePlatformRole = PopPlatformRoleOverride;
  if( PopPlatformAoAcOverride != -1 )
    PopPlatformAoAc = PopPlatformAoAcOverride != 0;
  if( (HvlpFlags & 2) != 0 )
  {
    v5 = (HvlpEnlightenments & 0x10000) != 0 ? 16 : 31;
    if( (HvlpRootFlags & 0x400) != 0 )
      v5 = 31i64;
    PopLogSleepDisabled(0x12ui64, v5, 0i64, 0i64);
  }
  if( PopPlatformAoAc )
  {
    if( !InitSafeBootMode && !InitIsWinPEMode && !PopModernStandbyDisabled )
      goto LABEL_24;
  }
  else
  {
    PopLogSleepDisabled(0x13ui64, 0x20ui64, 0i64, 0i64);
  }
  PopPlatformAoAc = 0;
LABEL_24:
  v6 = PopFirmwarePlatformRole;
  if( (unsigned int)PopFirmwarePlatformRole > 8 )
  {
    v6 = 0;
    PopFirmwarePlatformRole = 0;
  }
  PopPlatformRole = v6;
  v2 = 0;
LABEL_27:
  if( v2 < 0 )
    goto LABEL_31;
  if( v0 )
    ExFreePoolWithTag(v0, 0x206D654Du);
  return v2;
}

Referenced by:

NtPowerInformation