Fixes error connecting to servers in Life is Strange Remastered (due to timeout).
When there are multiple IP addresses for a host name Linux gethostbyname() returns those in random order upon each call (meaning to provide server load balancing). On Windows the order of IP addresses is not determined as well but it is the same on consequent calls (changes after network resets and probably DNS timeout expiration).
The game executes multiple http requests over TLS connection through its own libraries using only winsock from Wine. Upon executing each next request it calls gethostbyname() for the server DNS name and uses the first returned IP address. When that's different from the previous IP address used for established TLS connection it doesn't reuse the connection and establishes the connection from scratch which is very long process due to how the game does it (on Windows as well).
One obvious way to make gethostbyname() behave like Windows would be to cache the results we get from host. But caching gethostbyname() results is tricky, there are already host-side caches which take into account DNS timeouts and network interfaces change. It is possible in theory to cache the result and then still call native gethostbyname() and keep the order if nothing else has changed in the reply, but it seems to me that would complicate things more than this patch does. The patch sorts the output by IP address randomly hashed with a random transform hash established only once per process run. So it will still provide load balancing between the IP addresses between different clients and different process instances while will be returning the same order of IP addresses on consequent calls.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2074
Fixes 2K Launcher failure on start (which is using Chromium) with Windows version set to 8.1+ in the prefix (although newer CEF versions don't have Win 7/8.0 fallback here at all).
The failure happens in chromium/sandbox/win/src/win_utils.cc:GetCurrentProcessHandles().
The version which the launcher is using has a Win7 / 8.0 fallback if NtQueryInformationProcess( ProcessHandleTable ) but before going for fallback it asserts that the reported Windows version is less than 8.1 and the process crashes from assert's int3 exception. Newer versions of Chromium don't have Win7/8.0 fallback at all, so going to fail without ProcessHandleTable success regardless of prefix version if hit this path.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2070
Currently it doesn't work as expected, namely gets stuck on delimiter and caret is moved before the delimiter.
Unnecessary more robust than Windows, which feels like doesn't do any checks at all.
EDIT1: v2: return length in `WB_RIGHT` if its bigger than default return value of 0 on invalid values
EDIT2: v3: don't test `WB_ISDELIMITER` with out of bounds indices, Windows doesn't check them and does out of bounds reads
--
v5: comctl32: Fix PathWordBreakProc.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1977
There is another things that bothers me:
The while loop in parse_wave_form():
- WAVE file chunk order is fmt and then data
- The last fmt or data chunk will "win"; doubt there are any dmusic related WAVE files with duplicate fmt or data chunks.
But for now we can start with the while() loop:
- No clue where those extra chunks are placed
- We don't do anything with the WAV file; we just store it. Though we might run into memory issues with big WAV files.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2029#note_22349
Michael Stefaniuc (@mstefani) commented about dlls/dmime/segment.c:
> + case FOURCC_LIST: {
> + FIXME("Skipping LIST tag\n");
> + break;
> + }
> + case mmioFOURCC('I','S','F','T'): {
> + FIXME("Skipping ISFT tag\n");
> + break;
> + }
> + case mmioFOURCC('f','a','c','t'): {
> + FIXME("Skipping fact tag\n");
> + break;
> + }
> + }
> + }
> +
> + return S_OK;
The stream_next_chunk() in the while loop can fail too and you'll need to return that failure too.
S_FALSE indicates "no more chunks".
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2029#note_22348
Michael Stefaniuc (@mstefani) commented about dlls/dmime/segment.c:
>
> if (riff.type == DMUS_FOURCC_SEGMENT_FORM)
> hr = parse_segment_form(This, stream, &riff);
> - else {
> - FIXME("WAVE form loading not implemented\n");
> - hr = S_OK;
> - }
> + else
Please check that the RIFF has the proper type and add an else for the error case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2029#note_22346
--
v5: tests: Test entry point semantics on function declarations.
tests: Add more tests for early return from the entry point.
tests: Add some tests for early return from user-defined functions.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/65
This informs the compiler that no code will ever run after an assertion
failure (unless NDEBUG is defined), which increases accuracy of compiler
warnings and static analyses.
--
v5: include/msvcrt: Add noreturn attribute to _assert.
include: Add noreturn attribute to RtlRaiseStatus.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2051
This series implements kernelbase.EnumProcessModulesEx().
This series:
- implements EnumProcessModulesEx()
- ensure it passes a bunch of new tests
- fix GetModuleBaseName, GetModuleFileNameEx, GetModuleInformation()
to cope with HMODULES returned from EnumProcessModulesEx().
Notes: as EnumProcessModules() doesn't return the same list as Windows
on a Wow64 setup, and that there's no use of EnumProcessModulesEx()
in Wine code, this first series will implement EnumProcessModulesEx()
and if accepted, it will be followed by a second serie which, firstly,
adapt all places in Wine code with bad expectations on
EnumProcessModules(), and secondly reimlement EnumProcessModules()
using EnumProcessModulesEx().
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2064
Instead of passing them from the stack. The async operation is executed
in a thread pool, which might Release its reference asynchronously and
call a stale function pointer if it is sequenced after the stack
invalidation.
--
v2: dinput/tests: Dynamically allocate async operation handlers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2063
Currently, apartment OXIDs are generated using the process ID
(and the thread ID for a single threaded-apartment). This means
that if an apartment is destroyed and re-created (using
`CoUninitialize` followed by `CoInitializeEx`), the newly created
apartment will end up with the same OXID as the old apartment.
However, testing shows that Windows will generate a *new* OXID
when an apartment is created in the above manner. This patch
uses `rpcss` to generate a new OXID. The current process id is combined
with an incrementing counter stored in rpcss. This ensures that
re-creating an apartment will not re-use an OXID.
Additionally, this fixes an issue that caused the .NET 4.8
installer to become stuck during the downloading stage under Wine.
The installer appears to perform the following actions:
1. Call `IBackgroundCopyJob_SetNotify` interface on a BITS
job. This causes us to create a proxy (in the other process
hosting 'qmgr') for the `IBackgroundCopyCallback` pointer
passed as a parameter.
2. Trigger MTA apartment re-creation (in the process running the setup,
*not* the process with the `IBackgroundCopyCallback` proxy)
through `CoUninitialize` followed by `CoInitializeEx`.
3. Call `IBackgroundCopyJob_SetNotify` on a newly created job,
but with the same `IBackgroundCopyCallback` pointer parameter.
When we deserialize the pointer passed to
`IBackgroundCopyJob_SetNotify`, we will end up re-using the same
`proxy_manager` that we created for the previous `IBackgroundCopyCallback`.
This is due to the fact that the OIDs happen to match (due to the fact that
the .NET 4.8 setup appears to perform actions in the same order between
the old and new apartments), and the apartment OXIDs match as explained above.
above. As a result, we will use the old IPID when we send RPC packets
using this `proxy_manager`. However, the new and old IPIDs will *never* match,
since their generation process includes `RtlGenRandom`. This will cause a fault
packet to be generated on the listening side of the RPC connection.
By avoiding re-using OXIDs across re-created apartments,
we ensure that the proxy side will never incorrectly re-use a stale `proxy_manager`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2059
Today, test_RtlUniform() skips almost all of its tests on Windows Vista
or later. The skipped tests only succeed in Windows XP, and fail on
Windows Vista or later.
This is because RtlUniform()'s behavior has changed, presumably due to a
bug fix shipped in Windows Vista. It appears that RtlUniform, a linear
congruential generator, could overflow before computing the modulo in
WindoWs XP. This is no longer the case in Windows Vista or later.
Meanwhile, we no longer support Windows XP behavior and thus do not test
for it regularly; therefore, the tests are obsolete as of 2023.
Remove obsolete tests that no longer work with any of the Windows
versions actively tested by WineHQ (as of 2023), and replace them with
updated tests that works in the Windows versions from Vista up to 10.
Also, fix Wine's RtlUniform() to match the new behavior accordingly.
--
v5: ntdll: Fix integer overflow in RtlUniform.
https://gitlab.winehq.org/wine/wine/-/merge_requests/821
Today, test_RtlUniform() skips almost all of its tests on Windows Vista
or later. The skipped tests only succeed in Windows XP, and fail on
Windows Vista or later.
This is because RtlUniform()'s behavior has changed, presumably due to a
bug fix shipped in Windows Vista. It appears that RtlUniform, a linear
congruential generator, could overflow before computing the modulo in
WindoWs XP. This is no longer the case in Windows Vista or later.
Meanwhile, we no longer support Windows XP behavior and thus do not test
for it regularly; therefore, the tests are obsolete as of 2023.
Remove obsolete tests that no longer work with any of the Windows
versions actively tested by WineHQ (as of 2023), and replace them with
updated tests that works in the Windows versions from Vista up to 10.
Also, fix Wine's RtlUniform() to match the new behavior accordingly.
--
v4: ntdll: Fix integer overflow in RtlUniform.
ntdll/tests: Update test_RtlUniform to match Windows Vista or later.
https://gitlab.winehq.org/wine/wine/-/merge_requests/821
Not completely sure if it's worth having for 8.0, but opening this to share the target I'm trying to reach.
--
v4: ntdll: Implement Low Fragmentation Heap.
ntdll: Introduce per-thread free lists for heap blocks.
ntdll: Introduce a new BLOCK_FLAG_SPLIT heap block flag.
ntdll: Introduce a new subheap thread affinity field.
ntdll: Introduce a new heap block_init_used helper.
ntdll: Introduce a new heap free_list_init helper.
ntdll: Count allocations and automatically enable LFH.
ntdll: Implement HeapCompatibilityInformation.
ntdll: Fix HeapWalk with empty uncommitted consecutive subheaps.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1628
This informs the compiler that no code will ever run after an assertion
failure (unless NDEBUG is defined), which increases accuracy of compiler
warnings and static analyses.
--
v3: include/msvcrt: Add noreturn attribute to _assert.
include/msvcrt: Add noreturn attribute to RtlRaiseStatus.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2051
Not completely sure if it's worth having for 8.0, but opening this to share the target I'm trying to reach.
--
v3: ntdll: Implement Low Fragmentation Heap.
ntdll: Introduce per-thread free lists for heap blocks.
ntdll: Introduce a new BLOCK_FLAG_SPLIT heap block flag.
ntdll: Introduce a new subheap thread affinity field.
ntdll: Introduce a new heap block_init_used helper.
ntdll: Introduce a new heap free_list_init helper.
ntdll: Count allocations and automatically enable LFH.
ntdll: Implement HeapCompatibilityInformation.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1628
This informs the compiler that no code will ever run after an assertion
failure (unless NDEBUG is defined), which increases accuracy of compiler
warnings and static analyses.
--
v2: include/msvcrt: Add noreturn attribute to _assert.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2051
## Summary
Tests for UrlFixupW and semi stub function implementaion.
## Test results
- Tests are 100% ok on my local WIN 10 pc. Wine test bot seems to be okay too.
- Wine tests on debian machine
| function type | result |
| ------ | ------ |
| stub | 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **200** failures), 0 skipped. |
| semi stub| 0020:url: 69802 tests executed (0 marked as todo, 0 as flaky, **100** failures), 0 skipped. |
## Todos
For follow up merge request(s).
- [ ] Add more tests for priority investigation, who url scheme fix up is working on windows.
- [ ] Implement missing parts of fix up.
## Conclusion
Semi stub implementation is an improvement to the existing solution. A grep showed that wine internals do not call this function, therefore it should not introduce any new bugs. Windows applications using/relying on the function should now work better, if not they may reveal already existing bugs.
--
v6: shlwapi: fixup leading and trailing typos in UrlFixupW
shlwapi: check for colon in UrlFixupW
kernelbase: Restructure UrlFixupW()
shlwapi/tests: Add tests for UrlFixupW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1825
This informs the compiler that no code will ever run after an assertion
failure (unless NDEBUG is defined), which increases accuracy of compiler
warnings and static analyses.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2051
Pretty much the same as https://gitlab.winehq.org/wine/wine/-/merge_requests/1843, but on win32u side, to figure and validate the syscall entry signatures.
--
v4: win32u/tests: Test NtUserGetPointerInfoList syscall signature.
win32u/tests: Test NtUserIsMouseInPointerEnabled syscall.
win32u/tests: Test NtUserEnableMouseInPointer syscall.
win32u: Stub NtUserGetPointerInfoList syscall.
win32u: Stub NtUserIsMouseInPointerEnabled syscall.
win32u: Move NtUserEnableMouseInPointer from user32.
include: Declare some NtUser pointer related syscalls.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1844
--
v3: rpcrt4/tests: Use common code to set the firewall.
wsdapi/tests: Use common code to set the firewall.
dpnet/tests: Use common code to set the firewall.
dplayx/tests: Use common code to set the firewall.
webservices/tests: Move firewall code to a common header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1987
First relevant commit:
windows.media.speech: Add a worker thread to the recognition session.
--
v13: windows.media.speech: Store recorded audio in a temporary ringbuffer.
windows.media.speech: Partially implement the speech recognizer state.
windows.media.speech: Add an audio capturing system.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1948
--
v5: 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: Defer populating the IActiveScript field until it's fully initialized.
mshtml: Implement location props when there's no URI.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1733