NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: nikipa on September 04, 2015, 07:09:55 PM
-
Hello all,
I am new to the assembly programming so sorry if my question is stupid.
If i make a windows API call,lets say the CreateFile function. How can i get the return value in order to compare it with something which i want?
For this specific call, the return value is INVALID_HANDLE_VALUE if it fails.
Thank you
-
Return value should be in eax... or rax. The NASMX macros would include the definition of INVALID_HANDLE_VALUE (-1) if you haven't got it .
Best,
Frank
-
so i the code should be:
push arg1
push arg2
...
push argn
call function
cmp eax,[INVALID_HANDLE_VALUE)
is that right?
-
hi again,
i just tested and it worked,
thank you for the help :)