The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => Topic started by: Rockphorr on April 08, 2009, 08:07:09 PM

Title: Why full protos do not build in MASM32 ???
Post by: Rockphorr on April 08, 2009, 08:07:09 PM
After install new version of masm 32 i replace short protos to full:
Sample
AbortDoc PROTO  :DWORD
to
AbortDoc PROTO STDCALL :DWORD
it allow me replace model flat,stdcall to model flat and use manual mangle
Title: Re: Why full protos do not build in MASM32 ???
Post by: Vortex on April 09, 2009, 06:02:30 PM
stdcall is the default Win32 API calling convention and this is why you type .model flat,stdcall There are exceptions like wsprintf, C functions with the leading underscore. You need to be careful with procedure definitions if you turn off the stdcall mode.
Title: Re: Why full protos do not build in MASM32 ???
Post by: Rockphorr on April 27, 2009, 12:51:24 PM
Quote from: Vortex on April 09, 2009, 06:02:30 PM
stdcall is the default Win32 API calling convention and this is why you type .model flat,stdcall There are exceptions like wsprintf, C functions with the leading underscore. You need to be careful with procedure definitions if you turn off the stdcall mode.

if calling convention has specifed for each proto then mode wil not so important and mix modes are posible.
i will post sample of my code to illustrate it.
Title: Re: Why full protos do not build in MASM32 ???
Post by: Vortex on April 27, 2009, 03:17:28 PM
Hi Rockphorr,

It's true that mixed mode can work. In the normal programming practice, specifying the stdcall calling convention at the top of the source code will meet some basic Masm requirements.
Title: Re: Why full protos do not build in MASM32 ???
Post by: Rockphorr on November 03, 2009, 05:55:51 AM
Quote from: Vortex on April 27, 2009, 03:17:28 PM
Hi Rockphorr,

It's true that mixed mode can work. In the normal programming practice, specifying the stdcall calling convention at the top of the source code will meet some basic Masm requirements.


We can't do a choice (normal or mix mode) till it is absent.
Title: Re: Why full protos do not build in MASM32 ???
Post by: hutch-- on November 03, 2009, 07:35:56 AM
Rockphorr,

It was a decision made long ago to set the default prototype to STDCALL as almost all API calls are STDCALL. C and SYSCALL are rare enough to specify the different calling convention in each prototype.

If you wanted to change this you would have to build your own set of include files specifying the calling convention in every prototype.
Title: Re: Why full protos do not build in MASM32 ???
Post by: Rockphorr on November 03, 2009, 09:27:28 AM
Quote from: hutch-- on November 03, 2009, 07:35:56 AM
Rockphorr,

It was a decision made long ago to set the default prototype to STDCALL as almost all API calls are STDCALL. C and SYSCALL are rare enough to specify the different calling convention in each prototype.

If you wanted to change this you would have to build your own set of include files specifying the calling convention in every prototype.

Yes, I do it every time as include new dll from project.
I replase in my editor 'proto' to 'proto stdcall' in incfile