News:

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

Errors

Started by ecube, July 20, 2009, 09:05:25 AM

Previous topic - Next topic

ecube

GoAsm.Exe Version 0.56.6b - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk

Warning .......................
Line 68 of the include file wingdi.h:-
Could not evaluate expression in conditional directive (rest of file skipped):-
_NTDDI_WINXP

Error!
Line 51 of assembler source file (main.asm):-
Must have label next after EXPORT declaration

OBJ file not made

Press any key to continue . . .


line 51 is

EXPORT DllEntry FRAME hInstance, reason, reserved1
cmp D[reason],DLL_PROCESS_ATTACH
jne >@skip

@skip:
mov eax,1
ret
ENDF

ramguru


EXPORTS DllEntry

CODE

DllEntry FRAME hInst, reason, reserved1
..

ecube

Error!
Line 21 of assembler source file (main.asm):-
Label of this name already declared:-
DllEntry FRAME hInstance, reason, reserved1


ramguru

to build:

C:\GOASM\bin\golink /dll /entry DllEntry dllmain.obj rsrc.obj

ramguru

maybe you have:
DATA
  hInstance dq 0

CODE
DllEntry FRAME hInstance, reason, reserved1

And those names conflict

ecube

actually I used


set INCLUDE=C:\GoAsm\include

\GoAsm\bin\GoAsm /x86 Main.asm
\GoAsm\bin\GoLink /dll /entry DllEntry Main.obj
pause

and

set INCLUDE=C:\GoAsm\include

\GoAsm\bin\GoAsm /x64 Main.asm
\GoAsm\bin\GoLink  /dll /entry DllEntry Main.obj
pause


while I appreciate your effort, with all due respect i'd much rather get a response from someone that has more of an idea, until then i'll just write this in masm I suppose and convert over later.

ecube

no

#DEFINE LINKFILES
;#DEFINE WIN64 ;uncomment to build for 64bit
#include "\GoAsm\include\windows.h"
#include "\GoAsm\include\tlhelp32.h"

DATA SECTION
uProcess PROCESSENTRY32 <>
myprocess db 512 dup ?

CODE SECTION
#IFNDEF WIN64
EXPORT DllEntry FRAME hInstance, reason, reserved1
cmp D[reason],DLL_PROCESS_ATTACH
jne >@skip

@skip:
mov eax,1
ret
ENDF

#ELSE
;64bit version
EXPORT DllEntry FRAME hInstance, reason, reserved1
cmp Q[reason],DLL_PROCESS_ATTACH
jne >@skip

@skip:
mov rax,1
ret
ENDF
#ENDIF

donkey

Very weird, I can't reproduce the problem here at all. For the hInstance thing scoping will take care of that and a check of wingdi.h shows that line 68 has NTDDI_WINXP not _NTDDI_WINXP so that error is a bit bizarre (as if it is being decorated for a MS linker). Using GOASMHDRVER = 0x020010, my test was the following...

C:\Programming\GoAsm\BIN\GoAsm.EXE /x86 "testdll.asm"

GoAsm.Exe Version 0.56.6b - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk
Output file: testdll.obj
C:\Programming\GoAsm\BIN\GoLink @testdll.def /dll /entry DllEntry "testdll.obj"

GoLink.Exe Version 0.26.10 - Copyright Jeremy Gordon 2002/9 - JG@JGnet.co.uk
Output file: testdll.dll
Format: win32 size: 2,560 bytes

*******************************************************

C:\Programming\GoAsm\BIN\GoAsm.EXE /x64 "testdll.asm"

GoAsm.Exe Version 0.56.6b - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk
Output file: testdll.obj
C:\Programming\GoAsm\BIN\GoLink @testdll.def /dll /entry DllEntry "testdll.obj"

GoLink.Exe Version 0.26.10 - Copyright Jeremy Gordon 2002/9 - JG@JGnet.co.uk
Output file: testdll.dll
Format: X64 size: 3,072 bytes


PROJECT HEADER

