예제 #1
0
 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;
 }
예제 #2
0
 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);
 }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }