CmpSetupConfigurationTree

NTSTATUS __fastcall CmpSetupConfigurationTree(INT64 a1, VOID *a2, INT64 a3, INT64 a4){
  unsigned int v5; 
  _INTERFACE_TYPE v6; 
  unsigned __int16 i; 
  unsigned __int64 v9; 
  NTSTATUS result; 
  INT64 v11; 
  int v12; 
  INT64 BusNumber; 
  VOID *Handle; 
  __int16 DeviceIndexTable[48]; 

  v5 = a4;
  Handle = 0i64;
  v6 = (int)a3;
  for( i = 0; i < 0x2Au; ++i )
  {
    v9 = i;
    if( v9 >= 42 )
      _report_rangecheckfailure();
    DeviceIndexTable[v9] = 0;
  }
  while( 1 )
  {
    if( !a1 )
      return 0;
    if( *(_DWORD *)(a1 + 24) == 3 && !*(_DWORD *)(*(_QWORD *)a1 + 24i64) && *(_DWORD *)(a1 + 28) == 12 )
    {
      v5 = 0;
      v6 = stricmp(*(const char **)(a1 + 56), "ISA") == 0;
    }
    LODWORD(BusNumber) = v5;
    result = CmpInitializeRegistryNode(
               (_CONFIGURATION_COMPONENT_DATA *)a1,
               a2,
               &Handle,
               v6,
               BusNumber,
               (UINT16 *)DeviceIndexTable);
    if( result < 0 )
      return result;
    v11 = *(_QWORD *)(a1 + 8);
    if( v11 )
    {
      v12 = CmpSetupConfigurationTree(v11, Handle, (unsigned int)v6, v5);
      if( v12 < 0 )
        break;
    }
    ZwClose((_HANDLE)Handle);
    a1 = *(_QWORD *)(a1 + 16);
  }
  ZwClose((_HANDLE)Handle);
  return v12;
}

Referenced by:

CmpInitializeHardwareConfiguration
CmpSetupConfigurationTree