// Headers available at
// http://www.quickersoft.com/donkey/index.html

// NOTE: INCLUDE Environment variable must be set to headers path
// Kludge for goasm symbol conflict
#DEFINE IDISPATCH_DEFINED
#DEFINE IUNKNOWN_DEFINED

#DEFINE LINKFILES
;#DEFINE WIN32_LEAN_AND_MEAN

#include "WINDOWS.H"
#include "Commctrl.h"
#include "tlhelp32.h"


MAIN FILE

#Include "testdll.h"

DATA SECTION
hInstance HANDLE 0

;##################################################################

CODE SECTION

DllEntry FRAME hInst, reason, reserved1

mov rax,[reason]
.DLLPROCESSATTACH
cmp rax,DLL_PROCESS_ATTACH
JNE >.DLLPROCESSDETACH
mov rax,[hInst]
mov [hInstance], rax
JMP >.LOAD

.DLLPROCESSDETACH
cmp rax,DLL_PROCESS_DETACH
JNE >.DLLTHREADATTACH
JMP >.LOAD

.DLLTHREADATTACH
cmp rax,DLL_THREAD_ATTACH
JNE >.DLLTHREADDETACH
JMP >.LOAD

.DLLTHREADDETACH
cmp rax,DLL_THREAD_DETACH
JNE >.NOLOAD
JMP >.LOAD

.NOLOAD
; The reson was not understood
; Rather than take a chance we will refuse to load
xor rax, rax
ret

.LOAD
xor rax, rax
inc rax

ret
ENDF

DummyProc FRAME SomeParam


RET
ENDF


DEF FILE

/export DummyProc


Note that when building with the /X86 switch RAX is changed to EAX by GoAsm. Is there something I'm missing in your build ?
"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

jorgon

#8
Hi E^Cube

QuoteError!
Line 51 of assembler source file (main.asm):-
Must have label next after EXPORT declaration

This was a bug.  It occurred only in the case of an export of a procedure using FRAME..ENDF, and where the word EXPORT was immediately before the FRAME label as opposed to defining the EXPORT separately as suggested by Ramguru.

I attach a fix for this one (GoAsm Version 0.56.6d).  Thanks for reporting it.
[EDIT] Replaced with (GoAsm Version 0.56.6e).

As for the warning message, have you located that problem?



[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

ecube

Hi jorgon,

Thankyou for the quick fix, and yeah I located the warning issue, was typo in header I had. Also thanks to Donkey and ramguru for your time.

Yuri

Hi Jeremy!

The new version for some reason complains about the headers:
Quote
GoAsm.Exe Version 0.56.6d - Copyright Jeremy Gordon 2001/9 - JG@JGnet.co.uk

Warnings ......................
Outstanding #if, #elif, #elseif, #ifdef or #ifndef at close of ..
winuser.h
Outstanding #if, #elif, #elseif, #ifdef or #ifndef at close of ..
wingdi.h

Here are the offending pieces of code. If I comment them out, all goes well.

winuser.h at line 1447:
Quote
#IF WINVER >= NTDDI_VISTA
   #define SM_CMETRICS 93
#ELSEIF WINVER >= NTDDI_WINXP
   #define SM_CMETRICS 90
#ELSEIF WINVER = NTDDI_WIN2K
   #define SM_CMETRICS 83
#ELSEIF WINVER = NTDDI_WINNT4
   #define SM_CMETRICS 76
#ELSEIF WINVER = NTDDI_WIN9X
   #define SM_CMETRICS 76
#ENDIF

wingdi.h at line 1013:
Quote
#IF WINVER = NTDDI_WINNT4
   #define STOCK_LAST  17
#ELSEIF WINVER = NTDDI_WIN9X
   #define STOCK_LAST  17
#ELSE
   #define STOCK_LAST  19
#endif

jorgon

Sorry, my mistake for not completing one amendment before starting a second one!
I've replaced Version 0.56.6d with Version 0.56.6e in the earlier message, which should correct this problem.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)