[PATCH 3/4] msvcrt: Make UCRT _beginthread[ex]() hold the DLL reference.

Piotr Caban piotr.caban at gmail.com
Mon May 3 10:52:26 CDT 2021


On 5/3/21 3:07 PM, Arkadiusz Hiler wrote:
> @@ -76,7 +79,13 @@ void CDECL _endthread(void)
>     } else
>         WARN("tls=%p tls->handle=%p\n", tls, tls ? tls->handle : INVALID_HANDLE_VALUE);
>   
> -  /* FIXME */
> +#if _MSVCR_VER >= 140
> +  if (tls && tls->module != NULL)
> +      FreeLibraryAndExitThread(tls->module, 0);
> +  else
> +      WARN("tls=%p tls->module=%p\n", tls, tls ? tls->module : NULL);
> +#endif
> +
>     ExitThread(0);
>   }
Is there a reason for not calling _endthreadex(0) in _endthread?

Thanks,
Piotr



More information about the wine-devel mailing list