NtQuerySystemInformationEx

NTSTATUS __stdcall NtQuerySystemInformationEx(
        _SYSTEM_INFORMATION_CLASS SystemInformationClass,
        VOID *InputBuffer,
        UINT64 InputBufferLength,
        VOID *SystemInformation,
        UINT64 SystemInformationLength,
        UINT64 *ReturnLength){
  __int32 v8; 
  __int64 v9; 
  char *v10; 
  NTSTATUS result; 
  __int32 v12; 
  __int32 v13; 
  __int32 v14; 
  __int32 v15; 
  __int32 v16; 
  __int32 v17; 
  __int32 v18; 
  __int32 v19; 
  __int32 v20; 
  UINT64 Length; 

  if( !InputBuffer || !(_DWORD)InputBufferLength )
    return -1073741811;
  if( SystemInformationClass <= SystemNodeDistanceInformation )
  {
    if( SystemInformationClass != SystemNodeDistanceInformation )
    {
      if( SystemInformationClass <= SystemLogicalProcessorInformation )
      {
        if( SystemInformationClass != SystemLogicalProcessorInformation
          && SystemInformationClass != SystemProcessorPerformanceInformation
          && SystemInformationClass != SystemInterruptInformation
          && SystemInformationClass != SystemProcessorIdleInformation
          && SystemInformationClass != SystemProcessorPowerInformation )
        {
          if( SystemInformationClass != SystemWatchdogTimerInformation )
            return -1073741821;
          goto LABEL_19;
        }
      }
      else
      {
        v12 = SystemInformationClass - 83;
        if( v12 )
        {
          v13 = v12 - 17;
          if( v13 )
          {
            v14 = v13 - 7;
            if( !v14 )
              goto LABEL_19;
            if( v14 != 1 )
              return -1073741821;
          }
        }
      }
    }
    goto LABEL_25;
  }
  if( SystemInformationClass <= SystemInterruptSteeringInformation )
  {
    if( SystemInformationClass == SystemInterruptSteeringInformation )
      goto LABEL_19;
    v17 = SystemInformationClass - 141;
    if( v17 )
    {
      v18 = v17 - 19;
      if( v18 )
      {
        v19 = v18 - 5;
        if( v19 )
        {
          v20 = v19 - 10;
          if( v20 )
          {
            if( v20 != 3 )
              return -1073741821;
          }
        }
        goto LABEL_6;
      }
    }
LABEL_25:
    v9 = 1i64;
    goto LABEL_7;
  }
  v8 = SystemInformationClass - 181;
  if( v8 )
  {
    v15 = v8 - 28;
    if( v15 )
    {
      v16 = v15 - 1;
      if( v16 )
      {
        if( v16 != 1 )
          return -1073741821;
        goto LABEL_6;
      }
LABEL_19:
      v9 = 3i64;
      goto LABEL_7;
    }
  }
LABEL_6:
  v9 = 7i64;
LABEL_7:
  if( KeGetCurrentThread()->PreviousMode )
  {
    if( (v9 & (unsigned __int64)InputBuffer) != 0 )
      ExRaiseDatatypeMisalignment();
    v10 = (char *)InputBuffer + (unsigned int)InputBufferLength;
    if( (unsigned __int64)v10 > 0x7FFFFFFF0000i64 || v10 < InputBuffer )
      MEMORY[0x7FFFFFFF0000] = 0;
  }
  LODWORD(Length) = SystemInformationLength;
  ExpQuerySystemInformation(
    (unsigned int)SystemInformationClass,
    InputBuffer,
    InputBufferLength,
    (INT64)SystemInformation,
    Length,
    ReturnLength);
  return result;
}

Referenced by:

No references.