data section
configExists dd 0
code section
start:
call configLoad
cmp [configExists],1
jnz .startNoConfig
; this works correctly if the config file does exist
proc WndProc blah
cmp [configExists],1
jnz .wmInitDialog_NoConfig
; this does not work at all, whether I compare to 0 or 1
endp
proc configLoad
local wfd:WIN32_FIND_DATA
lea eax,[wfd]
push eax
push applicationPath
call [FindFirstFile]
cmp eax,INVALID_HANDLE_VALUE
je .existNo
jmp .existYes
.existNo:
mov [configExists],0
jmp .existEnd
.existYes:
push eax
call [FindClose]
mov [configExists],1
jmp .existEnd
.existEnd:
cmp [configExists],1
jnz .configLoadEnd
; this works here as well
endp