Code:
Dim sDll as string Dim sInit as string Dim sDispatch as string Dim dllptr as word Dim initPtr as word Dim dispatchPtr as word Dim hHandler as dword sDll = "DLLNAME.DLL" & chr$(0) sInit = "INITROUTINE" & chr$(0) sDispatch = "DISPATCHROUTINE" & chr$(0) dllPtr = varptr(sDll) dllInit = varptr(sInit) dllDispatch = varptr(sDispatch) PRINT "RUNNING ASM" ASM push es ASM push ds ASM pop es ASM mov si, dllPtr ASM mov di, dllInit ASM mov bx, dllDispatch '--- this calls the dll from here using special ntvdm opcode ---- ASM db &H0C4 ASM db &H0C4 ASM db &H58 ASM db &H0 ASM mov hHandler, AX Select case hHandler case 0 'okay case 1 'dll could not be found case 2 'dispatch could not be found case 3 'init could not be found case 4 'not enough memory case else 'something blew up End select
Leave a comment: