An Auto PC includes a CD player and an optional CD changer. You control these devices with the Advanced Technology Attachment (ATA) packet interface driver. This driver provides a standard set of I/O control codes that enable you to obtain disc and track information, and to start and stop the CD player.
The flags are AAM_SRC_CD for the CD player and AAM_SRC_CDCHANGER for the CD changer.
AAM_GetSourceCap provides you with a device driver, such as CDR1, you can use to open the device. You open the device by calling CreateFile, which returns a device handle.
The following code example shows how to use CreateFile to obtain a device handle.
g_hDev = CreateFile (TEXT("CDR1:"), GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, 0);
if (INVALID_HANDLE_VALUE == g_hDev)
{
return FALSE;
}