Exemple #1
0
        private List <FuserEventHandler> FuserEvents; // to prevent garbage collector

        public FuserDevice(IFuserFilesystemDevice fsDevice, string Volumelabel, string Filesystem, uint Serialnumber)
        {
            this.fsDevice         = fsDevice;
            this.UsedMountPoint   = "";
            this.heartbeat        = null;
            this.hManager         = new FuserHandlerManager();
            this.FuserEventLoader = null;
            this.FuserEvents      = null;

            this.volumelabel  = Volumelabel;
            this.filesystem   = Filesystem;
            this.serialnumber = Serialnumber;
        }
Exemple #2
0
        public int           Mount(IntPtr rawMountPoint, IntPtr rawDeviceName, IntPtr rawRawDevice)
        {
            try {
                if (this.heartbeat != null)
                {
                    return(0);
                }

                string mountPoint = Marshal.PtrToStringUni(rawMountPoint);
                string deviceName = Marshal.PtrToStringUni(rawDeviceName);
                string rawDevice  = Marshal.PtrToStringUni(rawRawDevice);

                this.heartbeat = new FuserHeartbeat(mountPoint, deviceName); // start Heartbeat

                this.UsedMountPoint = mountPoint;
                return(ConvReturnCodeToInt(this.fsDevice.Mount(mountPoint, rawDevice)));
            } catch (Exception e) {
                //System.Diagnostics.Debugger.Break();
                this.fsDevice.LogErrorMessage("Mount", e.Message);
                return(ConvReturnCodeToInt(Win32Returncode.DEFAULT_UNKNOWN_ERROR));
            }
        }