BOOLEAN GetSmapiEntry(PSMB pFunc)

 

 

 

{

 

 

 

 

PFSMB_HEADER_REAL

MyPtr

= ðxFððððððð ;

WORD

cnt =

ð

;

 

BYTE

cksum

=

ð

;

//

//1) Search for signature first

while((cnt++ < ðx1ððð) && !(((MyPtr->SMBHDR_SIG)[ð] == '$') &&

((MyPtr->SMBHDR_SIG)[1] == 'S') && ((MyPtr->SMBHDR_SIG)[2] == 'M') && ((MyPtr->SMBHDR_SIG)[3] == 'B') )) {

MyPtr++ ;

}

//

//2) Find the Signature?

if (cnt >= ðx1ððð) {

//We cannot find it. return FALSE ;

} else {

//3) Calculate Checksum

for (cnt = ð ; cnt < MyPtr->SMBHDR_LEN ; cnt++) cksum += (BYTE)((MyPtr->SMBHDR_SIG)[cnt]) ;

if (cksum) {

//Bad Checksum return FALSE ;

}else {

//Build Return Address

(\pFunc) = ( (DWORD)(MyPtr->SMBHDR_R_OFFSET) +

(((DWORD)(MyPtr->SMBHDR_R_SEGMENT)) << 16) ) ; return TRUE ;

}

}

}

ThinkPad 560/560E SMAPI BIOS

A-61

Page 125
Image 125
IBM 560E manual Pfsmbheaderreal