I am trying to do a DLL, but keep getting this odd message. Any guesses?
I am using RaDASM

Creating library VxD_DLL.lib and object VxD_DLL.exp
VxD_DLL.dll : warning LNK4086: entrypoint "__VxD_DLL" is not __stdcall with 12 bytes of arguments; image may not run
LINK : error LNK2001: unresolved external symbol __VxD_DLL
VxD_DLL.dll : fatal error LNK1120: 1 unresolved externals

Make error(s) occured.

Project options are as follows:
assemble: 3,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",2
link: 7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6 /LIBPATH:"$L",3

The source code is as follows:
VxD_DLL.def:
LIBRARY VxD_DLL
EXPORTS Get_Ring0_Handle

VxD_DLL:
.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

.data
Kernel32_Lib db "KERNEL32", 0H
FunctionName db "OpenVxDHandle", 0H

Lib_Handle dd 0H
Proc_Address dd 0H
Ring0_Handle dd 0H
Ring3_Handle dd 0H

.code

VxD_DLL proc hInstDLL:HINSTANCE, reason:DWORD, reserved1:DWORD
mov eax, TRUE
ret
VxD_DLL Endp

Get_Ring0_Handle proc hRing3:DWORD

mov eax, hRing3
mov , eax

;load the kernel32 lib

mov eax,
cmp eax, 0H
; jnz Lib_Loaded ;lib already loaded

invoke LoadLibrary, addr Kernel32_Lib
mov , eax

invoke GetProcAddress, , addr FunctionName
mov , eax

mov eax,
call
mov , eax

invoke FreeLibrary,

mov eax,

ret

Get_Ring0_Handle Endp

End VxD_DLL

thanks.
Posted on 2002-09-02 17:22:39 by sceptor
By the way it has the same message/error for the DLL tutorial as well.
Posted on 2002-09-02 17:39:26 by sceptor
I don't think you need that initial VxD_DLL label at the start. Maybe.
Posted on 2002-09-02 17:55:28 by Eóin
Oh, sorry. I put that there in the post so everyone could tell where the file started.

"VxD_DLL:" is not really in the source file.
Posted on 2002-09-02 18:20:54 by sceptor
OK, I found the problem.

I had downloaded the 98DDK, and copied the ML.exe from that package into masm32\bin in order to assemble vxd's. Turns out this version doesnt like the syntax or something about any other type of source file other than a vxd file.

So now my delima is how do I change the project options to assemble with the following:

for vxd's -> use ML_vxd.exe
for all others -> ML_org.exe



I tried changing masm.ini but it didnt make any difference, whenever I look at project options, it shows ML. Niether ML_org, or ML_vxd show up for either type of project.

Any help would be appreciated.

Thanks.
Posted on 2002-09-02 19:50:55 by sceptor
Well you know...

I forgot to change the project file for my existing projects to call the appropriate ML'r. DOH!!

All is well now.
Posted on 2002-09-03 08:15:44 by sceptor