News:

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

Headers 2.0

Started by donkey, March 30, 2009, 02:14:02 AM

Previous topic - Next topic

travism

Guess ill just stick to the old headers.. :'(

ecube

This is a GoASM issue, not the headers, GoASM needs a entry point, by default it assumes it's start so do

#DEFINE LINKFILES
#DEFINE WIN32_LEAN_AND_MEAN
#include "WINDOWS.H"

CODE SECTION
START:
;your code

invoke ExitProcess,0 ;optional clean exit


If you want to get started with GoASM I recommend you checkout the older SDK I put together at http://www.masm32.com/board/index.php?topic=11180.0
it has quite a few 32bit/64bit examples that come with build.bat's.

travism

Yeah, I have exactly that. I can make any other program with the old headers but as soon as I change the includes to what you have there  I get there error. So I dont know what it is :\

ecube

try building with

build.bat

set INCLUDE=C:\GoAsm\include

\GoAsm\bin\GoAsm /x86 sourcename.asm
\GoAsm\bin\GoLink sourcename.obj
pause

travism

Worked perfect! Thank you! Finally something works now lol  :dance:

donkey

Hi travism et al,

Sorry I didn't have a chance to answer I am quite busy at work right now, glad you got it worked out.

GOASMHDRVER = 0x020009

Added CHOOSECOLOR structure to unicode switches (Thanks Ramon). Added a WIN64_LEAN_AND_MEAN switch that functions exactly like WIN32_LEAN_AND_MEAN except it turns on 64 bit support. WIN32_LEAN_AND_MEAN will now disable 64 bit switches if any.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mark Jones

#36
Thanks Edgar, your support is appreciated.

Curious, this from the RadASM templates, is no longer needed, correct?

// NOTE: INCLUDE Environment variable must be set to headers path
// Kludge for goasm bug
#DEFINE IDISPATCH_DEFINED
#DEFINE IUNKNOWN_DEFINED
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

donkey


Not actually a bug in GoAsm, though I originally treated it as such, the new templates have "symbol conflict" instead of "bug". It is only needed if you are going to use any COM headers since IUnknown and IDispatch are both actual interfaces but are used as structure member names in all COM headers as well. Once you define those two symbols the raw IUnknown and IDispatch interface structures are no longer available but it allows for IPersistFile.IUnknown.Release syntax which I decided was a fair trade-off. I generally include them in all my programs since I make extensive use of COM.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mark Jones

Oh, I didn't see there was a separate section for RadASM support downloads. :bg I need glasses, really.

Since the above is statically defined in Windows.h it is redundant to redefine it. I'm experimenting with something like this as a template header:

// Headers by Donkey http://www.quickersoft.com/donkey/index.html
// NOTE: the INCLUDE environment variable must be set to headers path

#DEFINE WIN32_LEAN_AND_MEAN // Include minimal set of common defs only

#DEFINE LINKFILES // Passes the appropriate DLLs to GoLink
//#DEFINE LINKVCRT // Include MSVCRT.DLL in functions list
//#DEFINE C99HDRS  // Include the C99 hdrs, use with LINKVCRT
//#DEFINE CCUSEORDINALS // Access common controls by ordinal
//#DEFINE ODBC_STD // Standard ODBC definitions
//#DEFINE X86USEUNDOC // Use undocumented opcodes

#DEFINE NOCARD  // No SmartCard Subsystem definitions
//#DEFINE NOCON // No Console subsystem definitions
#DEFINE NOCRYPT  // No Cryptographic API definitions
#DEFINE NOGDI // No GDI Module definitions
#DEFINE NOGDIPLUS // No GDI Plus definitions
#DEFINE NOIME // No Input Method Manager definitions
#DEFINE NOMCX // No MCX API definitions
#DEFINE NONETWORK // No Network definitions
#DEFINE NONLS // No NLS component definitions
#DEFINE NOOLE // No Linking and Embedding API definitions
#DEFINE NOREG // No Registry API definitions
#DEFINE NOSERVICE // No Service Control Manager definitions
#DEFINE NOTV // No TV definitions
//#DEFINE NOUSER  // No User Module definitions
#DEFINE NOVER // No version management definitions

#DEFINE NODONKEY // No Donkeylib definitions
#DEFINE NORADASM // No RadAsm plugin definitions
#DEFINE NOZLIB  // No Zlib static library definitions

#include "WINDOWS.H" // Main Windows definitions
#include "Commctrl.h" // Common Controls definitions


Edit: Also, somehow "@$B\GFL.txt" seems to have persevered throughout some of the RadASM template command-lines. I'm working on cleaning those up.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

donkey

Sounds good Mark, yes, a few things slip by even though I try to get them all.

For the header, NODONKEY, NORADASM and NOZLIB are deprecated and no longer necessary, I neglected to remove them from the comments section. You're right I had not noticed that I defined them in windows.h, that one got past me...

Here are the template masters that I use...

[attachment deleted by admin]
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mark Jones

Thanks.

I just thought about "porting" any additions I had made to my RadASM's masm .API files to the GoASM versions, and discovered several hundred discrepancies. For instance:



Here is a tiny part of a comparison between the two. Looking up "WriteClassStg" in Win32.hlp for instance,

QuoteWriteClassStg: Stores the specified CLSID in a storage object.

HRESULT WriteClassStg(

    IStorage * pStg,    //Points to the storage object
    REFCLSID rclsid   //Specifies the CLSID to be stored in the storage object
   );

Here "rclsid" is missing from the GoASM API entry definition but not MASM's. There are hundreds of these, all missing the final value...
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

donkey

That would be a great idea, I had noticed this too but was preoccupied with the header project and didn't do anything about it. It should just be a renaming of the api file as far as I can remember. The big task is to rebuild the struct file which has many incompatible structures in it since the header project follows MSDN member names and not the MASM ones (ie struct.cx instead of struct.lx). I had planned on doing it one day but never seem to get the energy to tackle it, perhaps an automated approach would be best for that particular file.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mark Jones

Attached is what I came up with quickly merging the MASM and GoASM .API files. They additionally contain defs for GDI, GDIPLUS, OpenGL, sDraw, and a line or two of SDL (all these entries are at the end so can be accessed easily.) I also renamed and included the "masmType.api", although it is unclear if this is even utilized. As usual, there is a significant probability for bugs. :toothy

I think you're right about the structure definitions, an automated approach is needed. One readily visible difference is anything with a "mask" element---MASM always defines them as "imask" or "_mask" or similar (to avoid a conflict assumedly) while GoASM does not seem to have that limitation.

[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

donkey

Hi Mark,

Automating the struct file is the only way I can see to get it complete and correct. It is a difficult task however since there are some pretty complex structures in the headers, far too much for me to take on during the busy time at work. If some-one can take it on and build a decent file (hopefully with the COM structures as well) then I will upload it to my site and we can ask Ketil to include it in the distribution of RadASM.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mark Jones

Yeah that's a little above me also. Been rebuilding my box after a drive failure. Good news is, finally installed 64-bit XP. Things are mostly working, so if everything goes well, hopefully I can come up with some 64-bit templates. Should be fun... wish me luck. :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08