Felix Nawothnig wrote:
- if (last)
- {
LdrShutdownProcess();
exit( exit_code );
- }
- else
- {
LdrShutdownThread();
server_exit_thread( exit_code );
- }
- NtTerminateThread( GetCurrentThread(), func( arg ) );
- exit(0); /* To avoid a compiler warning, never reached. */
server_exit_thread() and NtTerminateThread() (which calls server_abort_thread()) are not the same things! Former gracefully exits the current thread freeing it's memory. Later rips it out from the process without freeing any resources.
Needless to say you can't do that.
Vitaliy.