Beispiel #1
0
        public static void UnlockBasicDiskAndVolumes(PhysicalDisk disk)
        {
            List <Partition> partitions = BasicDiskHelper.GetPartitions(disk);

            foreach (Partition partition in partitions)
            {
                Guid?windowsVolumeGuid = WindowsVolumeHelper.GetWindowsVolumeGuid(partition);
                if (windowsVolumeGuid.HasValue)
                {
                    WindowsVolumeManager.ReleaseLock(windowsVolumeGuid.Value);
                }
            }

            disk.ReleaseLock();
        }