invoke最终会调用_AfxDispatchCall
__declspec(naked) void AFXAPI_AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/){_asm{popedx// edx = return addresspopeax// eax = pfnpop
·
__declspec(naked) void AFXAPI
_AfxDispatchCall(AFX_PMSG /*pfn*/, void* /*pArgs*/, UINT /*nSizeArgs*/)
{
_asm
{
pop edx // edx = return address
pop eax // eax = pfn
pop ecx // ecx = pArgs
add ecx,[esp] // ecx += nSizeArgs (=scratch area)
mov [ecx],edx // scratch[0] = return address
sub ecx,[esp] // ecx = pArgs (again)
mov esp,ecx // esp = pArgs (usually already correct)
pop ecx // ecx = this pointer (the CCmdTarget*)
call eax // call member function
ret // esp[0] should = scratch[0] = return address
}
}
olcall.cpp
更多推荐
已为社区贡献3条内容
所有评论(0)