This change is adding DWARF (CFI) unwind information to the
hand-written assembly of the `__wine_syscall_dispatcher` function.
This enables unwinding through the dispatcher from the Linux stack
into (and through) the Windows stack.
The general idea is that the `syscall_frame` struct contains the
content of the callee-save registers before the function call
(in particular the stack pointer and the return address). At any
point of the execution, we have a pointer into the `syscall_frame`
in $ebx, $ecx, $ebp, or $esp.
For the CFI codes the general idea is that we are defining the
computations of the callee-save registers based on the
`syscall_frame` using DWARF’s `breg` instruction, rather than
relative to CFA.
cc/ @florian-kuebler
--
v5: ntdll: Add CFI unwind info to __wine_syscall_dispatcher (i386).
ntdll: Move CFI helper macros out of signal_x86_64.c.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1182
The server's idea of the cursor position is never really initialized. Normally that's not a problem, since the first mouse movement and a number of other X events will update it. But in the case where the user never moves the mouse, it can remain out of sync. That manifests as `GetCursorPos` bouncing between the server's incorrect value and the real one from the user driver, depending on the age of the position on the server.
I've marked this as a draft for two reasons:
1. I don't quite know where this belongs. We want to do it early in the lifespan of a user driver but after there's a desktop, so I've put it behind a `pthread_once` called from `get_desktop_window`.
2. I'm calling `NtUserSetCursorPos` to update the server, rather than a direct `set_cursor` request, because it contains some DPI logic. That has the side effect of potentially warping the cursor. That's not desirable or necessary, but it shouldn't be a problem. It's easily factored around if we want to avoid it.
Any guidance would be greatly appreciated!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1250
Used LCG algorithm and its parameters are documented in various places. Parts that were not obvious - negative argument handling in Rnd(), and Randomize() use of current state were taken from LGPL2 FreeBASIC rtlib.
--
v2: vbscript: Implement PRNG functions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1246
Used LCG algorithm and its parameters are documented in various places. Parts that were not obvious - negative argument handling in Rnd(), and Randomize() use of current state were taken from LGPL2 FreeBASIC rtlib.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1246
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
v9: server: Don't invalidate the newly exposed child region on the parent if it doesn't clip children.
server: Redraw composited window child when its z-order changes.
server: Correctly expose composited parent window and its child on position change.
https://gitlab.winehq.org/wine/wine/-/merge_requests/231
This series improves Wine's support for delete-on-close flag and
delete disposition information on files:
- adapts tests for Windows 10
- extend and fix some tests
- implement some missing features in ntdll & server
--
v3: server: Let file creation fail depending unlink status.
server: Propagate the unlink status to all opened/closed files.
ntdll: Query FILE_STANDARD_INFORMATION.DeletePending from server.
ntdll: Extend file tests about delete-on-close and disposition.
ntdll: Fix share mode for some delete-on-close/delete disposition tests.
ntdll: Adapt file tests on delete-on-close / delete disposition to Windows 10.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1231
The storage event url prop fix is tested after the location.hash tests are added, implicitly. I didn't find a need to add extra tests for no reason there.
The super_navigate changes for fragments is also necessary for the location.hash tests (and its behavior, apparently)…
--
v3: mshtml: Implement document.importNode.
mshtml: Implement HTMLLocation_put_hash.
mshtml: Always use super_navigate when navigating fragments.
mshtml: Don't include fragment in storage event's url prop.
mshtml: Return E_ABORT if wine-gecko's OnDataAvailable aborts the binding.
mshtml: Improve locale stub for KeyboardEvent.
mshtml: Implement isContentEditable for HTML elements.
mshtml/tests: Handle broken localStorage on native.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1206
I’d advice against building wine against Xcode11, the included version of cctools will cause weird breakages for 32Bit binaries.
The default Xcode 10 command Line Tools version for Mojave is fine and comes with the headers package that installs the DevSDK like prior macOS versions.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1219#note_12984
Current solution of _set_direction() is very imprecise. This MR replaces it with more precise needs_conversion() functions. It already fixes a few cases and will be more important in the future, when we will use more generated conversion functions.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1243
On Thu Nov 3 10:12:10 2022 +0000, Piotr Caban wrote:
> I don't know why it crashes on startup on your machine but it's not
> caused by _Condition_variable_notify_one being redefined in multiple .so
> files (I guess you're using no-mingw build of Wine). Maybe there's e.g.
> some kind of memory corruption that happens to be hidden by that change.
> If you don't believe me that it's not the problem - the application
> loads both msvcp120 and msvcp140, there are much more global symbols
> with the same names and you don't see any problem caused by it.
> Please change the commit message (patch title you set with git while
> committing the patch, not only merge request title).
Thanks for the tip I've updated the commit info
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1229#note_12971
_Condition_variable_notify_one and DEFINE_THISCALL_WRAPPER(_Condition_variable_notify_one, 4) are redefined in other dynamic libraries.
Therefore, it caused the problem of global symbol coverage, which caused crash.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1229
With this series it's now possible to run and pass `user32:monitor` and `user32:sysparams` tests with nulldrv, and so most `user32` tests (except for a few desktop cursor position tests). This still requires some prefix configuration to enable the nulldrv driver, or a change like https://gitlab.winehq.org/rbernon/wine/-/commit/753368ad0ec52f03f8d6e78ca79… to enable it when `DISPLAY` environment variable is unset.
This then shows that some of the user32 tests are failing with winex11 but passing with nulldrv, as in https://gitlab.winehq.org/rbernon/wine/-/commit/6d5f4109a514a0dc266899fcacf….
--
v13: win32u: Read mode from the registry if GetCurrentDisplaySettings fails.
win32u: Write display settings to the registry in apply_display_settings.
win32u: Lock display devices while applying display settings.
https://gitlab.winehq.org/wine/wine/-/merge_requests/551
Support _NET_WM_FULLSCREEN_MONITORS for fullscreen windows spanning multiple monitors. This property
is used to hint window managers about which monitor a fullscreen window should cover. Window managers
make a fullscreen window spanning multiple monitors cover only one monitor when this property is missing.
Fix Project Cars 2/3 incorrect game window size when the triple-screen mode is on.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1233
The `_STRUCT_X86_THREAD_FULL_STATE64` definition comes from `/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/mach/i386/_structs.h` . It does not contain `_STRUCT_MCONTEXT64_FULL` or `_STRUCT_MCONTEXT_AVX64_FULL`.
There is a usr/include/i386/_mcontext.h file in 10.14.sdk, but it doesn't contain any of these definitions, unlike its cousins in later SDK versions.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1219#note_12915
bshanks was wondering about some details. While the fix seems sensible, it shouldn't be necessary according to him.
I had a closer look, and indeed Xcode 11.3.1 is not the problem. The command line tools for Xcode 11.3.1 are. Having them installed, even without pointing xcode-select, DEVELOPER_DIR or SDKROOT to them does some magic, for good (32 bit programs compile) and bad (the bug fixed here).
Some possibly relevant info:
```
grey:ntdll stefan$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
grey:ntdll stefan$ sudo xcode-select -p
/Applications/Xcode.app/Contents/Developer
grey:ntdll stefan$ echo $DEVELOPER_DIR
grey:ntdll stefan$ echo $SDKROOT
```
(Homebrew choked on a difference between xcode-select -p and sudo xcode-select -p once. I have no idea how that can happen, since xcode-select -s is system wide. Oh well)
wine configure command line:
`~/src/wine/configure --enable-win64 --without-x LDFLAGS="-L/Users/stefan/src/MoltenVK/Package/Latest/MoltenVK/dylib/macOS"`
And the exact build failure:
```
gcc -m64 -c -o dlls/ntdll/unix/signal_x86_64.o /Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c -Idlls/ntdll \
-I/Users/stefan/src/wine/dlls/ntdll -Iinclude -I/Users/stefan/src/wine/include -D__WINESRC__ \
-DWINE_NO_LONG_TYPES -D_NTSYSTEM_ -D_ACRTIMP= -DWINBASEAPI= -D_MSVCR_VER=0 -DWINE_UNIX_LIB -Wall \
-pipe -fcf-protection=none -fno-stack-protector -fno-strict-aliasing -Wdeclaration-after-statement \
-Wempty-body -Wignored-qualifiers -Winit-self -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits \
-Wvla -Wwrite-strings -Wpointer-arith -gdwarf-4 -fPIC -fasynchronous-unwind-tables -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
In file included from /Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c:83:
/Users/stefan/src/wine/dlls/ntdll/unix/dwarf.h:913:45: warning: taking the absolute value of unsigned type 'ULONG_PTR'
(aka 'unsigned long') has no effect [-Wabsolute-value]
case DW_OP_abs: stack[sp] = labs(stack[sp]); break;
^
/Users/stefan/src/wine/dlls/ntdll/unix/dwarf.h:913:45: note: remove the call to 'labs' since unsigned values cannot be negative
case DW_OP_abs: stack[sp] = labs(stack[sp]); break;
^~~~
/Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c:282:38: error: use of undeclared identifier '_STRUCT_MCONTEXT64_FULL'
if (context->uc_mcsize == sizeof(_STRUCT_MCONTEXT64_FULL) ||
^
/Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c:283:38: error: use of undeclared identifier '_STRUCT_MCONTEXT_AVX64_FULL'
context->uc_mcsize == sizeof(_STRUCT_MCONTEXT_AVX64_FULL) ||
^
/Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c:286:63: error: expected expression
return (XMM_SAVE_AREA32 *)&((_STRUCT_MCONTEXT64_FULL *)context->uc_mcontext)->__fs.__fpu_fcw;
^
/Users/stefan/src/wine/dlls/ntdll/unix/signal_x86_64.c:286:38: error: use of undeclared identifier '_STRUCT_MCONTEXT64_FULL'
return (XMM_SAVE_AREA32 *)&((_STRUCT_MCONTEXT64_FULL *)context->uc_mcontext)->__fs.__fpu_fcw;
```
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1219#note_12913
Some fonts can end up with too low height for some sizes, resulting in ppem == 0, which can lead to some metrics becoming 0 too, especially tmHeight and tmAveCharWidth. This behavior is also observed on Windows, but on Linux it could lead to division by zero. This was noticed with the font `Emmentaler-Brace`, which comes with TexLive and GNU LilyPond, in the comctl32 status test.
This patch set also tries to make the Wine behavior closer to the Windows one by enabling tmAveCharWidth to be 0 and preventing it and tmHeight from causing divisions by zero. This is very much an edge case, and I don't know if it has caused problems in actual programs, so I don't know if it would be worth it to make the behavior match exactly. But this way at least the tests should pass if some incomplete/misconfigured fonts are installed.
I mainly limited myself to win32u. I'm not sure if these changes could affect behavior in other parts of the codebase, but the tests seems unchanged.
--
v4: win32u: Allow tmAveCharWidth to be 0 when tmHeight == 0.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1192
--
v2: vkd3d-shader/hlsl: Write SM4 dcl_thread_group instructions.
vkd3d-shader/hlsl: Parse the numthreads attribute.
vkd3d-shader/hlsl: Parse function attributes.
vkd3d-shader/hlsl: Use hlsl_new_synthetic_var() in hlsl_new_func_decl().
vkd3d-shader/hlsl: Add a hlsl_fixme() for compute shader thread counts.
tests: Add some tests for HLSL attribute syntax.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/43
Some fonts can end up with too low height for some sizes, resulting in ppem == 0, which can lead to some metrics becoming 0 too, especially tmHeight and tmAveCharWidth. This behavior is also observed on Windows, but on Linux it could lead to division by zero. This was noticed with the font `Emmentaler-Brace`, which comes with TexLive and GNU LilyPond, in the comctl32 status test.
This patch set also tries to make the Wine behavior closer to the Windows one by enabling tmAveCharWidth to be 0 and preventing it and tmHeight from causing divisions by zero. This is very much an edge case, and I don't know if it has caused problems in actual programs, so I don't know if it would be worth it to make the behavior match exactly. But this way at least the tests should pass if some incomplete/misconfigured fonts are installed.
I mainly limited myself to win32u. I'm not sure if these changes could affect behavior in other parts of the codebase, but the tests seems unchanged.
--
v3: win32u: Allow tmAveCharWidth to be 0.
win32u: Prevent division by 0 in get_transform_matrices().
win32u: check if tmAveCharWidth is 0 before division.
win32u: Do not use SCALE_NTM if TM.tmHeight == 0.
win32u: Warn when ppem == 0.
win32u: Prevent division by zero in scale_font_metrics().
https://gitlab.winehq.org/wine/wine/-/merge_requests/1192
While adding tests for this I also find a couple of things related to previous MR 1111 which I am also fixing here:
- it turns out IPV6 loopback (as in "::1") should not be mapped to ipv4-mapped loopback, ipv6 and ipv4 loopbacks are different addresses. The mapping of that was also missing htonl() for INADDR_LOOPBACK so essentially didn't break anything;
- basically the same is for INADDR_ANY (ipv6 "any" doesn't prevent binding to ipv4 "any"), although that is different when SO_EXCLUSIVEADDRUSE is used: in that case ipv6 wildcard address actually blocks ipv4 INADDR_ANY.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1196
This increases the QoS class of the main Wine thread from default to user-interactive.
`pthread_attr_set_qos_class_np` was added in the 10.10 SDK, which is our minimum requirement already.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1232
Some fonts can end up with too low height for some sizes, resulting in ppem == 0, which can lead to some metrics becoming 0 too, especially tmHeight and tmAveCharWidth. This behavior is also observed on Windows, but on Linux it could lead to division by zero. This was noticed with the font `Emmentaler-Brace`, which comes with TexLive and GNU LilyPond, in the comctl32 status test.
This patch set also tries to make the Wine behavior closer to the Windows one by enabling tmAveCharWidth to be 0 and preventing it and tmHeight from causing divisions by zero. This is very much an edge case, and I don't know if it has caused problems in actual programs, so I don't know if it would be worth it to make the behavior match exactly. But this way at least the tests should pass if some incomplete/misconfigured fonts are installed.
I mainly limited myself to win32u. I'm not sure if these changes could affect behavior in other parts of the codebase, but the tests seems unchanged.
--
v2: win32u: Allow tmAveCharWidth to be 0.
win32u: Prevent division by 0 in get_transform_matrices().
win32u: check if tmAveCharWidth is 0 before division.
win32u: Do not use SCALE_NTM if TM.tmHeight == 0.
win32u: Warn when ppem == 0.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1192
This series improves Wine's support for delete-on-close flag and
delete disposition information on files:
- adapts tests for Windows 10
- extend and fix some tests
- implement some missing features in ntdll & server
--
v2: server: Let file creation fail depending unlink status.
server: Propagate the unlink status to all opened/closed files.
ntdll: Query FILE_STANDARD_INFORMATION.DeletePending from server.
ntdll: Extend file tests about delete-on-close and disposition.
ntdll: Fix share mode for some delete-on-close/delete disposition tests.
ntdll: Adapt file tests on delete-on-close / delete disposition to Windows 10.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1231
This series improves Wine's support for delete-on-close flag and
delete disposition information on files:
- adapts tests for Windows 10
- extend and fix some tests
- implement some missing features in ntdll & server
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1231
This change is adding DWARF (CFI) unwind information to the
hand-written assembly of the `__wine_syscall_dispatcher` function.
This enables unwinding through the dispatcher from the Linux stack
into (and through) the Windows stack.
The general idea is that the `syscall_frame` struct contains the
content of the callee-save registers before the function call
(in particular the stack pointer and the return address). At any
point of the execution, we have a pointer into the `syscall_frame`
in $ebx, $ecx, $ebp, or $esp.
For the CFI codes the general idea is that we are defining the
computations of the callee-save registers based on the
`syscall_frame` using DWARF’s `breg` instruction, rather than
relative to CFA.
cc/ @florian-kuebler
--
v4: ntdll: Add CFI unwind info to __wine_syscall_dispatcher (i386).
ntdll: Move CFI helper macros out of signal_x86_64.c.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1182
The storage event url prop fix is tested after the location.hash tests are added, implicitly. I didn't find a need to add extra tests for no reason there.
The super_navigate changes for fragments is also necessary for the location.hash tests (and its behavior, apparently)…
--
v2: mshtml: Implement document.importNode.
mshtml: Implement HTMLLocation_put_hash.
mshtml: Always use super_navigate when navigating fragments.
mshtml: Don't include fragment in storage event's url prop.
mshtml: Return E_ABORT if wine-gecko's OnDataAvailable aborts the binding.
mshtml: Improve locale stub for KeyboardEvent.
mshtml: Implement isContentEditable for HTML elements.
mshtml/tests: Handle broken localStorage on native.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1206
With this series it's now possible to run and pass `user32:monitor` and `user32:sysparams` tests with nulldrv, and so most `user32` tests (except for a few desktop cursor position tests). This still requires some prefix configuration to enable the nulldrv driver, or a change like https://gitlab.winehq.org/rbernon/wine/-/commit/753368ad0ec52f03f8d6e78ca79… to enable it when `DISPLAY` environment variable is unset.
This then shows that some of the user32 tests are failing with winex11 but passing with nulldrv, as in https://gitlab.winehq.org/rbernon/wine/-/commit/6d5f4109a514a0dc266899fcacf….
--
v12: win32u: Read mode from the registry if GetCurrentDisplaySettings fails.
win32u: Write display settings to the registry in apply_display_settings.
win32u: Lock display devices while applying display settings.
https://gitlab.winehq.org/wine/wine/-/merge_requests/551
Fix a regression from ee405dd. After ee405dd, is_window_rect_full_screen() may compare window
rectangles against the empty rectangles of detached monitors. For example, is_window_rect_full_screen()
can incorrectly return TRUE for a (0, 0, 1, 1) rectangle because 0 <= 0 && 1 >= 0 && 0 <= 0 && 1 >= 0
is true.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1224
The function `scale_font_metrics()` in `win32u/font.c` was generating a division by zero exception in one of the `comctl32` tests (`status.ok`). This patch just short-circuits the ratio check in the function in case `tm->tmHeight == 0`. This was enough to allow the tests to pass.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1192
This change is adding DWARF (CFI) unwind information to the
hand-written assembly of the `__wine_syscall_dispatcher` function.
This enables unwinding through the dispatcher from the Linux stack
into (and through) the Windows stack.
The general idea is that the `syscall_frame` struct contains the
content of the callee-save registers before the function call
(in particular the stack pointer and the return address). At any
point of the execution, we have a pointer into the `syscall_frame`
in $ebx, $ecx, $ebp, or $esp.
For the CFI codes the general idea is that we are defining the
computations of the callee-save registers based on the
`syscall_frame` using DWARF’s `breg` instruction, rather than
relative to CFA.
cc/ @florian-kuebler
--
v3: ntdll: Add CFI unwind info to __wine_syscall_dispatcher (i386).
ntdll: Move CFI helper macros out of signal_x86_64.c.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1182