Пример #1
0
 public bool Open(char Drive)
 {
     Close();
     if (Win32Functions.GetDriveType(Drive + ":\\") == Win32Functions.DriveTypes.DRIVE_CDROM)
     {
         cdHandle = Win32Functions.CreateFile("\\\\.\\" + Drive + ':', Win32Functions.GENERIC_READ,
                                              Win32Functions.FILE_SHARE_READ, IntPtr.Zero,
                                              Win32Functions.OPEN_EXISTING, 0, IntPtr.Zero);
         if (((int)cdHandle != -1) && ((int)cdHandle != 0))
         {
             m_Drive              = Drive;
             NotWnd               = new DeviceChangeNotificationWindow();
             NotWnd.DeviceChange += NotWnd_DeviceChange;
             return(true);
         }
         else
         {
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }