我的4.2的版本中找到类似的一段代码,你注意看看注释部份,也许会给你些启发。
// read records (start with address, length, and checksum)
while (OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecAddr)
&& OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecLen)
&& OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecChk)) {
// check for last record
if (!dwRecAddr && !dwRecChk) {
// if this is the kernel region, update launch address
if (IsKernelRegion(dwImageStart, dwImageLength)) {
*pdwImageStart = dwImageStart;
*pdwImageLength = dwImageLength;
*pdwLaunchAddr = dwRecLen;
}