Beispiel #1
0
        public static IDriveProvider Mount(IntPtr hdc)
        {
            if (FileSystem.mounted.Contains(hdc))
            {
                throw new InvalidOperationException("Already mounted");
            }

            var drive = new NativeDriveProvider();

            var provider = DriveInfo.RegisterDriveProvider(drive);

            FileSystem.Initialize(hdc, provider.Name);

            mounted[hdc] = drive;

            return(drive);
        }