The MASM Forum

Projects => Poasm => Topic started by: traphunter on December 05, 2013, 10:36:36 PM

Title: PROTOs
Post by: traphunter on December 05, 2013, 10:36:36 PM
Hi everybody!

I had a look at poasm, but I don't like to declare every API-function manually.
I can't get the FuncProtos.zip (http://forum.pellesc.de/index.php?topic=5092.0 (http://forum.pellesc.de/index.php?topic=5092.0)) because guest are not allowed to download attachments, I guess. Could I get this file here?
Title: Re: PROTOs
Post by: TWell on December 05, 2013, 11:34:40 PM
Another option is WinInc from here (http://www.japheth.de/WinInc.html)
Maybe some problems with it too (http://forum.pellesc.de/index.php?topic=4024.msg14733#msg14733) ?
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 12:26:28 AM
is there some reason the masm32 package includes don't work ?
is there some reason masm doesn't work ?   :redface:

it's a safe bet that most of us don't want to prototype all the API functions, either
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 01:59:31 AM
thank you both!

with goasm and easy code I've just included windows.inc and general functions like ExitProcess assembled fine. With poasm, poide and masm32 includes it doesn't work. I tried to include winbase.inc, but this inc file doesn't exist. And for masm32 I can't get uptodate binaries. There is allways sand in the gear.

BTW, I like goasm syntax but I don't like some behaviour from easy code.
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 03:42:09 AM
ok
if you want to continue to use GoAsm, then use Edgar's headers
http://masm32.com/board/index.php?board=10.0 (http://masm32.com/board/index.php?board=10.0)

http://www.donkeysstable.com/goasm_headers.htm (http://www.donkeysstable.com/goasm_headers.htm)
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 04:05:15 AM
with goasm and easy code I had already used these headers. But they don't work with poasm. Nothing worked with poasm for me, except a PROTO ... in the source file. I hope this FuncProtos.zip will work, but I don't want to register at that forum, I hope I can get it in this forum.
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 04:49:45 AM
ok - i am a little confused   :biggrin:
not the first time

you like GoAsm, but not EasyCode
so - continue to use GoAsm, but not EasyCode
there is no requirement that you use EasyCode

my understanding of PoAsm is that it will use the include files from the masm32 package
however, i've never had the need to try it out
Title: Re: PROTOs
Post by: TWell on December 06, 2013, 04:51:04 AM
Quote from: traphunter on December 06, 2013, 04:05:15 AM
with goasm and easy code I had already used these headers. But they don't work with poasm. Nothing worked with poasm for me, except a PROTO ... in the source file. I hope this FuncProtos.zip will work, but I don't want to register at that forum, I hope I can get it in this forum.
POAsm example with minimal WinInc.
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 06:07:23 AM

I've downloaded WinInc208
I've extracted it
I've added the directory to the project options as another include directory
My source file has an statement "include Windef.inc"

and the assembler makes trouble:

..\WinInc208\Include\Windef.inc(217): error: Expected ':'.
..\WinInc208\Include\Windef.inc(217): error: Expected 'type'.
..\WinInc208\Include\Windef.inc(219): error: Expected ':'.
..\WinInc208\Include\Windef.inc(219): error: Expected 'type'.
..


If I try masm32 header I get this error:

\asmtest.asm(32): error: Symbol 'ExitProcess' is undefined.


ok, ExitProcess should be defined in winbase.h, but there isn't a winbase.inc.
What now? I am not a mage and can not imagine where this function is defined.

I hate those problems. :(

Thank you for your patience
Title: Re: PROTOs
Post by: Vortex on December 06, 2013, 06:09:04 AM
Hi traphunter,

Attached is the include file set for Poasm.
Title: Re: PROTOs
Post by: TWell on December 06, 2013, 06:47:08 AM
Quote from: traphunter on December 06, 2013, 06:07:23 AM

I've downloaded WinInc208
I've extracted it
I've added the directory to the project options as another include directory
My source file has an statement "include Windef.inc"

and the assembler makes trouble:

..\WinInc208\Include\Windef.inc(217): error: Expected ':'.
..\WinInc208\Include\Windef.inc(217): error: Expected 'type'.
..\WinInc208\Include\Windef.inc(219): error: Expected ':'.
..\WinInc208\Include\Windef.inc(219): error: Expected 'type'.
..

With POAsm try this:WIN32_LEAN_AND_MEAN equ <>
include Windows.inc
orWIN32_LEAN_AND_MEAN equ <>
;include Windows.inc
include WinAsmP.inc
include Windef.inc
include WinBase.inc
include WinUser.inc
POAsm must include  modified WinAsmP.inc ?
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 06:58:52 AM
thank you Vortex, but still the same problem

error: Symbol 'ExitProcess' is undefined.


windows.inc fails and winbase.inc doesn't exists and I can't imagine what *.inc has to be included.

Or is it a MUST to write my own winbase.inc to have the right prototype for ExitProcess?


@TWell

I tried both and both leads to the same errors in windef.inc
Title: Re: PROTOs
Post by: Vortex on December 06, 2013, 07:05:02 AM
You need kernel32.inc to define ExitProcess. Could you post here your source code? Maybe, we can help you.
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 07:19:49 AM
build :t

I first searched at msdn for the right headers, than I try to include the same header in assembler , therefore I whish I could have the same *.inc files like the microsoft *.h files.

thank you

EDIT: In the future I will try the lib name and not only the header name, reported by microsoft
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 07:43:38 AM
take a look at the file  \masm32\include\masm32rt.inc
it's a plain text file - you can open it with NotePad
it takes care of most things you'll need in one line
    INCLUDE     \masm32\include\masm32rt.inc

the masm32 package does not have a winbase.inc
instead, the contents of that file are in windows.inc (which also includes winextra.inc)

this is a recording, for more options, press #*
Title: Re: PROTOs
Post by: traphunter on December 06, 2013, 08:15:52 AM
Quote from: dedndave on December 06, 2013, 07:43:38 AM
...
it's a plain text file - you can open it with NotePad
...

????

:(
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 08:55:09 AM
Quote from: traphunter on December 06, 2013, 08:15:52 AM
????

:(

that doesn't help us help you
what's the problem?
you don't have the file?
you can't open it?
you haven't installed the masm32 package?
Title: Re: PROTOs
Post by: dedndave on December 06, 2013, 08:56:37 AM
here are the pertinent lines of code in that file
      .486                                      ; create 32 bit code
      .model flat, stdcall                      ; 32 bit memory model
      option casemap :none                      ; case sensitive

;     include files
;     ~~~~~~~~~~~~~
      include \masm32\include\windows.inc       ; main windows include file
      include \masm32\include\masm32.inc        ; masm32 library include

    ; -------------------------
    ; Windows API include files
    ; -------------------------
      include \masm32\include\gdi32.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc
      include \masm32\include\Comctl32.inc
      include \masm32\include\comdlg32.inc
      include \masm32\include\shell32.inc
      include \masm32\include\oleaut32.inc
      include \masm32\include\ole32.inc
      include \masm32\include\msvcrt.inc

      include \masm32\include\dialogs.inc       ; macro file for dialogs
      include \masm32\macros\macros.asm         ; masm32 macro file

;     libraries
;     ~~~~~~~~~
      includelib \masm32\lib\masm32.lib         ; masm32 static library

    ; ------------------------------------------
    ; import libraries for Windows API functions
    ; ------------------------------------------
      includelib \masm32\lib\gdi32.lib
      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib
      includelib \masm32\lib\Comctl32.lib
      includelib \masm32\lib\comdlg32.lib
      includelib \masm32\lib\shell32.lib
      includelib \masm32\lib\oleaut32.lib
      includelib \masm32\lib\ole32.lib
      includelib \masm32\lib\msvcrt.lib
Title: Re: PROTOs
Post by: Vortex on December 06, 2013, 08:58:19 AM
traphunter,

Dave is right. You should be more specific to explain the issue.