News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ebp and exitting a thread

Started by V Coder, November 14, 2005, 03:43:31 AM

Previous topic - Next topic

V Coder

My program launches a thread (in the WM_CREATE) handler.

When this thread exits naturally, if it changes the value of ebp before exitting, then the program terminates, without apparently processing WM_CLOSE or WM_DESTROY. If on the other hand the thread ends with ebp intact, the program waits for closure (click the x) and exits with WM_CLOSE and WM_DESTROY.

Why does this happen please?

Also, does exitting a thread automatically give any signal to the main program? Or does one need to send the message in another way? Thanks.

Petroizki

You must follow the basic rules of register usage in Windows. You can change eax, ecx and edx, but any other register you use, must be preserved.