On Thu May 21 21:50:42 2026 +0000, Paul Gofman wrote:
v3: * add more tests and handle buffer wraparound (only fail if read cursor or read length is invalid). As a separate note, I was initially adding some similar wraparound tests with passing NULL ptr2, len2 to Lock, but that mode seems buggy on Windows: passing NULL ptr2, len2 to _\\_\_Unlock after that leaves buffer in the buggy (still locked?) state and consequent locks start to fail. That is sort of consistent with what https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee418185...) says: "The second pointer is needed even if zero bytes were written to the second pointer.". But since we opted not to receive this pointer and length from Lock we don't have a straightforward way to have it. I tested that passing ptr2, len2 to Unlock obtained from previous lock (assuming that ptr2 can only be buffer start pointer or NULL which seems to be the case) and that fixed the failure on WIndows. But I didn't include these weirdness in the patch.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10966#note_141014