예제 #1
0
파일: Volume.cs 프로젝트: volschin/sdimager
        public void Dismount(bool Force = false, bool Permanent = false)
        {
            SafeFileHandle handle = GetLockHandle();

            if (handle != null)
            {
                IOWrapper.DismountVolume(handle);
            }
            else
            {
                var r = (uint)Call("Dismount", Force, Permanent);
                switch (r)
                {
                case 1: throw new SecurityException("Access Denied");

                case 2: throw new IOException("Volume Has Mount Points");

                case 3: throw new IOException("Volume Does Not Support The No-Autoremount State");

                case 4: throw new IOException("Force Option Required");
                }
            }
        }