2012年1月4日 星期三

CD-ROM utility

For a cdrom utility.  The first step is to get exclusive access mode.  It enables applications and system components to obtain exclusive access to a CD-ROM device.  Callers that request exclusive access should not open the CD-ROM device by simply sending a create request to the file system driver, because there is no guarantee that the CD-ROM class driver will receive the request. Instead, applications should use theSetupDiXxx routines to enumerate the interfaces for all CD-ROM devices in the system and then open the appropriate device interface.


 There is one MS enumerate cdrom utility in the http://support.microsoft.com/kb/305184/en-us.  We can learn something from this utility.
    1. Win32 applications can use the SetupDixxx APIs to enumerate all of the devices that are available on a computer.

    2. The EnumCD sample provided by means of this article does the following:
  • Demonstrates SetupDixxx by enumerating all the CD drives regardless of their bus type.
  • Obtains a handle to the device to send IOCTL commands to get the adapter and device properties.
  • Uses SCSI pass-through commands to get the inquiry data and the drive capabilities.

沒有留言:

張貼留言