public FuserDriveMounter(IFuserlDrive drive) { this.pDebugMode = false; this.drive = drive; this.thWorking = null; this.FuserMountDevice = null; this.MountPoint = ""; this.isMounted = false; }
public bool Mount(string mountPoint) { lock (this){ if (this.isMounted) { return(false); } this.isMounted = true; } try { IFuserFilesystemDevice fsDevice = new FuserInternalFilesystem(this.drive, this.pDebugMode); if (this.pDebugMode) { //this.driveLib = new DebugSynLock(this.driveLib); fsDevice = new DebugAndLogProxyFS(fsDevice); } this.FuserMountDevice = new FuserDevice(fsDevice, this.drive.Volumelabel, this.drive.Filesystem, this.drive.Serialnumber); this.FuserMountParam = new FuserDefinition.FUSER_MOUNT_PARAMETER(); this.FuserMountParam.ThreadsCount = 0; this.FuserMountParam.MountPoint = mountPoint; // TODO: Use options this.FuserMountParam.Flags = 0; this.FuserMountParam.Flags |= this.pDebugMode ? FuserDefinition.FUSER_MOUNT_PARAMETER_FLAG_STDERR : 0; this.MountPoint = mountPoint; this.thWorking = new Thread(pvStart); this.thWorking.Start(); } catch { lock (this){ this.isMounted = false; } return(false); } return(true); }