CallerAddr Routine
Returns the address that the calling procedure will return to.

Unit
TestFramework

Declaration
Function CallerAddr: Pointer;

Description
Used internally by the framework. Don't use directly.

Implementation

function CallerAddr :Pointer; assembler;
const
  CallerIP = $4;
asm
   push  4
   push  ebp
   call  IsBadReadPtr
   test  eax,eax
   jne   @@Error

   mov   eax, [ebp].CallerIP
   sub   eax, 5   // 5 bytes for call

   push  eax
   push  4
   push  ebx
   call  IsBadReadPtr
   test  eax,eax
   pop   eax
   je    @@Finish

@@Error:
   xor eax, eax
@@Finish:
End;


HTML generated by Time2HELP
http://www.time2help.com