On Fri Nov 15 14:47:18 2024 +0000, Akihiro Sagawa wrote:
> I manually tested the vertical features using a specially crafted
> TrueType file.
> The font file displays different circled numbers as vertical substitutes
> for Japanese punctuation marks (U+3001, U+3002) based on its lookup
> table.
> If the implementation chooses:
> - the first vert feature, i.e. no script/lang lookup, the app shows ①
> (U+2460's glyph).
> - the first script/lang tag (@@@@), it shows ② (U+2461's).
> - the 'DFLT' script, it shows ③ (U+2462's).
> - the 'kana' script, it shows ④ (U+2463's).
> What we can see is ① with plain gdi API.
> 
> See [gsub.txt](/uploads/9d5ef683f937fc0b48f9f7e833fab930/gsub.txt) file
> in ttx format for details, please.
Thank you, this looks conclusive enough for me. Please rebase, but otherwise I think it's ready.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5633#note_87626
On Fri Nov 15 14:46:06 2024 +0000, Nikolay Sivov wrote:
> I think the remaining question here is if we want to remove script/lang
> lookup logic entirely, or instead prioritize. @sgwaki, any idea if it's
> possible to test that? Testing manually is fine. To be clear, test font
> should have at least two differing vert features, with second feature
> being testable with specific script/lang pair, if that is possible to
> achieve with plain gdi API at all.
I manually tested the vertical features using a specially crafted TrueType file.
The font file displays different circled numbers as vertical substitutes for Japanese punctuation marks (U+3001, U+3002) based on its lookup table.
If the implementation chooses:
- the first vert feature, i.e. no script/lang lookup, the app shows ① (U+2460's glyph).
- the first script/lang tag (@@@@), it shows ② (U+2461's).
- the 'DFLT' script, it shows ③ (U+2462's).
- the 'kana' script, it shows ④ (U+2463's).
What we can see is ① with plain gdi API.

See [gsub.txt](/uploads/9d5ef683f937fc0b48f9f7e833fab930/gsub.txt) file in ttx format for details, please.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5633#note_87621
This completely refactors the winex11 window state tracking, keeping track of the desired/pending/current window state and config in a fully asynchronous way, and avoiding duplicate requests. I believe this mitigates various race conditions that we're suffering from, solving most spurious event feedback loops when the X11 state is being applied while some win32 state change is being requested, and fixing the spurious d3d/ddraw/user32 test failures.
--
v7: winex11: Request window state updates asynchronously.
winex11: Update the window client config on window state changes.
winex11: Wait for pending ConfigureNotify before updating the client state.
winex11: Wait for pending _NET_WM_STATE before updating the client state.
winex11: Ignore focus changes during WM_STATE transitions.
winex11: Introduce a new window_update_client_config helper.
winex11: Introduce a new window_update_client_state helper.
winex11: Use the new window state tracker to get WM_STATE value.
winex11: Use the new window state tracker to get _NET_WM_STATE value.
d3d9/tests: Flush events after minimizing and restoring focus window.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6569
This is the current proton thread priority implementation by @rbernon rebased for upstream with a few `#ifdef`s added since AFAIK Linux is the only operating system where threads have a unique PID which can be used to set niceness on.
~~I also ran `./tools/make_requests` on https://gitlab.winehq.org/mzent/wine/-/commit/6705d3481be0409f7e971c1d2c7a3… as well and `autoconf` on https://gitlab.winehq.org/mzent/wine/-/commit/d7bafe40c411753662b2ad97148a6… (which does blow up the line count a bit).~~
A few tiny changes ~~(with the ready variable for example)~~ are in anticipation for Part 2, which also adds Mach thread priorities and recalculates thread priorities on process priority change.
Since this is a rather large MR, I hope the split here is appropriate ~~(with the second part being slightly smaller)~~, but I think logically it makes the most sense here.
--
v16: server: Check wineserver privileges on init with -20 niceness.
server: Use setpriority to update thread niceness when safe.
ntdll: Set RLIMIT_NICE to its hard limit.
server: Introduce new set_thread_priority helper.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4551
When WM_STATE is being quickly updated, and depending on the WM we might
receive transient focus changes, which will disrupt the Win32 state and
make us randomly lose focus.
Ignore them instead, when a window is being shown, and wait for WM_STATE
to be updated and stable. We will eventually receive a WM_TAKE_FOCUS /
FocusIn event *after* a window has been shown.
When a window is hidden or minimized, we will receive the FocusOut event
during the WM_STATE transition, and can safely handle it in this case,
as we should have done all the Win32 side effects and have changed the
foreground window already.
When there's no window state change pending, the focus change event is
unexpected, coming from the user or WM, and we handle it normally.
With the planned asynchronous state changes it will become more likely to
receive transient focus events, and we need to ignore any focus change that
is expected or known to be superseded.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6822
As far as I can tell, ime.h is only included by the x11 keyboard driver and `WM_IMEKEYDOWN` and `WM_IMEKEYUP` are not used there, so this change should only bring the naming convention in line with what is already in winuser and MSDN.
--
v3: winex11: Do not include ime.h.
include: Add Japanese IME virtual key codes to winuser.rh.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6819
As far as I can tell, ime.h is only included by the x11 keyboard driver and `WM_IMEKEYDOWN` and `WM_IMEKEYUP` are not used there, so this change should only bring the naming convention in line with what is already in winuser and MSDN.
--
v2: winex11: Do not include ime.h.
include: Add Japanese IME virtual key codes to winuser.rh.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6819
As far as I can tell, ime.h is only included by the x11 keyboard driver and `WM_IMEKEYDOWN` and `WM_IMEKEYUP` are not used there, so this change should only bring the naming convention in line with what is already in winuser and MSDN.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6819
This is based on top of !6526, will mark ready after !6526 is merged.
--
v8: propsys: Support converting to BSTR for PropVariantToVariant.
propsys: Use debugstr_variant for the trace in VariantToPropVariant.
propsys: Implement PropVariantToBSTR.
propsys/tests: Test truncating for PropVariantToString.
propsys/tests: Test PropVariantToBSTR.
propsys: Add PropVariantToBSTR stub.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6640
This MR introduces support for [thread safety annotations,](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#conditi… currently supported by Clang. The feature is similar to `__WINE_MALLOC` attributes, allowing functions, data members and global variables to be optionally annotated with synchronization details.
As a proof of concept, I have annotated `RTL_CRITICAL_SECTION` and `dlls/ntdll`.
Because the feature was designed as a C++ extension first, a bit of stubbing is required to annotate struct fields about what lock they are guarded by. The macros `WINE_DECLARE_LOCK_FIELD_STUB` and `WINE_DEFINE_LOCK_FIELD_STUB` take care of that. For instance, in `dlls/ntdll/threadpool.c`:
```c
WINE_DECLARE_LOCK_FIELD_STUB(threadpool_group, CRITICAL_SECTION, cs);
struct threadpool_group
{
LONG refcount;
BOOL shutdown;
CRITICAL_SECTION cs;
/* list of group members, locked via .cs */
struct list members __WINE_FIELD_GUARDED_BY(threadpool_group, cs);
};
WINE_DEFINE_LOCK_FIELD_STUB(threadpool_group, CRITICAL_SECTION, cs);
```
Clang will therefore warn if `members` is accessed without holding `cs`.
Note that the analyzer does not support conditional locking. For that reason, functions that hold and release a lock conditionally have been marked with `__WINE_NO_THREAD_SAFETY_ANALYSIS` to pre-empt false positives from Clang.
--
v8: configure: Enable -Wthread-safety-analysis, -Wthread-safety-attributes warnings.
dlls/ntoskrnl.exe: Add thread safety annotations.
dlls/combase: Add thread safety annotations.
dlls/imm32: Add GUARDED_BY attribute to the struct ime's refcount field.
dlls/crypt32: Annotate CRYPT_CollectionAdvanceEnum indicating that the caller should hold the collection store's lock.
dlls/amstream/tests: Disable thread safety analysis for testfilter_wait_state.
dlls/winhttp: Add thread safety annotations.
dlls/mmdevapi: Add thread safety annotations for session_lock and sessions_unlock.
dlls/mfplat: Add thread safety annotations.
dlls/msi: Add thread safety annotations for msiobj_lock and msiobj_unlock.
dlls/xaudio2_7: Add thread safety annotations.
dlls/wmvcore: Add thread safety annotations for async_reader_wait_pts, async_reader_deliver_sample, and callback_thread_run.
dlls/wininet: Disable thread safety annotations for HTTPREQ_ReadFile and HTTPREQ_QueryDataAvailable.
dlls/winegstreamer: Add thread safety annotation for GST_Seeking_SetPositions.
dlls/dwrite: Add thread safety annotations for factory_lock and factory_unlock.
dlls/wined3d: Add thread safety annotations.
lib/vkd3d: Build with WINE_NO_THREAD_SAFETY_ANALYSIS defined.
dlls/d2d1: Add thread safety annotations.
dlls/xaudio2_7: Disable thread safety analysis for IXAudio2Impl_CreateSourceVoice.
dlls/xinput1_3: Add thread safety annotations for controller_lock and controller_unlock.
dlls/ucrtbase/tests: Only release &fp.iobuf->_crit if the previous lock was successful (Clang).
dlls/netio.sys: Add thread safety annotations for lock_sock and unlock_socket.
dlls/msvcirt/tests: Release &sb.lock only if the previous lock was successful (Clang).
dlls/wbemprox: Add thread safety annotations.
libs/strmbase: Annotate BaseRenderer_Receive to indicate the caller needs to hold the underlying filter lock.
dlls/rpcrt4: Add thread safety annotations for AllocateContextHandle, FindContextHandle, ReleaseContextHandle.
dlls/wined3d: Add thread safety annotations for allocator locking helpers.
dlls/mfreadwrite: Indicate calling source_reader_read_sample requires holding &reader->cs.
dlls/mapi32: Add thread safety annotations for GetValue, AddValue, Lock, Unlock.
dlls/kernel32/tests: Add thread safety annotations.
dlls/combase: Add thread safety annotations
programs/services: Add thread safety annotations.
dlls/winmm: Add thread safety annotations.
dlls/vcomp: Add thread safety annotations.
dlls/user32: Add thread safety annotations.
dlls/odbc32: Add thread safety annotations.
dlls/krnl386.exe16: Add thread safety annotations.
dlls/msvcirt: Add thread safety annotations.
dlls/msvcp90: Add thread safety annotations.
dlls/msvcrt: Add thread safety annotations.
dlls/kernelbase: Add thread safety annotations.
include/wine/winbase16: Add thread safety annotations for _Enter/LeaveSysLevel
dlls/kernelbase: Release console_section in case of an allocation failure in alloc_console.
include/winbase.h: Add thread safety annotations for Enter/LeaveCriticalSection, SleepConditionVariableCS and TryEnterCriticalSection.
dlls/ntdll: Add thread safety annotations.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6623
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57370
--
v3: winex11: Always generate ConfigureNotify events for embedded windows.
winex11: Generate ConfigureNotify events for the children tree.
winex11: Avoid overriding previously received ConfigureNotify events.
winex11: Retrieve the HWND for the host window's child window.
winex11: Introduce a new host_window_send_configure_events helper.
winex11: Reset the window relative position when it gets reparented.
winex11: Reset embedded window position to 0x0 before docking it.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6815
I think the remaining question here is if we want to remove script/lang lookup logic entirely, or instead prioritize. @sgwaki, any idea if it's possible to test that? Testing manually is fine. To be clear, test font should have at least two differing vert features, with second feature being testable with specific script/lang pair, if that is possible to achieve with plain gdi API at all.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5633#note_87482
Please don't constantly rebase your MR, it's a waste of CI resources.
As far as I can tell it hasn't been confirmed that this actually fixes anything, and it seems unlikely that it would be useful without applying the deltas.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5523#note_87478
The `-fms-hotpatch` flag has been available in Clang since version 14, but it was broken before version 18 (e.g., it could crash on some files when using CI’s Clang). Unfortunately, I couldn’t find a reliable way to check for this in configure, hence the convoluted workaround.
The flag is supported on both 32-bit and 64-bit x86 architectures. It ensures that the first instruction of a function is at least 2 bytes long at the compiler level and adds additional padding during linking.
However, there is a limitation: when the compiler emits multiple functions in a single `.text` section, those functions are not padded. This differs from MSVC, where the compiler handles such padding. Using `-ffunction-sections` mitigates this issue.
While we could limit the use of `-ffunction-sections` to specific cases, it appears beneficial overall. It allows the linker to GC unused functions, which is helpful when linking against static libraries that include both used and unused functions in the same file. This is already the default on ARM64EC, so it makes things more consistent across targets.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6814
This variable is the Wine's equivalent of the SDL_VIDEODRIVER/
SDL_VIDEO_DRIVER variable in SDL 2 and 3 (it explicitly selects
a list of graphics/video drivers to be used).
--
v2: man: Add documentation for the WINE_VIDEO_DRIVER variable.
explorer: Introduce a new WINE_VIDEO_DRIVER variable.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6301
--
v2: mshtml: Forward deletion for GLOBAL_SCRIPTVAR to the script's object.
mshtml: Check if window global prop still exists before returning its id.
mshtml: Override window's element prop directly rather than using
mshtml: Use BSTR to store global prop's name.
jscript: Add basic semi-stub implementation of GetMemberProperties.
mshtml: Throw invalid action for IE8 window prop deletion.
mshtml: Reset builtin function props to their default values when deleted.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6721
This is a followup to commit d78cbe84e5f0000c6523c4b997de476b12d929b6.
Sorry, did not notice this earlier.
The kernel32_test.exe links agains msvcrt.dll directly, but also
via user32.dll to ucrtbase.dll, therefore now one call less to HeapCreate.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6807
wintab32 is currently broken in the new wow64 mode because the `tablet_get_packet` thunk in winex11.drv is not implemented. Since the structure it is copying is entirely internal to Wine, and the HCTX handle value is not actually read or written by the driver side, I found that simply padding the structure to keep the rest of it aligned was enough to make wow64 happy and allow wintab32 to function.
This is somewhat a stopgap. What would be much better is to refactor the wintab code such that more of the logic is in the wintab32 implementation and not the driver. My goal is to accomplish this as part of trying to get my winewayland graphics tablet patch into an acceptable state for upstreaming. However, I think this is still a worthwhile improvement to have in the interim, if it is acceptable.
--
v4: winex11: Remove stub tablet_get_packet wow64 thunk
wintab32: Align WTPACKET for 32/64-bit archs
https://gitlab.winehq.org/wine/wine/-/merge_requests/6584
This MR adds a unixlib component to wlanapi containing DBus + NetworkManager implementations for
* WlanEnumInterfaces
* WlanGetAvailableNetworkList
* WlanGetNetworkBssList
* WlanScan
* WlanSetProfile
* WlanConnect
* WlanGetProfileList
* WlanDisconnect
--
v13: wlanapi: Add NetworkManager backed implementation for WlanDisconnect.
wlanapi/tests: Add unit tests for WlanDisconnect.
wlanapi: Add NetworkManager backed implementation for WlanSetProfile.
wlanapi/tests: Add tests for WlanSetProfile.
wlanapi: Add stub for WlanSetProfile.
wlanapi: Add stub for WlanDisconnect.
wlanapi: Add an initial NetworkManager backed implementation for WlanConnect.
wlanapi/tests: Add unit tests for WlanConnect.
wlanapi: Add stub for WlanConnect.
wlanapi: Add NetworkManager backed implementation for WlanGetProfileList.
wlanapi/tests: Add unit tests for WlanGetProfileList.
wlanapi: Add stub for WlanGetProfileList.
wlanapi: Add NetworkManager backed implementation for WlanScan.
wlanapi/tests: Add unit tests for WlanScan.
wlanapi: Add NetworkManager backed implementation for WlanGetNetworkBssList.
wlanapi/tests: Add unit test for test_WlanGetNetworkBssList.
wlanapi: Add stub for WlanGetNetworkBssList.
wlanapi: Add NetworkManager backed implementation for WlanGetAvailableNetworkList.
wlanapi/tests: Add unit test for WlanGetAvailableNetworkList.
wlanapi: Add NetworkManager backed implementation for WlanEnumInterfaces.
wlanapi: Add a basic unixlib implementation.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6505
The tests are added at the end to avoid restructuring older tests.
--
v2: urlmon/tests: Test flags for getting properties.
urlmon: Support Uri_DISPLAY_IDN_HOST.
urlmon: Support Uri_PUNYCODE_IDN_HOST.
urlmon: Support Uri_DISPLAY_NO_FRAGMENT.
urlmon: Support Uri_HOST_IDN.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6796
I've tried implementing this before but importing user32 from ntdll isn't a reliable
thing (so I recently rewrote it using the ntdll equivalents of LoadLibrary() and GetProcAddress())
Note: This is a weird way to implement this function (Windows implements this
in ntdll instead) but that would probably require a user32/ntdll rewrite (so this
is the next best tning to get the application working)
--
v4: ntdll: Implement NtdllDefWindowProc_A().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5236
On Wed Nov 13 03:27:52 2024 +0000, John Chadwick wrote:
> Are you suggesting making `pkContext` a `UINT64`? I don't think I can
> change `HCTX` itself because that's part of the Wintab32 ABI.
As far as I can tell a UINT should work.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6584#note_87278
On Tue Nov 12 20:28:07 2024 +0000, Alexandre Julliard wrote:
> If you are not going to convert pkContext, then it seems it shouldn't be
> a pointer in the first place.
Are you suggesting making `pkContext` a `UINT64`? I don't think I can change `HCTX` itself because that's part of the Wintab32 ABI.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6584#note_87277
Alexandre Julliard (@julliard) commented about dlls/winex11.drv/wintab.c:
>
> typedef struct tagWTPACKET {
> HCTX pkContext;
> +#ifndef _WIN64
> + DWORD pkPadding;
> +#endif
If you are not going to convert pkContext, then it seems it shouldn't be a pointer in the first place.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6584#note_87245
Test Driver Unlimited Solar Crown depends on that (both calling ProcessTlsInformation and hotpatches the same to fixup the thread local storage allocation from ntdll).
--
v3: ntdll: Match memory allocation layout for ThreadLocalStoragePointer.
ntdll: Use NtSetInformationProcess( ProcessTlsInformation ) in alloc_tls_slot().
ntdll: Implement NtSetInformationProcess( ProcessTlsInformation ).
ntdll/tests: Add tests for NtSetInformationProcess( ProcessTlsInformation ).
https://gitlab.winehq.org/wine/wine/-/merge_requests/6549
This completes the implementation of display setting virtualization using DPI scaling, ie: Proton fshack done right.
There's various things to tweak still, and this will stay as an experimental feature with X11 (Wayland actually needs it to implement display mode change so it's as experimental as the driver):
- Fullscreen windows aren't padded when the display mode aspect ratio doesn't match the physical one.
- Dragging a window over another monitor with a different raw DPI is broken, and window dimensions may flicker/break, this will need the winex11 window configure refactoring (ie: https://gitlab.winehq.org/wine/wine/-/merge_requests/6731 and the other changes in https://gitlab.winehq.org/wine/wine/-/merge_requests/6569) to be fixed.
- DPI scaling is implemented with NtGdiStretchBlt, which is suboptimal, may not be performing well, and present sync is reportedly broken with GL/VK.
- A couple of other more minor tweaks.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6804
The surface scale is there to match between the Wine DPI and the
compositor scaling, not to implement Wine DPI scaling, ie: when
compositor scaling is set to 200% and Wine DPI is also set to 192,
windows are shown at 1:1 scale, instead of being upscaled twice.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6805
This is the first of 3 planned MRs reworking how `D3DXSaveSurfaceToFileInMemory()` functions, starting with DDS files.
--
v2: d3dx9: Add support for saving paletted surfaces to DDS files.
d3dx9: Set the DDSCAPS_ALPHA flag when saving DDS files with a pixel format containing an alpha channel.
d3dx9: Improve save_dds_surface_to_memory().
d3dx9/tests: Add more tests for saving surfaces as DDS files.
d3dx9: Don't attempt to save palettized surfaces in D3DXSaveSurfaceToFileInMemory().
d3dx9/tests: Include ddraw.h in surface.c for DDS header flag definitions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6776
Some FOURCC values such as 0xdeadbeef will en up being negative when cast to the
enum type, and may cause a random crash later on. This happens randomly in the
ddraw tests, depending on the compiler being used.
--
v2: wined3d: Cast format_id when comparing it to the last format index.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6698
So we don't crash if the application unloads dinput. This can only happen if the application didn't
release all dinput objects before unloading the module, which we have observed the Yakuza games to
do.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6781
These changes are the documented way to implement IMFMediaEventGenerator for a media source. Avoiding using a destroyed event queue is the only reason to lock the CS that I can find. On top of !6783 it seems to resolve hanging while switching characters in Killsquad (not decisively proven though).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6800
This is an alternate solution to MR 6761 [1]
(actually is based on comment in that MR).
WriteProcessMemory() should succeed when process handle doesn't have
PROCESS_QUERY_INFORMATION access right set (test attached).
Plus some additional cleanup in test for ReadProcessMemory().
Feedback from Proton says that this patch solves the reported game issue.
[1] https://gitlab.winehq.org/wine/wine/-/merge_requests/6761
--
v5: server: Amend process rights mapping.
advapi32: Test some other cases of process access rights mapping.
advapi32/tests: Fix typo in manifest constant.
kernel32/tests: Don't hardcode page size in buffer size.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6767
--
v2: winhttp: Add support WinHttpRequestOption_SslErrorIgnoreFlags in IWinHttpRequest_get_Option.
winhttp: Add support WinHttpRequestOption_SslErrorIgnoreFlags in IWinHttpRequest_put_Option.
winhttp/tests: Add some tests for WinHttpRequestOption_SslErrorIgnoreFlags in IWinHttpRequest_{put,get}_Option.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6797