This comes from behavioral study of Windows, which doesn't seem to check if the
lock is actually exclusively held, and just simply decrement the value stored
in the lock.
This fixes a dead lock which prevents WeCom from starting up.
--
v25: ntdll: wake up SRWLOCK waiters by thread id
ntdll: allow SRWLOCKs to be quickly re-acquired
ntdll: An implementation of SRWLOCK that closer matches Windows'.
include: add atomic read/write of pointers
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504
On Fri Sep 22 16:09:26 2023 +0000, eric pouech wrote:
> it has an exception handler around it, so
> * either the field is not on a readable page and the exception will be
> fired, and you'll get a NULL pointer (SAFE)
> * or the field is on a readable page but with a wrong magic value, and
> you'll get a NULL pointer (SAFE)
> * or the field is on a readable page, with the expected magic value, and
> you'll a non NULL pointer, that you can check if it fits or not in
> mapped view before reading into it (SAFE)
Oh! Okay, I will use `RtlImageNtHeader` and then do the bounds checks afterwards :)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_46369