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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.