ntdll: Some code cleanup

Vitaliy Margolen wine-devel at kievinfo.com
Wed Feb 28 23:50:55 CST 2007


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.



More information about the wine-devel mailing list