public void Close() { this.UnLockCD(); if (this.NotWnd != null) { this.NotWnd.DestroyHandle(); this.NotWnd = null; } if ((((int)this.cdHandle) != -1) && (((int)this.cdHandle) != 0)) { Kernel32.CloseHandle(this.cdHandle); } this.cdHandle = IntPtr.Zero; this.m_Drive = '\0'; this.TocValid = false; }
public bool Open(char Drive) { this.Close(); if (Kernel32.GetDriveType(Drive + @":\") == Kernel32.DriveTypes.DRIVE_CDROM) { this.cdHandle = Kernel32.CreateFile(@"\\.\" + Drive + ':', 0x80000000, 1, IntPtr.Zero, 3, 0, IntPtr.Zero); if ((((int)this.cdHandle) != -1) && (((int)this.cdHandle) != 0)) { this.m_Drive = Drive; this.NotWnd = new DeviceChangeNotificationWindow(); this.NotWnd.DeviceChange += new DeviceChangeEventHandler(this.NotWnd_DeviceChange); return(true); } return(true); } return(false); }
public bool Open(char Drive) { this.Close(); if (Kernel32.GetDriveType(Drive + @":\") == Kernel32.DriveTypes.DRIVE_CDROM) { this.cdHandle = Kernel32.CreateFile(@"\\.\" + Drive + ':', 0x80000000, 1, IntPtr.Zero, 3, 0, IntPtr.Zero); if ((((int)this.cdHandle) != -1) && (((int)this.cdHandle) != 0)) { this.m_Drive = Drive; this.NotWnd = new DeviceChangeNotificationWindow(); this.NotWnd.DeviceChange += new DeviceChangeEventHandler(this.NotWnd_DeviceChange); return true; } return true; } return false; }