Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATHOOK_PROLOGUE
#define CATHOOK_PROLOGUE ( numParams   ) 

Value:

__asm {push    ebp}                 \
    __asm {mov     ebp,esp}             \
    __asm {push    eax}                 \
    __asm {pushfd}                      \
    __asm {pushad}                      \
    __asm {sub     esp,__LOCAL_SIZE}    \
    __asm {mov     ecx,numParams+1 }    \
    __asm {mov     ebx,(numParams+1)*4} \
    __asm {repush_regs:}                \
    __asm {push    [ebp+ebx]}           \
    __asm {sub     ebx,4}               \
    __asm {loop    repush_regs}{
Our hook function prologue takes the *original* number of parameters for the function being hooked. It stores all the registers and sets up our stack frame and return values. We then repush relevant parameters onto the stack so that our C/C++ can in hook functions can be pretty. Also note that it has a trailing '{' that must be closed by a CATHOOK_EPILOGUE macro.

Definition at line 63 of file CATIntercept.h.

Referenced by CATOpenALIntercept::OnALBufferData(), CATOpenALIntercept::OnALQueueBuffers(), CATOpenALIntercept::OnALSourcePlay(), CATOpenALIntercept::OnALSourcePlayV(), CATOpenALIntercept::OnALSourceStop(), CATOpenALIntercept::OnALSourceStopV(), CATInjectionPropagate::OnCreateProcessW(), CATOverlayDirect3D9::OnEndScene(), CATTimeWarp::OnGetTickCount(), CATDirectSoundIntercept::OnLockBuffer(), CATDirectSoundIntercept::OnPlayBuffer(), CATDirectSoundIntercept::OnPlayBufferEAX(), CATDirectSoundIntercept::OnPlaySegment(), CATDirectSoundIntercept::OnPlaySegmentEx(), CATOverlayDirect3D9::OnPresent9(), CATTimeWarp::OnQueryPerformanceCounter(), CATOverlayOpenGL::OnSwapBuffers(), CATTimeWarp::OnTimeGetTime(), and CATDirectSoundIntercept::OnUnlockBuffer().


Generated on Mon Feb 11 04:10:00 2008 for Game Accessibility Suite by doxygen 1.5.4