I`ve got a problem. I wrote a little DLL, and if I want to import it to program, it causes error.
format PE GUI 4.0 DLL
entry DllEntryPoint
include 'C:\Program Files\Flat Asembler\INCLUDE\win32a.inc'
section '.code' code readable executable
proc DllEntryPoint, hinstDLL,fdwReason,lpvReserved
mov eax,TRUE
return
endp
proc CWindow, hInst, hIco, hCur, wProc, bGrnd, Class, wTit, Style, wX, wY, wWidth, wHeight
Msg MSG
Wind WNDCLASS
Buffer dd ?
cmp [hIco], NULL
je lCur
mov EAX, [hIco]
mov [Wind.hIcon], EAX
lCur:
cmp [hCur], NULL
je lReq
mov EAX, [hCur]
mov [Wind.hCursor], EAX
lReq:
mov [Wind.style], 0
mov EAX, [wProc]
mov [Wind.lpfnWndProc], EAX
mov [Wind.cbClsExtra], 0
mov [Wind.cbWndExtra], 0
mov EAX, [hInst]
mov [Wind.hInstance], EAX
mov EAX, [bGrnd]
invoke CreateSolidBrush, EAX
mov [Wind.hbrBackground], EAX
mov [Wind.lpszMenuName], 0
mov EAX, [Class]
mov [Wind.lpszClassName], EAX
invoke RegisterClass, [Wind]
pushd 0
pushd [hInst]
pushd 0
pushd 0
pushd [wHeight]
pushd [wWidth]
pushd [wY]
pushd [wX]
mov EAX, WS_VISIBLE
mov EBX, [Style]
and EBX, 1b ;bit 0 - Title bar
cmp EBX, 1b
jne lMAX
mov [Buffer], EAX
mov EAX, [Buffer + WS_CAPTION]
lMAX:
mov EBX, [Style]
and EBX, 10b ;bit 1 - Maximize
cmp EBX, 10b
jne lTit
mov [Buffer], EAX
mov EAX, [Buffer + WS_MAXIMIZE]
lTit:
pushd EAX
pushd [wTit]
pushd [Class]
xor EAX, EAX
mov EBX, [Style]
and EAX, 100b ;bit 2 - Tool Window
cmp EBX, 100b
jne lSOT
mov [Buffer], EAX
mov EAX, [Buffer + WS_EX_TOOLWINDOW]
lSOT:
mov EBX, [Style]
and EBX, 1000b ;bit 3 - Stay On Top
cmp EBX, 1000b
jne lcFin
mov [Buffer], EAX
mov EAX, [Buffer + WS_EX_TOPMOST]
lcFin:
pushd EAX
call CreateWindowEx
mLoop:
invoke GetMessage, Msg, NULL, 0, 0
or EAX, EAX
jz mLoopE
invoke TranslateMessage, Msg
invoke DispatchMessage, Msg
jmp mLoop
mLoopE:
invoke ExitProcess,[Msg.wParam]
endp
section '.idata' import data readable writeable
library Kernel, 'KERNEL32.DLL',\
User32, 'USER32.DLL',\
GDI, 'GDI32.DLL'
import GDI,\
CreateSolidBrush, 'CreateSolidBrush'
import Kernel,\
ExitProcess, 'ExitProcess'
import User32,\
RegisterClass, 'RegisterClassA',\
CreateWindowEx, 'CreateWindowExA',\
GetMessage, 'GetMessageA',\
TranslateMessage, 'TranslateMessage',\
DispatchMessage, 'DispatchMessageA'
section '.edata' export data readable
export 'BPDL.DLL',\
CWindow, 'CWindow'
section '.reloc' fixups data discardable