CmRemoveDeviceFromContainer

__int64 __fastcall CmRemoveDeviceFromContainer(__int64 a1, const WCHAR *a2, __int64 a3, __int64 a4){
  __int64(__fastcall *v8)(__int64, const WCHAR *, __int64); 
  int v9; 
  unsigned int v10; 
  unsigned int v11; 
  int v12; 
  INT64 result[2]; 
  const WCHAR *v15; 
  const WCHAR *v16; 
  char v17[64]; 
  memset((INT64)result, 0i64);
  v8 = *(__int64(__fastcall **)(__int64, const WCHAR *, __int64))(a1 + 504);
  v16 = (const WCHAR *)a4;
  v15 = (const WCHAR *)a3;
  if( v8 )
  {
    v9 = v8(a1, a2, 5i64);
    if( v9 == -1073741822 )
    {
      v8 = 0i64;
    }
    else
    {
      if( v9 == -1073741536 )
        return LODWORD(result[0]);
      if( v9 )
        return(unsigned int)-1073741595;
    }
  }
  v10 = CmRemoveDeviceFromContainerWorker(a1, a2, v15, v16, v17);
  v11 = v10;
  if( v8 )
  {
    LODWORD(result[0]) = v10;
    v12 = v8(a1, a2, 5i64);
    if( v12 != -1073741822 )
    {
      if( v12 != -1073741536 )
      {
        if( !v12 )
          goto LABEL_9;
        return(unsigned int)-1073741595;
      }
      return LODWORD(result[0]);
    }
  }
LABEL_9:
  if( !v17[0] )
    PnpObjectRaiseDevicesChangeEvent(a1, (__int64)a2, 5i64);
  return v11;
}

Referenced by:

CmDeleteDeviceWorker
CmMoveBaseContainer
PiDcResetChildDeviceContainers
PiDcUpdateDeviceContainerMembership