Bug in CDROM.SYS Vista x32

Hi all,

I am debugging a mini-port driver in Vista and the system is
consistently crashing in CdRompRetryTimeDetectionBasedOnModePage2A
function of mmc.c file. I have compiled the code from WinDDK 6000 and
replaced the cdrom.sys with the ddk’s build. I went through step by
step debug and the faulty code seems to be in line number 2168

dataLength -= sizeof(MODE_PARAMETER_HEADER10);
dataLength -= min(dataLength, sizeof(MODE_PARAMETER_BLOCK));

( ((UCHAR)header) +

After this code execution the “page” points to location 0x00000010. So
it is invalid and the following code at line number 2181 results in
bug check

dataLength = min(dataLength, ((ULONG)(page->PageLength) + 2));

I think it is going wrong in type conversion. Instead of calculating a
relative address based on “header” value it seems to be always doing
it by absolute value of sizeof(MODE_PARAMETER_HEADER10) +
sizeof(MODE_PARAMETER_BLOCK) which is always 0x10 (8+8).

Can any one comment on this or am I doing some thing wrong?