These 2 code blocks should function identically, I would think.
I marked in bold the only thing I changed (2 places).
This code functions properly:
This one fails:Code:#define MAX_SECTORS_PER_READ 27 #define RAW_SECTOR_SIZE 2352 ULONG sectorsPerRead; ULONG bytesPerRead; sectorsPerRead = MAX_SECTORS_PER_READ; bytesPerRead = sectorsPerRead * RAW_SECTOR_SIZE; fSuccess = DeviceIoControl(pextr->hCDROM, IOCTL_CDROM_RAW_READ, &info, sizeof(RAW_READ_INFO), smpl, sectorsPerRead * RAW_SECTOR_SIZE, &bytesRead, 0); if(bytesRead != sectorsPerRead * RAW_SECTOR_SIZE) __leave;
These makes no sense to me, as I see them as identical.Code:#define SECTORS_PER_READ 27 #define RAW_SECTOR_SIZE 2352 ULONG sectorsPerRead; ULONG bytesPerRead; sectorsPerRead = MAX_SECTORS_PER_READ; bytesPerRead = sectorsPerRead * RAW_SECTOR_SIZE; fSuccess = DeviceIoControl(pextr->hCDROM, IOCTL_CDROM_RAW_READ, &info, sizeof(RAW_READ_INFO), smpl, bytesPerRead, &bytesRead, 0); if(bytesRead != bytesPerRead) __leave;
Am I missing something here?




Reply With Quote