CmRemoveDeviceFromContainer

NTSTATUS __stdcall CmRemoveDeviceFromContainer(
        HPNPCTX *hPnpCtx,
        WCHAR *ContainerId,
        WCHAR *BaseContainerId,
        WCHAR *DeviceInstanceId,
        WCHAR *ContainerDeleted,
        WCHAR *DeviceInstanceIda,
        WCHAR *a7,
        UINT8 *a8,
        INT64 a9,
        UINT8 a10){
  __int64(__fastcall *v14)(HPNPCTX *, WCHAR *, __int64); 
  int v15; 
  NTSTATUS v16; 
  NTSTATUS v17; 
  int v18; 
  WCHAR *v20; 
  WCHAR *v21; 
  UINT8 *v22; 
  WCHAR v23[48]; 

  memset(v23, 0i64, 0x58u);
  v14 = (__int64(__fastcall *)(HPNPCTX *, WCHAR *, __int64))*((_QWORD *)hPnpCtx + 63);
  *(_QWORD *)&v23[12] = DeviceInstanceId;
  *(_QWORD *)&v23[8] = BaseContainerId;
  if( v14 )
  {
    v20 = v23;
    v15 = v14(hPnpCtx, ContainerId, 5i64);
    if( v15 == -1073741822 )
    {
      v14 = 0i64;
    }
    else
    {
      if( v15 == -1073741536 )
        return *(_DWORD *)v23;
      if( v15 )
        return -1073741595;
    }
  }
  v16 = CmRemoveDeviceFromContainerWorker(
          hPnpCtx,
          ContainerId,
          *(WCHAR **)&v23[8],
          *(WCHAR **)&v23[12],
          &v23[16],
          v20,
          v21,
          v22,
          *(INT64 *)v23,
          v23[4]);
  v17 = v16;
  if( v14 )
  {
    *(_DWORD *)v23 = v16;
    v18 = v14(hPnpCtx, ContainerId, 5i64);
    if( v18 != -1073741822 )
    {
      if( v18 != -1073741536 )
      {
        if( !v18 )
          goto LABEL_9;
        return -1073741595;
      }
      return *(_DWORD *)v23;
    }
  }
LABEL_9:
  if( !LOBYTE(v23[16]) )
    PnpObjectRaiseDevicesChangeEvent((__int64)hPnpCtx, (__int64)ContainerId, 5i64);
  return v17;
}

Referenced by:

CmDeleteDeviceWorker
CmMoveBaseContainer
PiDcResetChildDeviceContainers
PiDcUpdateDeviceContainerMembership