News:

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

Why full protos do not build in MASM32 ???

Started by Rockphorr, April 08, 2009, 08:07:09 PM

Previous topic - Next topic

Rockphorr

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
Strike while the iron is hot - Бей утюгом, пока он горячий

Vortex

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.

Rockphorr

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.
Strike while the iron is hot - Бей утюгом, пока он горячий

Vortex

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.

Rockphorr

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.
Strike while the iron is hot - Бей утюгом, пока он горячий

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Rockphorr

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

Strike while the iron is hot - Бей утюгом, пока он горячий