开发者

who push params to stack when call function using _stdcall or _cdcel in C/C++?

开发者 https://www.devze.com 2023-02-28 06:54 出处:网络
We declare exports function using _stdcall when wirte exports functions in Dll. Then the cleaning stacking work will be implemented by function who is called. I w开发者_Python百科ant to know who push

We declare exports function using _stdcall when wirte exports functions in Dll. Then the cleaning stacking work will be implemented by function who is called. I w开发者_Python百科ant to know who push params to stack when call function using _stdcall or _cdcel in C/C++? Thanks for you answer.


The caller function always pushes the parameters onto stack, except for __fastcall. Cleanup of the stack and the order parameters is governed by the calling convention.

See http://en.wikipedia.org/wiki/X86_calling_conventions for a good writeup.


The calling function will except in the case of naked will push the parameters on the stack. How would the called function know what to push.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号