Subject: Re: Win DLL's in Assembly Date: Wed, 28 May 1997 11:52:54 +0100 From: "Anthony Williams" Organization: Oxford University Newsgroups: alt.lang.asm References: <3383698B.324@rapid.co.uk> <5m15aq$7r0@news.ox.ac.uk> <01bc6b36$99d96ae0$173293cf@777143023> Win32 DLL's are simple - Windows calls the DllEntryPoint function (specified as the entry point for the module by the linker - can have any name) as a stdcall function (right to left parameter pushing, function pops parameters) with 3 parameters. BOOL DllEntryPoint(HANDLE hDll,DWORD dwReason,LPVOID lpReserved); hDll is the handle for loading resources and stuff from the DLL, dwReason is the reason for calling (new process=DLL_PROCESS_ATTACH, new thread=DLL_THREAD_ATTACH, exit process=DLL_PROCESS_DETACH, exit thread=DLL_THREAD_DETACH) return EAX (result is in register EAX)=1 for success, 0 for failure. Win16 DLL's are more complicated - the entry point is called with no pushed parameters, ES:SI =command line (!) , DI=handle (as hDll above), CX=local heap size to allocate (call LocalInit from KERNEL.EXE). Return AX=0 for failure, 1 for success. John Solo wrote in article <01bc6b36$99d96ae0$173293cf@777143023>... >Please Email me the spec's for asm lang dll's both 16-bit and 32-bit. > >I'd also like to know file formats for winexe's, and obj formats like >coff and tasm/intel obj files, esp 16-bit and 32-bit pick an os >differences. >If you have them handy.:-) > >Anthony Williams wrote in article ><5m15aq$7r0@news.ox.ac.uk>... >> Paul, >> >> A DOS assembler, such as TASM / MASM, is fine, what you need is a Windows >> compatible linker. As it happens, TLINK,(which comes with TASM) is >capable >> of generating Windows DLL's (and I believe the new version is capable of >> Win32 EXE's/DLL's too) >> >> Win32 is straight forward, but Win16 needs some funny startup code. I'll >> see if I can dig out the example I've got if you like >> >> Anthony >> anthony.williams@sjc.ox.ac.uk >> >> >> Smitton wrote in article <3383698B.324@rapid.co.uk>... >> >Please, >> > does anybody know how to write windows DLL files in assembly. >> >Does this require a Windows Assembly compiler, or can a Dos one be used? >> > >> >Thanks, >> > Paul Smitton. >> > >> >> >> >