--
v3: vkd3d-shader/hlsl: Support case-insensitive lookup for builtin 'float' type.
vkd3d-shader/hlsl: Use unsigned type for the 'dword' alias.
vkd3d-shader/hlsl: Support case-insensitive lookup for builtin 'dword' type.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/101
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54405
Also fixes Assassin Creed hanging on start (for a similar reason: it doesn't expect a spurious -1 last error).
There is already a fix attempt sent by Ivan Chikish in !2067 (https://gitlab.winehq.org/wine/wine/-/merge_requests/2067). But I suppose it may be fixed simpler like in this patch. wait_message() with zero count is only called from NtUserPeekMessage(). I think even if for some reason driver's MsgWaitForMultipleObjectsEx returns a real error code we still don't want to set last error here when called from PeekMessage().
--
v2: wineandroid.drv: Check for zero count in _MsgWaitForMultipleObjectsEx if events are present.
winemac.drv: Check for zero count in _MsgWaitForMultipleObjectsEx if events are present.
winex11.drv: Check for zero count in _MsgWaitForMultipleObjectsEx if events are present.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2242
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51848
SPORE creates a swapchain on a window, then destroys it, then creates a
different swapchain on the same window and uses it for the rest of its lifetime.
The swapchains have different GLX visuals (the details are unimportant).
The effect is that the second swapchain sees the pixel format set by the first
swapchain, through GetPixelFormat(), and therefore needs to set and then
restore the new pixel format on every present. This results in recreating the
GLX drawable twice per frame, which is extremely expensive.
This patch series changes WGL_WINE_pixel_format_passthrough to only set an
"internal" pixel format. The real pixel format will still be set as it is now,
but GetPixelFormat() will always return 0, signalling to wined3d that the
application has not set the pixel format, and therefore there is no need to
restore it.
As the tests show, this change also matches Windows, which does not report that
a pixel format has been set after presenting a Direct3D swapchain.
This is a large series by patch count, but I fear that splitting it into two
parts would make it difficult to grasp the entire picture, and purpose of the
earlier patches. It also contains six patches which are simply repetitions
across the three user drivers, which should ease the burden of review somewhat.
--
v3: wineandroid: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winemac: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winex11: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
win32u: Allow separately storing the internal pixel format set by WGL_WINE_pixel_format_passthrough.
wined3d: Do not set the pixel format if wglGetPixelFormat() returns zero and we already set the internal pixel format.
winemac: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
wineandroid: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
winex11: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
win32u: Introduce a win32u_get_window_pixel_format() helper.
win32u: Make NtUserSetWindowPixelFormat() into a proper export.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2217
based on libpcsclite1 \
rework of [original code by Mounir IDRASSI](https://sourceforge.net/projects/scard4wine/) to use unixlib interface
First step to resolve \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39113 \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37495 \
It will probably also require the implementation of scarddlg.
In order for the tests to work fully in a virtual environment without the appropriate hardware,
I suggest using the project https://github.com/Jakuje/virt_cacard
Example for setting up a build server (It is supposed to be Debian):
```
apt-get install -y pcscd vsmartcard-vpcd libpcsclite1 libpcsclite-dev libcacard-dev libsofthsm2 libnss3-tools gnutls-bin opensc
service pcscd restart
git clone https://github.com/Jakuje/virt_cacard
cd virt_cacard
./autogen.sh && ./configure && make
./setup-softhsm2.sh
```
"Insert" smartcard before runing tests: \
`cd /path/to/virt_cacard && SOFTHSM2_CONF=softhsm2.conf ./virt_cacard &`
Partial test can be done if installed vsmartcard-vpcd (only test create/release context and list aviable card readers): \
```
apt-get install -y pcscd vsmartcard-vpcd
service pcscd restart
```
--
v2: winscard/test: skip when libpcsclite1 is not installed
https://gitlab.winehq.org/wine/wine/-/merge_requests/2249
based on libpcsclite1 \
rework of [original code by Mounir IDRASSI](https://sourceforge.net/projects/scard4wine/) to use unixlib interface
First step to resolve \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39113 \
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37495 \
It will probably also require the implementation of scarddlg.
In order for the tests to work fully in a virtual environment without the appropriate hardware,
I suggest using the project https://github.com/Jakuje/virt_cacard
Example for setting up a build server (It is supposed to be Debian):
```
apt-get install -y pcscd vsmartcard-vpcd libpcsclite1 libpcsclite-dev libcacard-dev libsofthsm2 libnss3-tools gnutls-bin opensc
service pcscd restart
git clone https://github.com/Jakuje/virt_cacard
cd virt_cacard
./autogen.sh && ./configure && make
./setup-softhsm2.sh
```
"Insert" smartcard before runing tests: \
`cd /path/to/virt_cacard && SOFTHSM2_CONF=softhsm2.conf ./virt_cacard &`
Partial test can be done if installed vsmartcard-vpcd (only test create/release context and list aviable card readers): \
```
apt-get install -y pcscd vsmartcard-vpcd
service pcscd restart
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2249
Wine's dxgi implementation doesn't handle the different DXGI_ALPHA_MODE
values, save for DXGI_ALPHA_MODE_IGNORE on both vkd3d (d3d12) and
wined3d (d3d11), but prints a fixme for DXGI_ALPHA_MODE_UNSPECIFIED for
wined3d but not vkd3d.
To match the behaviour between the two, and because the "Unspecified"
mode seems like it should always be acceptable to ignore, don't print a
fixme in the wined3d path either.
This eliminates the following warning:
010c:fixme:dxgi:wined3d_swapchain_desc_from_dxgi Ignoring alpha mode 0.
See the msdn docs for DXGI_ALPHA_MODE here:
https://learn.microsoft.com/en-us/windows/win32/api/dxgi1_2/ne-dxgi1_2-dxgi…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2235
Removing WINED3D_RS entries from state tables and moving stubs to wined3d_device_apply_stateblock.
--
v2: wined3d: Move the WINED3D_RS_SUBPIXEL stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_ZVISIBLE stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_LASTPIXEL stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_PLANEMASK stub to wined3d_device_apply_stateblock.
wined3d: Move the WINED3D_RS_ROP2 stub to wined3d_device_apply_stateblock.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2192
I suspect you're already aware of this, but wined3d_texture_reduction_mode_from_d3d11() should probably use D3D11_DECODE_FILTER_REDUCTION. Somewhat relatedly, the definition of D3D11_DECODE_IS_COMPARISON_FILTER will need to adjusted, or wined3d_texture_compare_from_d3d11() will return incorrect results.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2246#note_24991
Using a dedicated exit jmpbuf and removing the need for assembly
routines.
When Wine handles an exception in unix code, we return to user mode by
jumping to the last syscall frame. This can leave some pthread cancel
cleanups registered, in the pthread internal linked list, and at the
same time later overwrite the stack frame they were registered for.
In the same way, jumping to the exit frame on thread exit or abort, can
also leave some cleanup handlers registered for invalid stack frames.
Depending on the implementation, calling pthread_exit will cause all the
registered pthread cleanup handlers to be called, possibly jumping back
to now overwritten stack frames and causing segmentation faults.
Exiting a pthread normally, by returning from its procedure, or calling
exit(0) for the main thread doesn't run pthread_exit and doesn't call
cleanup handlers, avoiding that situation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52213
### Additional note:
For robustness, we should probably try to execute these cleanup handlers
when unwinding the stack frames, as we would otherwise leave pthread
objects in a potential problematic state (like a mutex locked, etc).
It is however hard to do so when the handlers are registered from some C
code: pthread C implementation is done by calling some internal pthread
functions to register the handlers, and they aren't registered as
standard unwind handlers.
Only pthread_cancel and pthread_exit can unwind and call / unregister
the C handlers, but interrupting that procedure, for instance calling
setjmp / longjmp from withing our own handler isn't supported.
From C++ code, pthread cleanup handlers are registered through C++ class
constructors / destructors, and it would then be possible to partially
unwind and call them at the same time.
--
v9: ntdll: Remove now unnecessary arch-specific exit frame.
ntdll: Avoid calling pthread_exit on thread exit.
ntdll: Return entry and suspend from server_init_process_done.
ntdll: Create a pthread for the main thread.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1088
SetInputType tests will randomly failed after PATCH 3 (It was OK in PATCH 2). I spend many time on figuring out why. And I found a weird thing: If I comment out the compare_nv12() in check_dmo_output_data_buffer_(), the test failures will be gone.
I can't think out the reason. I don't understand why compare_nv12() in check_dmo_output_data_buffer_() affects SetInputType tests. And I don't want to waste too much time on the test stuff. Implementing the decoder is more important, so I marked the failed tests as flaky.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2247
--
v2: vkd3d-shader/hlsl: Allow case-insenstive names for shader objects types.
vkd3d-shader/hlsl: Initial support for string constants.
vkd3d-shader/hlsl: Use unsigned type for "dword" alias.
vkd3d-shader/hlsl: Support case-insensitive lookup for selected builtin types.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/101
The Optimize property tells msado15 to create index maps
for lookups in Recordset Find. Just store the value for
now until Find is implemented.
This property only appears on a Field when created from a real database connection. Just Appending of a Column doesn't give it this property. Currently this is the only Property that is set/query for that I found during testing.
--
v2: msado15: Support "Optimize" in Properties get_Item
https://gitlab.winehq.org/wine/wine/-/merge_requests/2244
This is what it looks like:
**v1**

**v2**

--
v6: winecfg: Add an option to enable WinRT app dark theme.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2183
The Optimize property tells msado15 to create index maps
for lookups in Recordset Find. Just store the value for
now until Find is implemented.
This property only appears on a Field when created from a real database connection. Just Appending of a Column doesn't give it this property. Currently this is the only Property that is set/query for that I found during testing.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2244
I was mainly after the issue fixed by the second patch but stomped on another one while testing that and that one looks even more unfortunate to me.
1. When connect() is used on blocking socket and fails for whatever reason, next connect() will make a new independent connection attempt (both on Windows and Unix). In non-blocking mode however (and Unix sockets are always in non-blocking mode in Wine) on Linux the next connect() will always return an error (unlike Windows which will make a new connect attempt if the previous one completed and failed). So in Wine now even for blocking socket connect() will fail if previous attempt failed and return WSAECONNABORTED. The error returned by Linux connect() will be ECONNABORTED if getsockopt(SO_ERROR) was called on the socket after connect completed with failure, and true connect() fail error if getsockopt wasn't called.
2. connect() on blocking socket times out after ~21sec on Windows and after ~130 sec on Linux. That is the case when peer doesn't actively reject connection but just never replies anything. That is, client sent SYN and never heard back. So much longer timeout leads to what is seen as hang on exit in one game, but probably more important that it affect much more in various apps provoking timeouts or huge delays not just on exit.
I did not find a way to set connect() timeout for socket on Windows. That difference mostly corresponds to number of SYN send retries. That is 7 on Linux by default and 4 on Windows (the delay between attempts starts from 1s and is doubled on each next attempt). There is TCP_SYNCNT socket option (Linux specific now, unfortunately) which allows to set the number of retries. Setting that to 4 yields 32 sec timeout (vs 21 sec on Windows). The remaining difference is probably due to different amount of time waited after last SYN is sent. There is also TCP_USER_TIMEOUT parameter which allows to effectively set the delay exactly, but it might interfere with SO_KEEPALIVE somehow and I hope that 32 vs 21 is not that critical already as 130 vs 21 and probably we can avoid complicating the thing with it.
--
v5: server: Set TCP SYN count on sockets.
server: Retry socket connection on ECONNABORTED error.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2215
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54405
Also fixes Assassin Creed hanging on start (for a similar reason: it doesn't expect a spurious -1 last error).
There is already a fix attempt sent by Ivan Chikish in !2067 (https://gitlab.winehq.org/wine/wine/-/merge_requests/2067). But I suppose it may be fixed simpler like in this patch. wait_message() with zero count is only called from NtUserPeekMessage(). I think even if for some reason driver's MsgWaitForMultipleObjectsEx returns a real error code we still don't want to set last error here when called from PeekMessage().
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2242
First part of v2 of !27, which aims to:
* Allow allocation of variables of complex types that contain both numerics and objects across multiple register sets (regsets).
* Support the tex2D and tex3D intrinsics, inferring generic samplers dimension from usage, writing sampler declarations, and writing sample instructions.
* Support for arrays of resources for both SM1 and SM4 (not to be confused with the resource-arrays of SM 5.1, which can have non-constant indexes).
* Support for resources declared within structs.
* Support for synthetic combined samplers for SM1 and synthetic separated samplers for SM4, considering that they can be arrays or members of structs.
* Imitate the way the native compiler assigns the register indexes of the resources on allocation, which proved to be the most difficult thing.
* Support for object components within complex input parameters.
* Small fixes to corner cases.
This part consists on parsing the `tex2D()` and `tex3D()` intrinsics and beginning to support the allocation of variables across multiple regsets.
The whole series, is on my [master6](https://gitlab.winehq.org/fcasas/vkd3d/-/commits/master6) branch.
--
v12: vkd3d-shader/hlsl: Allocate register reservations in a separate pass.
vkd3d-shader/hlsl: Respect object reservations even if the object is unused.
tests: Test allocation of unused objects.
vkd3d-shader/hlsl: Allocate objects according to register set.
vkd3d-shader/hlsl: Keep an hlsl_reg for each register set in hlsl_ir_var.
vkd3d-shader/hlsl: Obtain extern resources as a separate array in SM4.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/66
I was mainly after the issue fixed by the second patch but stomped on another one while testing that and that one looks even more unfortunate to me.
1. When connect() is used on blocking socket and fails for whatever reason, next connect() will make a new independent connection attempt (both on Windows and Unix). In non-blocking mode however (and Unix sockets are always in non-blocking mode in Wine) on Linux the next connect() will always return an error (unlike Windows which will make a new connect attempt if the previous one completed and failed). So in Wine now even for blocking socket connect() will fail if previous attempt failed and return WSAECONNABORTED. The error returned by Linux connect() will be ECONNABORTED if getsockopt(SO_ERROR) was called on the socket after connect completed with failure, and true connect() fail error if getsockopt wasn't called.
2. connect() on blocking socket times out after ~21sec on Windows and after ~130 sec on Linux. That is the case when peer doesn't actively reject connection but just never replies anything. That is, client sent SYN and never heard back. So much longer timeout leads to what is seen as hang on exit in one game, but probably more important that it affect much more in various apps provoking timeouts or huge delays not just on exit.
I did not find a way to set connect() timeout for socket on Windows. That difference mostly corresponds to number of SYN send retries. That is 7 on Linux by default and 4 on Windows (the delay between attempts starts from 1s and is doubled on each next attempt). There is TCP_SYNCNT socket option (Linux specific now, unfortunately) which allows to set the number of retries. Setting that to 4 yields 32 sec timeout (vs 21 sec on Windows). The remaining difference is probably due to different amount of time waited after last SYN is sent. There is also TCP_USER_TIMEOUT parameter which allows to effectively set the delay exactly, but it might interfere with SO_KEEPALIVE somehow and I hope that 32 vs 21 is not that critical already as 130 vs 21 and probably we can avoid complicating the thing with it.
--
v4: server: Set TCP SYN count on sockets.
server: Retry socket connection on ECONNABORTED error.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2215
Track ticks since draw start per window_surface, instead of per DC as is
currently the case. This change helps reduce visual glitches caused by
badly timed flushes when drawing to the same window_surface from
multiple DCs, e.g., child windows (see first commit), or in some special
scenarios when the window_surface is updated (see second commit).
(Much) more information about this issue and the rationale for the changes
can be found in the commit messages.
Note that since this is an inherently timing related issue, the visual glitches
depend on the application specific draw patterns, drawing speed (and thus
processor performance and load) etc.
Here is a capture which exhibits the issue with the current implementation:
[resizing-regedit-per-dc-ticks.mkv](/uploads/d7d30d009cc4db1337cbc3266df5ae17/resizing-regedit-per-dc-ticks.mkv)
And here is a capture of the same scenario with the proposed changes applied, which shows the improvement:
[resizing-regedit-per-surface-ticks.mkv](/uploads/6f878568862f5fb5157567341e4e452f/resizing-regedit-per-surface-ticks.mkv)
--
v3: win32u: Reset draw_start_ticks for new window_surface.
gdi32: Track ticks since draw start per window_surface.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2226
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v18: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
This series fixes a couple of failures when running kernel32:debugger tests
on various platforms.
--
v2: kernel32/tests: Fix debugger.c:test_kill_on_exit().
dbghelp/tests: Fix failure on Win10 1607.
kernel32/tests: Don't let debugger tests fail on a 64bit only config.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2237
Also, renaming `compatible_data_types()` to `explicit_compatible_data_types()` since we also have `implicit_compatible_data_types()` and `expr_compatible_data_types()`.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/99
--
v2: vkd3d-shader/hlsl: Avoid warning for each variable when in/out modifiers are specified on non-parameters.
vkd3d-shader/hlsl: Remove a redundant warning for mutually exclusive majority modifiers.
vkd3d-shader/hlsl: Check for majority modifiers on non-matrices in apply_type_modifiers().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/98
This patch originally was in !93 but I decided to separate it, since it solves a different bug that the first part of that series.
Currently, in copy-prop, we may create nodes of different dimensions than the ones we are replacing, i.e. the assertions included in this patch fail for many tests.
Without the patch, the following assertion in `hlsl_sm4.c` fails for me
```c
/* Narrowing casts were already lowered. */
assert(src_type->dimx == dst_type->dimx);
```
for some tests in one of my branches, because narrowing casts end up appearing if the node is replaced with a node with more components. This error happens under quite complex conditions (involving casts and matrices) that I still try to narrow down.
The cause of this problem is that, for the generated swizzles, we are passing `count` instead of `instr_component_count`.
`count` is the number of components of the source deref (without
considering the swizzle), while `instr_component_count` is the actual
number of components of the instruction to be replaced.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/96
Not completely sure if it's worth having for 8.0, but opening this to share the target I'm trying to reach.
--
v12: ntdll: Add a heap thread affinity and per-affinity bin group cache.
ntdll: Use atomics and lock-free list for bin groups.
ntdll: Implement Low Fragmentation Heap frontend.
ntdll: Split heap_resize_block into heap_resize_(block|large) helpers.
ntdll: Count allocations and automatically enable LFH.
ntdll: Increase heap block tail_size capacity to 16 bits.
ntdll: Implement HeapCompatibilityInformation.
ntdll: Fix HeapWalk with empty uncommitted consecutive subheaps.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1628
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v17: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
windows.media.speech: Add Vosk checks to autoconf.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v16: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
Redirecting its calls to the test executable for easier testing and to wokaround
some Windows IME caching mechanism that prevent the IME module from reloading.
--
v3: imm32/tests: Test ImmGetIMEFileName with the installed IME.
imm32/tests: Test ImmGetDescription with the installed IME.
imm32/tests: Test ImmInstallIMEW with an actual IME.
imm32/tests: Add broken test results for w10v22H2.
include: Allow overriding LANGID in module VERSIONINFO.
makedep: Support resource files for embedded TESTDLL.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2221
Redirecting its calls to the test executable for easier testing and to wokaround
some Windows IME caching mechanism that prevent the IME module from reloading.
--
v2: imm32/tests: Test ImmGetIMEFileName with the installed IME.
imm32/tests: Test ImmGetDescription with the installed IME.
imm32/tests: Test ImmInstallIMEW with an actual IME.
imm32/tests: Add broken test results for w10v22H2.
include: Allow overriding LANGID in module VERSIONINFO.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2221
--
v4: Revert "ntoskrnl.exe: Enforce path case in WM_DEVICECHANGE notifications."
ntoskrnl: Preserve the device instance ID case in IoRegisterDeviceInterface().
ntoskrnl/tests: Expand tests for device and interface naming.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2185
Note that there are some C++ methods of IDCompositionVisual are renamed to avoid conflicts.
--
v3: include: Add dcomp.idl.
include: Add dcompanimation.idl.
include: Add dcomptypes.idl.
include: Add DirectComposition error codes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2224
Note that there are some C++ methods of IDCompositionVisual are renamed to avoid conflicts.
--
v2: include: Add dcomp.idl.
include: Add dcomptypes.idl.
include: Add DirectComposition error codes.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2224
Fixes the longstanding misbehavior of X window managers with respect to
Delphi based applications.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26503
--
v3: winex11: Fix X11 WM behavior for Delphi based apps.
Revert "winex11: add missing newline in TRACE."
winex11: add missing newline in TRACE.
winex11: Fix X11 WM behavior for Delphi based apps.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2229
I was mainly after the issue fixed by the second patch but stomped on another one while testing that and that one looks even more unfortunate to me.
1. When connect() is used on blocking socket and fails for whatever reason, next connect() will make a new independent connection attempt (both on Windows and Unix). In non-blocking mode however (and Unix sockets are always in non-blocking mode in Wine) on Linux the next connect() will always return an error (unlike Windows which will make a new connect attempt if the previous one completed and failed). So in Wine now even for blocking socket connect() will fail if previous attempt failed and return WSAECONNABORTED. The error returned by Linux connect() will be ECONNABORTED if getsockopt(SO_ERROR) was called on the socket after connect completed with failure, and true connect() fail error if getsockopt wasn't called.
2. connect() on blocking socket times out after ~21sec on Windows and after ~130 sec on Linux. That is the case when peer doesn't actively reject connection but just never replies anything. That is, client sent SYN and never heard back. So much longer timeout leads to what is seen as hang on exit in one game, but probably more important that it affect much more in various apps provoking timeouts or huge delays not just on exit.
I did not find a way to set connect() timeout for socket on Windows. That difference mostly corresponds to number of SYN send retries. That is 7 on Linux by default and 4 on Windows (the delay between attempts starts from 1s and is doubled on each next attempt). There is TCP_SYNCNT socket option (Linux specific now, unfortunately) which allows to set the number of retries. Setting that to 4 yields 32 sec timeout (vs 21 sec on Windows). The remaining difference is probably due to different amount of time waited after last SYN is sent. There is also TCP_USER_TIMEOUT parameter which allows to effectively set the delay exactly, but it might interfere with SO_KEEPALIVE somehow and I hope that 32 vs 21 is not that critical already as 130 vs 21 and probably we can avoid complicating the thing with it.
--
v3: server: Set TCP SYN count on sockets.
server: Retry socket connection on ECONNABORTED error.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2215
I was mainly after the issue fixed by the second patch but stomped on another one while testing that and that one looks even more unfortunate to me.
1. When connect() is used on blocking socket and fails for whatever reason, next connect() will make a new independent connection attempt (both on Windows and Unix). In non-blocking mode however (and Unix sockets are always in non-blocking mode in Wine) on Linux the next connect() will always return an error (unlike Windows which will make a new connect attempt if the previous one completed and failed). So in Wine now even for blocking socket connect() will fail if previous attempt failed and return WSAECONNABORTED. The error returned by Linux connect() will be ECONNABORTED if getsockopt(SO_ERROR) was called on the socket after connect completed with failure, and true connect() fail error if getsockopt wasn't called.
2. connect() on blocking socket times out after ~21sec on Windows and after ~130 sec on Linux. That is the case when peer doesn't actively reject connection but just never replies anything. That is, client sent SYN and never heard back. So much longer timeout leads to what is seen as hang on exit in one game, but probably more important that it affect much more in various apps provoking timeouts or huge delays not just on exit.
I did not find a way to set connect() timeout for socket on Windows. That difference mostly corresponds to number of SYN send retries. That is 7 on Linux by default and 4 on Windows (the delay between attempts starts from 1s and is doubled on each next attempt). There is TCP_SYNCNT socket option (Linux specific now, unfortunately) which allows to set the number of retries. Setting that to 4 yields 32 sec timeout (vs 21 sec on Windows). The remaining difference is probably due to different amount of time waited after last SYN is sent. There is also TCP_USER_TIMEOUT parameter which allows to effectively set the delay exactly, but it might interfere with SO_KEEPALIVE somehow and I hope that 32 vs 21 is not that critical already as 130 vs 21 and probably we can avoid complicating the thing with it.
--
v2: server: Set TCP SYN count on sockets.
server: Retry socket connection on ECONNABORTED error.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2215
Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com>
--
v15: windows.media.speech: Implement Vosk create and release functions in the unixlib.
windows.media.speech/tests: Allow the SpeechRecognizer creation to fail in Wine.
windows.media.speech/tests: Get rid of duplicated hresult.
windows.media.speech: Add unixlib stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2091
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51848
SPORE creates a swapchain on a window, then destroys it, then creates a
different swapchain on the same window and uses it for the rest of its lifetime.
The swapchains have different GLX visuals (the details are unimportant).
The effect is that the second swapchain sees the pixel format set by the first
swapchain, through GetPixelFormat(), and therefore needs to set and then
restore the new pixel format on every present. This results in recreating the
GLX drawable twice per frame, which is extremely expensive.
This patch series changes WGL_WINE_pixel_format_passthrough to only set an
"internal" pixel format. The real pixel format will still be set as it is now,
but GetPixelFormat() will always return 0, signalling to wined3d that the
application has not set the pixel format, and therefore there is no need to
restore it.
As the tests show, this change also matches Windows, which does not report that
a pixel format has been set after presenting a Direct3D swapchain.
This is a large series by patch count, but I fear that splitting it into two
parts would make it difficult to grasp the entire picture, and purpose of the
earlier patches. It also contains six patches which are simply repetitions
across the three user drivers, which should ease the burden of review somewhat.
--
v2: wineandroid: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winemac: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
winex11: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.
win32u: Allow separately storing the internal pixel format set by WGL_WINE_pixel_format_passthrough.
wined3d: Do not set the pixel format if wglGetPixelFormat() returns zero and we already set the internal pixel format.
winemac: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
wineandroid: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
winex11: Retrieve the pixel format from win32u for normal windows in wglGetPixelFormat().
win32u: Introduce a win32u_get_window_pixel_format() helper.
win32u: Make NtUserSetWindowPixelFormat() into a proper export.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2217