Take a look at this little program I just created.

.MODEL flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

invoke ExitWindowsEx, EWX_LOGOFF, NULL
invoke ExitProcess, NULL

end start

Something must be wrong, as I encounter very weird errors when I execute it. Everything is fine. I get logged out when I execute the program. BUT when I log in again I cannot log out (Win freezes). ANy ideas?
Posted on 2002-03-06 09:36:42 by Psionicist
No idea why it fails the second time - might be because of additional
applications you are running? I can imagine that some badly written
software that run as a "service" could cause trouble... I assume
you're on 9x?

Also, a comment on your coding style. Doesn't affect the generated
exe in any way, but you ought to only use NULL when dealing with
pointer values, and use 0 when dealing with flags or other integer
Posted on 2002-03-06 11:41:47 by f0dder
9x, yes.

I will remember what you said about NULL and 0. I am very new to ASM programming :)
Posted on 2002-03-06 12:03:02 by Psionicist
Heh. I compiled the program wrong. It works perfectly now when I found that built in function in MASM.
Posted on 2002-03-06 13:04:20 by Psionicist