public static LockStatus LockDynamicDiskGroup(List <DynamicDisk> disksToLock, bool lockAllDynamicVolumes) { List <DynamicVolume> volumesToLock = new List <DynamicVolume>(); if (lockAllDynamicVolumes) { volumesToLock = WindowsDynamicVolumeHelper.GetLockableDynamicVolumes(disksToLock); } LockStatus status = LockHelper.LockAllOrNone(disksToLock, volumesToLock); if (status == LockStatus.Success) { m_lockedDisks.AddRange(disksToLock); m_lockedVolumes.AddRange(volumesToLock); } return(status); }