The MASM Forum Archive 2004 to 2012

Specialised Projects => Assembler/Compiler Technology => Topic started by: Zap on April 23, 2009, 09:43:12 AM

Title: Platform SDK headers into MASM headers
Post by: Zap on April 23, 2009, 09:43:12 AM
hi,
i hear theres a program transforming subj.
when i need one or two functions,i do it myself & put them in .asm,
but i`m going to use winsock2.h,so there`s a lot to do by hand.
Thanx.
Title: Re: Platform SDK headers into MASM headers
Post by: Vortex on April 23, 2009, 09:49:11 AM
Hi Zap,

Welcome to the forum.

You would like to have a look at Japheth's h2incx tool :

Quote
About h2incx
This tool's purpose is to convert C header files to Masm-style include files. It is much more powerful than Microsoft's h2inc tool. The main purpose is to convert the Win32 include files, but it should work with any C header files as well. It is a simple Win32 console application, but a 32bit DOS extended binary version is included as well to be used on Non-Win32 platforms.
Features

    * a private profile file is used which allows fine-tuning of the include files to generate.
    * huge C header sets can be converted in one run (for example the Win32 headers contained in the PSDK).
    * prototypes may be written so the include file fits for both dynamic linking to a dll (using the IAT entries) and static linking to a library.
    * optionally a .DEF file is written, which can then be converted to an import library with POLIB.

Known Bugs and Restrictions
In many cases the conversion will not be 100 percent, there will always remain some places where additional manual modifications will be required:

    * one should be aware that some C header file declarations simply cannot be translated to ASM. There are no things like inline functions in ASM, for example.
    * on some situations h2incx has to "count" braces. This can interfere with #if preprocessor commands, because h2incx cannot evaluate expressions in these commands. As a result h2incx may get confused and produce garbage.
    * h2incx has some limited knowledge about C++, but it's original purpose was to convert C headers. So some C++ specific keywords may confuse h2incx, which is also true for templates.
    * "far" and "near" qualifiers are skipped, so this tool will not work for 16bit includes.
    * macros in C header files will most likely not be converted reliably and therefore may require manual adjustments.

http://japheth.de/h2incX.html
Title: Re: Platform SDK headers into MASM headers
Post by: ToutEnMasm on April 23, 2009, 12:32:00 PM

There is nothing to translate with
ready to use SDK for XP
http://pagesperso-orange.fr/luce.yves/sdk.zip
ready to use SDK for Vista
http://pagesperso-orange.fr/luce.yves/sdkvista.zip

see http://www.masm32.com/board/index.php?topic=10738.msg78616#msg78616
and others post in case of need


Title: Re: Platform SDK headers into MASM headers
Post by: drizz on April 23, 2009, 01:06:09 PM
Vortex, you missed the link pointing to already translated complete PSDK headers:
http://japheth.de/win32inc.html