--
v2: vbscript: Implement SID_GetCaller for QueryService.
vbscript: Add a ServiceProvider stub.
jscript: Implement SID_GetCaller for QueryService.
mshtml: Set SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION properly.
mshtml: Implement location props when there's no URI.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1733
> (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.
--
v5: ntdll: TlsIndex should not actually contain tls indices
winedbg: Don't expect TlsIndex to contain tls indices
https://gitlab.winehq.org/wine/wine/-/merge_requests/1578
Valgrind support requires a fork, which I've published to https://gitlab.winehq.org/rbernon/valgrind. The fork implements loading DWARF debug info from PE files, instead of the old and broken upstream PDB support. I've tried to upstream these changes a long time ago but didn't receive any feedback.
I think we could maybe consider keeping a fork, which I'm happy to maintain, as the changes aren't too large. We may want to investigate adding 32-on-64 support, which may require a bit more changes (to VEX specifically, because its amd64 guest doesn't support segment register manipulation).
The changes here are not all related to Valgrind, and I'll create separate MR for those which may make sense independently from Valgrind / GDB.
Also included is a suppression file to silent some annoying false positives, many of which are coming from the cross-stack accesses during syscalls, which are confusing Valgrind's stack heuristics. One can try this out with something like:
`WINELOADERNOEXEC=1 valgrind --suppressions=tools/valgrind.supp wine64/loader/wine64 wine64/programs/winecfg/winecfg.exe`
--
v3: ntdll: Tweak KeUserModeCallback to please Valgrind and GDB.
ntdll: Introduce a new ntdll_dispatch_syscall helper.
tools: Add suppressions from third party libraries.
ntdll: Fix valgrind notifications from ntdll.so.
ntdll: Import valgrind headers for PE side ntdll.
ntdll: Allocate a truly separate stack for the kernel stack.
ntdll: Maintain a PE module link map and expose it to GDB.
ntdll: Pass a UNICODE_STRING to load_builtin and virtual_map_image.
loader: Expose a shadow copy of ld.so link map to GDB.
ntdll: Add .cfi_signal_frame to __wine_syscall_dispatcher.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1074
The glMapBuffer and al. functions are all duplicated between EXT/ARB and
core functions, and we reduced code duplication by redirecting the EXT
to the core functions.
The internal function table is only filled as the functions are queried,
and it causes crahes when games are using the EXT functions without
querying the core function first.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53990
--
v2: opengl32: Avoid calling functions that have not been queried yet.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1760
It turns out that WinHttpReceiveResponse() completes synchronously in async mode (unless recursive request for handling authorization or redirect is involved). Some apps depend on that and do not wait for WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, calling WinHttpQueryHeaders() or WinHttpWebSocketCompleteUpgrade() right after calling WinHttpReceiveResponse, relying on that to finish synchronously.
My initial out of tree testing shows that no network communication is performed during WinHttpReceiveResponse() call (when recursive request is not involved). I tested that by inserting a wait between WinHttpSendRequest and WinHttpReceiveResponse and disabling network connection during the wait. WinHttpReceiveResponse still succeeds on Windows.
I think the above means that the actual response receiving from server is performed during WinHttpSendRequest. WinHttpReceiveResponse is not a complete no-op however. As shown by the existing tests the notifications related to receiving response are still delivered during WinHttpReceiveResponse (albeit in the same thread). Also WinHttpReceiveResponse affects request state: querying headers or upgrading to websocket without calling WinHttpReceiveResponse does not succeed.
When redirect is involved, all the WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED and WINHTTP_CALLBACK_STATUS_REDIRECT notifications are delivered synchronously from the calling thread. Then, the new request send notifications and response receiving notifications are delivered from the new thread.
An interesting case is when WinHttpReceiveResponse is called from SendRequest callbacks in async mode. If WinHttpReceiveResponse is called from WINHTTP_CALLBACK_STATUS_SENDING_REQUEST or WINHTTP_CALLBACK_STATUS_REQUEST_SENT (i. e., when request is not complete yet), calling WinHttpReceiveResponse() suddenly succeeds an shows the following message sequence (that is partially reflected in the tests I am adding):
- calling WinHttpReceiveResponse from WINHTTP_CALLBACK_STATUS_SENDING_REQUEST (which is already called on the async thread on Win10, thread A). Win8 queues WINHTTP_CALLBACK_STATUS_SENDING_REQUEST synchronously and goes async a bit later.
- WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, thread A;
- WinHttpReceiveResponse() returns to the caller WINHTTP_CALLBACK_STATUS_REQUEST_SENT callback; returning from user callback;
- WINHTTP_CALLBACK_STATUS_REQUEST_SENT, thread A;
- WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE (another thread, although the sequence is probably synced; I am not implementing this part and calling this callback from the same thread A);
- WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED in thread A;
- WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE in thread A.
So the receive_response() state RECEIVE_RESPONSE_SEND_INCOMPLETE is primarily needed to handle this case.
--
v3: winhttp/tests: Test calling WinHttpReceiveResponse() recursively from various send callbacks.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1582
The glMapBuffer and al. functions are all duplicated between EXT/ARB and
core functions, and we reduced code duplication by redirecting the EXT
to the core functions.
The internal function table is only filled as the functions are queried,
and it causes crahes when games are using the EXT functions without
querying the core function first.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53990
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1760