Click here to Skip to main content
15,900,815 members

Comments by nicklowe (Top 5 by date)

nicklowe 5-Jan-12 12:36pm View    
Deleted
Since you've suggested that, I started a blog off and have posted my first article on this very topic: http://www.nicklowe.org/2012/01/thread-termination-dont-leak-the-stack/


Regards,

Nick
nicklowe 4-Jan-12 22:35pm View    
Deleted
RtlFreeUserThreadStack is also available in Server 2003 (NT 5.2), not just Windows XP (NT 5.1) and prior.

In production code, its always good practice to always check the return values for all the APIs called.
nicklowe 4-Jan-12 20:31pm View    
Deleted
Reason for my vote of 4
Nearly correct, but needs to suspend the thread before freeing its usermode stack and check the return of the API that frees the stack.
nicklowe 4-Jan-12 20:28pm View    
Deleted
The return type for RtlFreeUserThreadStack is NTSTATUS and not VOID so you should check it for success.

You should also suspend the thread with SuspendThread before freeing its usermode stack.

Checking for STILL_ACTIVE is not necessary.

Regards,

Nick Lowe
nicklowe 4-Jan-12 20:01pm View    
Deleted
The return type for RtlFreeUserThreadStack is NTSTATUS and not VOID so you probably should check it for success.