CmGetDeviceStatus

__int64 __fastcall CmGetDeviceStatus(
        __int64 a1,
        const WCHAR *a2,
        __int64 a3,
        int *a4,
        _DWORD *a5,
        _DWORD *a6,
        unsigned int a7){
  _DWORD *v7; 
  char v8; 
  _DWORD *v9; 
  int inited; 
  int v14; 
  int v16; 
  struct _UNICODE_STRING DestinationString; 
  int v19; 
  v7 = a5;
  v8 = 0;
  v9 = a6;
  *a4 = 0;
  v19 = 0;
  *v7 = 0;
  *v9 = 0;
  DestinationString = 0i64;
  v16 = 0;
  inited = RtlInitUnicodeStringEx(&DestinationString, (WCHAR *)a2);
  if( inited >= 0 )
  {
    inited = NtPlugPlayGetDeviceStatus(a1, (__int64)&DestinationString, (__int64)a4, (__int64)v7, (__int64)v9);
    if( inited >= 0 )
    {
      a7 = 4;
      if( !(unsigned int)CmGetDeviceRegProp(a1, a2, a3, 11, (__int64)&v19, (__int64)&v16, (__int64)&a7, 0)
        && a7 >= 4
        && v19 == 4 )
      {
        v8 = v16;
      }
      v14 = *a4;
      if( (v8 & 4) != 0 )
      {
        v14 |= 0x10u;
        *a4 = v14;
      }
      if( (v14 & 0x400) == 0 && (v8 & 0x40) != 0 )
      {
        *a4 = v14 | 0x400;
        *v7 = 28;
      }
    }
  }
  return(unsigned int)inited;
}

Referenced by:

CmGetDeviceMappedPropertyFromComposite
CmIsDeviceSafeRemovalRequired
PiCMDeleteDevice
PiCMDeviceAction
PiCMGenerateDeviceInstance
PiCMGetDeviceStatus
PiCMQueryRemove
PiCMSetProblem
PiCMValidateDeviceInstance
PpDevCfgProcessDevices