OS/2 codes: How to control CD-ROM drives
OS/2 provides ioctl commands to control CD-ROM drives and discs. And some commands have been added with new OS2CDROM.DMD. In this article, let's research the ways to control CD-ROM drives and to utilize new commands. 1. Opening or Closing a Tray The most strange thing of OS/2 ioctl commands are CDROMDISK_CLOSETRAY . It's not possible to issue the command. Because a handle for a disc is required to issue, but there is no way to open a handle for the opened drives. This is applied to CDROMDISK_EJECTDISK . It's not possible to issue the command if a disc is not in a drive. To open and/or to close a tray, another way should be used. OS/2 provides general ioctl commands to eject and to load a media for a removable media . Ejecting is used to open a tray. Loading is used to close a tray. These commands can be issued without a handle. Therefore, it's possible to open and to close a tray even if a disc is not in the drive. Codes are like this: Colored By Color Scri