Trying to do something like the following in FASM2 will not assemble:
proc last_error_to_global_string, error_code:DWORD
stdcall last_error_to_string,\
global_last_error_string,\
global_last_error_string.len,\
[error_code]
mov eax, global_last_error_string
ret
endp
proc last_error_to_string, out_msg:DWORD, out_msg_len:DWORD, error_code:DWORD
invoke FormatMessageA,\
FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_IGNORE_INSERTS,\
NULL,\
[error_code],\
0,\
[out_msg],\
[out_msg_len],\
NULL
test eax, eax
jz .fma_failed
ret
.fma_failed:
; TODO
endp
Because the assembler will say that the symbol "error_code" is defined twice.
Unless I am missing something.
I am using the "win32axp.inc" include.
Thanks.