CDPLAY - 2


DWORD lpTransferAddress;

WORD wDataSize;

WORD wStartSector;

DWORD lpVolID;

} IOCTL_Output;

// -

typedef struct _EjectDisk

{

BYTE bControl;

} EjectDisk;

#pragma pack()

//

void GetCDLetters(BYTE *bLetters);

void CallCDDriver(void *rh, int nCDUnit);

int PlayAudioTrack(DWORD dwLoc, DWORD dwSectorNum, int nCDUnit);

int StopAudio(int nCDUnit);

int DeviceOpen(int nCDUnit);

int DeviceClose(int nCDUnit);

int EjectCD(int nCDUnit);

DWORD Red2Sierra(DWORD dwRedLoc);

// int86

union REGS rg;

// CD-ROM

int nCDUnits;

// CD-ROM

int nCDStartUnit;

// CD-ROM

int iStatus;

// CD-ROM

BYTE bLetters[26];

// ---------------------------------------------------

// main

//

// ---------------------------------------------------

int main(int argc, char *argv[])

{

int i;

DWORD dwStartTrack;

printf("CDPLAY, (c) A. Frolov, 1997\n\n");

dwStartTrack = 1;

if(argc == 2)

{

dwStartTrack = atol(argv[1]);

printf("Track Red book: %ld\n", dwStartTrack);

}

else

{

printf("Usage: CDPLAY <Red book sector address>\n");

return -1;

}

// Sierra

dwStartTrack = Red2Sierra(dwStartTrack);

printf("Track Sierra: %ld\n", dwStartTrack);

// , MSCDEX

rg.x.ax = 0x1500;

rg.x.bx = 0;

int86(0x2f, &rg, &rg);

if(rg.x.bx == 0)

{

printf("MSCDEX is not installed\n");

return -1;

}

else

{

// CD-ROM

nCDUnits = rg.x.bx;