On Mon, May 03, 2021 at 04:24:40PM +0300, Dmitry Timoshkov wrote:
Arkadiusz Hiler <ahiler(a)codeweavers.com> wrote:
+ thread = CreateThread(security, stack_size, _beginthreadex_trampoline, + trampoline, initflag | CREATE_SUSPENDED, thrdaddr);
What's the reason of unconditionally creating a suspended thread?
It's a leftover from initial copy-and-paste of the _beginthread()'s trampoline logic. The thread there is suspended because _endthread() closes the handle, and we only get that after creation. Here I was doing something simillar initially, but it turned out that even _endthread() should not close anything. I've changed a few things but forgot to change this part. Revised version of the patch is attached, thanks. -- Cheers, Arek