I was unable to write tests for this; it seems it doesn't consistently work on
Windows. However, Rayman 3 seems to rely on it; it maps the same buffer twice
immediately after creation, with DISCARD flags on both maps, and expects the
same address to be returned.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53752
--
v2: d3d8: Filter out redundant buffer discards.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1884
This series tries to fix WM_PASTE tests error on edit control (both user32 & comctl32).
The test failures where systematic on a local Win10 for comctl32 (yet very rare on
user32, perhaps one in 20 runs).
Since the failures are not systematic, it ought to be a synchronisation / timing
issue.
Flushing the msg queue before starting the paste test cycle seems to fix the issue.
- 0 occurence on comctl32 and user32 in 50 run (local VM)
- 0 occurence on Testbot (comctl32) in 1 run.
It's hard to be fully conclusive about bug resolution, but it's at least a step into
the right direction.
--
v2: comctl32/tests: Fix failing WM_PASTE tests for edit control on Win10+.
user32/tests: Fix failing WM_PASTE tests for edit control on Win10+.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1886
> (The TlsIndex field in the LDR_DATA_TABLE_ENTRY structure appears to be unused except as a flag that the module has TLS (being always set to -1), at least as far back as Windows XP. It is worth mentioning that the WINE implementation of implicit TLS incorrectly uses TlsIndex as the real module TLS index, so it may be unreliable to assume that it is always -1 if you care about working on WINE.)
>
> \- http://www.nynaeve.net/?p=186
and the "links to that article but still doesn't work in wine" award goes to... [the D runtime](https://github.com/dlang/dmd/blob/6bf60ea0eb174631ede0074a77d3898d…! (Admittedly, there aren't too many ways to do what they're trying to do.)
With this, the D runtime will now work in Wine, even if in a dll loaded into an exe with no tls (which gets it the tls index 0)
The changes to the debugger are a bit icky, a possible alternative is to find some other easily-debugger-accessible place to stuff the tls index.
--
v7: TMP: Use module info for tls in winedbg
winedbg: Track loaded modules
https://gitlab.winehq.org/wine/wine/-/merge_requests/1578
There are times when it is useful to test changes on the Windows XP and 2003 VMs, but the direct use of functions not on those platforms makes this impossible.
Once applied, the kernel32 tests will run on the Windows XP and 2003 testbot VMs.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1899