IopIsPciRootBus

INT64 __stdcall IopIsPciRootBus(DEVICE_OBJECT *PhysicalDeviceObject, UINT8 *IsRootBus){
  INT64 result; 
  _WORD *PoolWithTag; 
  NTSTATUS DeviceProperty; 
  const wchar_t *v7; 
  SIZE_T NumberOfBytes; 
  LODWORD(NumberOfBytes) = 0;
  *IsRootBus = 0;
  LODWORD(result) = IoGetDeviceProperty(PhysicalDeviceObject, DevicePropertyHardwareID, 0, 0i64, (PULONG)&NumberOfBytes);
  if( (_DWORD)result == -1073741789 )
  {
    PoolWithTag = ExAllocatePoolWithTag(PagedPool, (unsigned int)NumberOfBytes, 0x20207050ui64);
    if( PoolWithTag )
    {
      DeviceProperty = IoGetDeviceProperty(
                         PhysicalDeviceObject,
                         DevicePropertyHardwareID,
                         NumberOfBytes,
                         PoolWithTag,
                         (PULONG)&NumberOfBytes);
      if( DeviceProperty >= 0 )
      {
        v7 = PoolWithTag;
        if( *PoolWithTag )
        {
          while( wcsicmp(v7, L"ACPI\\PNP0A03") && wcsicmp(v7, L"ACPI\\PNP0A08") )
          {
            while( *v7 )
              ++v7;
            if( !*++v7 )
              goto LABEL_9;
          }
          *IsRootBus = 1;
        }
LABEL_9:
        DeviceProperty = 0;
      }
      ExFreePoolWithTag(PoolWithTag, 0);
      return(unsigned int)DeviceProperty;
    }
    else
    {
      return 3221225626i64;
    }
  }
  return result;
}

Referenced by:

IopMemQueryConflict