News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

c++ call and masm call

Started by ToutEnMasm, January 27, 2008, 04:14:27 PM

Previous topic - Next topic

ToutEnMasm

Hello,
I want to know the translation of each c++ call in masm call.

__cdecl   is   'PROTO C'   in masm
__clrcall
__stdcall   'PROTO'   
__fastcall
__thiscall  'PROTO + 1 dword'

Masm offer this call

C, SYSCALL, STDCALL, PASCAL, FORTRAN, or BASIC.

By what can be translate the __clrcall  and __fastcall in masm ?






MichaelW

The conventions for __fastcall are straightforward, but they vary with the compiler:

http://en.wikipedia.org/wiki/Fastcall

The _clrcall convention is Microsoft specific, and in the short time I spent looking I could not find any detailed information. Apparently a function can have both native and managed entry points, but I did not find any statement that the native entry point will always be present.

http://msdn2.microsoft.com/en-us/library/ec7sfckb.aspx

eschew obfuscation

jdoe

ToutEnMasm,

http://blogs.msdn.com/oldnewthing/archive/2004/01/08/48616.aspx


__cdecl  :  PROTO C



__stdcall  :  PROTO STDCALL



__clrcall  :  I have no idea



__fastcall  : I think it just can't be done with MASM but the workaround is like this

Win32...
EXTERNDEF SYSCALL @Dns_ReadPacketName@28:PROC
Dns_ReadPacketName EQU <@Dns_ReadPacketName@28>

On Win64 platform, everything is like...
EXTERNDEF Dns_ReadPacketName:PROC



__thiscall  :  ECX + PROTO STDCALL (only a guess)