Controlling a CD Player

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.

    To control the CD player

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;
    }