Using tasm32. GetStdHandle returns INVALID_HANDLE_VALUE in eax register.

.386
.model flat

extrn GetStdHandle:PROC
extrn ExitProcess:PROC

.data

.code

start:

push -11
call GetStdHandle

push 0
call ExitProcess

end start

Other APIs work fine. just having problems with GetStdHandle. Any ideas?

added a data declaration under the .data section.

.data

hStdout dd 0

Seems to have fixed it.

Using /ax for the tlink32 param allows td32 to load symbol tables.