dmw64 - 2004-05-20

Hi guys!

I'm trying to write a DLL with NASM/ALINK but I have problems with the linking or ...?

If I write DLL with doesn't uses other ones, everything works fine. But if I trying to use a DLL in my DLL and using it in any program I almost always get an error saying something like "invalid file format". Suprisingly sometimes (but almost never) it works (the Win98SE loader is sad to be much more restritive, but so...)

This stupid test-dll was:

;NASMW.EXE -fobj test_dll.asm
;ALINK.EXE -c -oPE -dll test_dll

extern GetModuleHandleA
import GetModuleHandleA kernel32.dll

global tproc
export tproc

segment code public use32 class=CODE
..start
mov eax,1
ret 12

tproc: push dword 0
call [GetModuleHandleA]
ret

The program using the DLL:

;NASMW.EXE -fobj test.asm
;ALINK.EXE -c -subsys gui -oPE test

extern ExitProcess
import ExitProcess kernel32.dll

extern tproc
import tproc test_dll.dll

segment code public use32 class=CODE
..start

call [tproc]

push dword 0
call [ExitProcess]

If anybody has a hint - please let me know.
Thanks a lot!!!