NASM Forum > Using NASM

Win32: Returning from a window procedure

(1/1)

nobody:
Hello,
I have a problem returning from a window procedure. I have debugged the proc, and it comes all the way to the return.
I have tried ret, retn, retf and even iret, but none of them work, do any og you know why my application crashes there?
ps. I have tried using DefWindowProc. That worked fine, except i can't do anything then...

Frank Kotler:
We'll probably have to see the code...

"iret" and "retf" would be wrong, "ret" and retn" are aliases... if this is "stdcall" (the usual convention with Windows), you'd want "ret N", where N is the number of bytes of parameters on the stack - 4 times the number of parameters. An error here would cause a crash later, though - not right at the "ret". The most likely cause of that is not having the stack back to the condition it was in when the function was entered. If you've created a stack frame, you'll have to "unwind" it first - a matched "enter" and "leave" ought to do it.

...we'll probably have to see the code...

Best,
Frank

Navigation

[0] Message Index

Go to full version