CDINFO, CDREC, CDLIST


  #define  MAXIDLEN   64
  #define  MAXCDLIST  8

  typedef struct
  {
    char vendor[9];
    char prodId[17];
    char rev[5];
    char vendSpec[21];
  } CDINFO, *PCDINFO, FAR *LPCDINFO;

  typedef struct
  {
    BYTE    ha;
    BYTE    tgt;
    BYTE    lun;
    BYTE    pad;
    char    id[MAXIDLEN + 1];
    CDINFO  info;
  } CDREC, *PCDREC, FAR *LPCDREC;

  typedef struct
  {
    BYTE    max;
    BYTE    num;
    CDREC   cd[MAXCDLIST];
  } CDLIST, *PCDLIST, FAR *LPCDLIST;
  
Description: Used in calls to GetCDList to enumerate and collect information on available CD-ROM units.

Members:
CDINFO:
vendor ASCIIZ string with hardware vendor's name
prodId ASCIIZ string with product identification
rev ASCIIZ string with hardware revision
vendSpec ASCIIZ string with vendor specific information

CDREC:
ha Host adapter
tgt Target
lun LUN
pad Padding byte
id ASCIIZ Identification string for CD-ROM unit
info CDINFO structure for the CD-ROM unit

CDLIST:
max Maximum number of entries in the array cd. Must be initialized to the value MAXCDLIST
num Actual number of valid used entries in the array cd
cd Array of CDREC structures


Example usage: The following code prints out a list of available CD-ROM units.
  void printCDList( void )
  {
    CDLIST cd;
    int i;

    memset( &cd, 0, sizeof(cd) );
    cd.max = MAXCDLIST;
    GetCDList( &cd );
    for( i = 0; i < cd.num; i++ )
      printf( "CD Unit %d: %s\n", i+1, cd.cd[i].info );
  }
  
See also: GetCDList