CDINFO - 5


if(iRetry == 3)

{

printf("GetDiskInfo failed\n");

break;

}

iStatus = GetDiskInfo(bLetters[i]);

}

// -,

//

if(iRetry != 3)

{

//

printf("Tracks: (%d - %d) %d\n",

di.bLowest, di.bHighest, di.dwTotal);

//

for(j = di.bLowest; j <= di.bHighest; j++)

{

//

GetTrackInfo(j, bLetters[i]);

printf("track %d: location: %ld, info: %02.2X",

j, ti.dwLoc, ti.bInfo);

// -

//

if(ti.bInfo & 0x40)

printf(" * digital");

else

printf(" * audio");

// ,

if(ti.bInfo & 0x20)

printf(", copy permitted *\n");

else

printf(", copy prohibited *\n");

}

}

}

return 0;

}

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

// GetDiskInfo

// -

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

int GetDiskInfo(int nCDUnit)

{

// IOCTL Input

IOCTL_Input cmd;

//

memset(&cmd, 0, sizeof(IOCTL_Input ));

//

cmd.rh.bSize = 26;

cmd.rh.bSubUnit = 0;

cmd.rh.bCmd = 3;

cmd.bMediaDescriptor = 0;

cmd.lpTransferAddress = (DWORD)(void far *)&di;

cmd.wDataSize = 7;

cmd.wStartSector = 0;

cmd.lpVolID = (DWORD)(void far *)NULL;

di.bControl = 10;

//

CallCDDriver(&cmd, nCDUnit);

return cmd.rh.wStatus;

}

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