On Thu Feb 13 05:57:40 2025 +0000, Aida Jonikienė wrote:
> Does iCUE even work on Wine though? I think it does direct USB device
> access for mice/keyboards (and other peripherals)
It's also needed by other programs like PowerToys, but iCUE is the easiest to test since it calls it right away. And Wine has some USB support.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7146#note_94422
Make both method calls;
1. Consistently written with parameter names as per spec.
2. Fix parameter validation to be consistent with spec.
3. Fix szNameBuf parameter semantics as per spec.
4. Fix szNameBuf casing str search as per spec.
5. Factor out common code into TLB_ helpers vastly improves readability.
--
v22: dlls/oleaut32: Bound ITypeLib2_Constructor_SLTG() loop
dlls/oleaut32/connpt.c: Make consistent and validate args
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/7286
Make both method calls;
1. Consistently written with parameter names as per spec.
2. Fix parameter validation to be consistent with spec.
3. Fix szNameBuf parameter semantics as per spec.
4. Fix szNameBuf casing str search as per spec.
5. Factor out common code into TLB_ helpers vastly improves readability.
--
v21: dlls/oleaut32/connpt.c: Make consistent and validate args
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/7286
This fixes https://bugs.winehq.org/show_bug.cgi?id=52094.
For reference, here's how current_modref is being passed around (before this patch):
```mermaid
graph TB
fii["fixup_imports_ilonly<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
fi["fixup_imports<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
pa["process_attach<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
ld[load_dll]
id["import_dll<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
bin["build_import_name<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
foe["find_ordinal_export<br><em style='color:#0f0'>(uses current_modref for relay)</em>"]
ffe["find_forwarded_export<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
fne[find_named_export]
MI[MODULE_InitDLL]
fii --> ld
fi --> id
pa --> MI -.-> DllMain
id --> bin
id --> ld
id --> foe
id --> fne --> foe --> ffe --> foe
ffe --> fne
ffe --> bin
style DllMain color:red;
```
--
v11: ntdll: Remove superflous NULL check for importer.
ntdll: Properly track refcount on dynamic imports of export forwarders.
ntdll: Explicitly ignore dynamic (GetProcAddress) importers as relay/snoop user module.
ntdll: Properly track refcount on static imports of export forwarders.
ntdll: Register module dependency for export forwarders regardless of whether the dependency is already loaded.
ntdll: Don't re-add a module dependency if it already exists.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7
Make both method calls;
1. Consistently written with parameter names as per spec.
2. Fix parameter validation to be consistent with spec.
3. Fix szNameBuf parameter semantics as per spec.
4. Fix szNameBuf casing str search as per spec.
5. Factor out common code into TLB_ helpers vastly improves readability.
--
v20: dlls/oleaut32/connpt.c: Make consistent and validate args
dlls/oleaut32: Add missing IID case in ITypeLib2::QueryInterface()
dlls/oleaut32: Validate TLB_QueryInterface() params
dlls/oleaut32: Fix QueryInterface() to meet spec
dlls/shell32: Fix IUnknown::QueryInterface() to meet spec
dlls/oleaut32: Invert if-stmt in ITypeLib2_fnRelease()
dlls/oleaut32: Consistently use TLB_REF_NOT_FOUND
dlls/oleaut32: Validate arguments in ITypeLibComp interface
dlls/oleaut32: Validate arguments in ITypeComp interface
dlls/oleaut32: Consistently use TLB_get_bstr()
dlls/oleaut32: Invert if stmt for clarity
dlls/oleaut32: Fix nonsensical memory access in ITypeLib2_Constructor_SLTG()
dlls/oleaut32: Avoid ptr arithmetic in MSFT_DoVars()
dlls/oleaut32: Avoid ptr arithmetic in ITypeLib2_Constructor_SLTG()
dlls/oleaut32: Shink down ITypeLibComp_fnBind() verbosity some
dlls/oleaut32: ptr_size should be a ULONG
dlls/oleaut32: Scope indexer to loops in fn[Is|Find]Name()
dlls/oleaut32: Factor out TLB_get_funcparams_by_name()
dlls/oleaut32: Factor out TLB_get_funcdesc_by_name()
dlls/oleaut32: Validate args of ITypeLib2_fnIsName()
dlls/oleaut32: fn(Is|Find)Name should set szNameBuf with correct case
dlls/oleaut32: Use consistent param identifiers in fnFindName
dlls/oleaut32: Mostly mirror fnFindName impl in typelib.c
dlls/oleaut32: Use common and correct identifiers in typelib.c
dlls/oleaut32: Consistently use lstrcmpiW() while looking for names
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/7286
Fixes Indiana Jones and the Great Circle showing system mouse cursor along with its own one after alt-tabbing out and in.
The game hides the cursor and sets up rawinput w/RIDEV_NOLEGACY in WM_ACTIVATE handling. Then, whenever it receives WM_SETCURSORPOS it shows the cursor back. WM_SETCURSORPOS is triggered by WM_MOUSEMOVE in DefWIndowProc; WM_MOUSEMOVE is not queued with rawinput/RIDEV_NOLEGACY but prior hardware messages and system messages from set_cursor_pos are present in the queue.
That's not the case on Windows. That corresponds to the fact that Windows generates those system WM_MOUSEMOVE message "on demand", that is, when Peek or GetMessage is called (see, e. g., [1]). While Wine generates and queues those in internal messages queue in server/queue.c:set_cursor_pos(). My test confirm Windows behaviour. There are corner case specifics which my patch ignores:
- If PeekMesage( PM_NOREMOVE) got the message it will be then delivered even after setting up rawinput;
- Delivery of SendInput() under these conditions depends on MOUSEEVENTF_MOVE_NOCOALESCE flag (which we currently don't support at all); my patch just drops any hardware WM_MOUSEMOVE messages under these conditions (which corresponds to Windows behaviour without MOUSEEVENTF_MOVE_NOCOALESCE).
1. https://devblogs.microsoft.com/oldnewthing/20130523-00/?p=4273
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7321#note_94406
This fixes https://bugs.winehq.org/show_bug.cgi?id=52094.
For reference, here's how current_modref is being passed around (before this patch):
```mermaid
graph TB
fii["fixup_imports_ilonly<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
fi["fixup_imports<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
pa["process_attach<br><em style='color:#ff0'>(directly sets current_modref)</em>"]
ld[load_dll]
id["import_dll<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
bin["build_import_name<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
foe["find_ordinal_export<br><em style='color:#0f0'>(uses current_modref for relay)</em>"]
ffe["find_forwarded_export<br><em style='color:#0f0'>(directly uses current_modref)</em>"]
fne[find_named_export]
MI[MODULE_InitDLL]
fii --> ld
fi --> id
pa --> MI -.-> DllMain
id --> bin
id --> ld
id --> foe
id --> fne --> foe --> ffe --> foe
ffe --> fne
ffe --> bin
style DllMain color:red;
```
--
v10: ntdll: Remove superflous NULL check for importer.
ntdll: Properly track refcount on dynamic imports of export forwarders.
ntdll: Explicitly ignore dynamic (GetProcAddress) importers as relay/snoop user module.
ntdll: Properly track refcount on static imports of export forwarders.
ntdll: Register module dependency for export forwarders regardless of whether the dependency is already loaded.
ntdll: Don't re-add a module dependency if it already exists.
ntdll: Register module dependency for export forwarders only after successful resolution.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7
`mach_continuous_approximate_time()` has the necessary precision for win32 ticks and can be up to 4x faster than `mach_continuous_time()`.
Also `clock_gettime( CLOCK_REALTIME, &ts )` calls always end up in `__commpage_gettimeofday( struct timeval *tp )`:
```
* frame #0: 0x00007ff806788763 libsystem_kernel.dylib`__commpage_gettimeofday
frame #1: 0x00007ff8066709a3 libsystem_c.dylib`gettimeofday + 45
frame #2: 0x00007ff806678b31 libsystem_c.dylib`clock_gettime + 117
```
These extra calls, setup and converting from one struct format to another costs another 60 CPU cycles and in my testing makes `NtQuerySystemTime` approximately 30% faster as well with this MR. This is a fairly hot code path (especially when using certain out-of-tree in process synchronization patch sets), so probably worth the optimization here.
All of these APIs are available since 10.12.
--
v4: ntdll: Replace '0' with 'NULL' in gettimeofday() calls.
ntdll: Use gettimeofday in system_time_precise on macOS.
ntdll: Use __commpage_gettimeofday in NtQuerySystemTime on macOS.
ntdll: Always use mach_continuous_approximate_time on macOS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7256
Based on Piotr's findings.
On MSVC i386 targets, structs requiring alignment greater than 4 are never passed by value.
Clang follows the same behavior in MSVC mode (see [1] for details and [2] for a follow-up
that applies this logic when fields, not necessarily the entire struct, are aligned).
A number of ios functions take fpos_mbstatet as an argument and expect it to be passed by value.
[1] https://reviews.llvm.org/D72114
[2] https://github.com/llvm/llvm-project/issues/63257
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57817
--
v2: msvcp60/tests: Avoid explicitly aligning structs passed by value.
msvcp60: Avoid explicitly aligning structs passed by value.
msvcp90/tests: Avoid explicitly aligning structs passed by value.
msvcp: Avoid explicitly aligning structs passed by value.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7312
When dlls/win32u fails to load/initialize the \`FreeType font library', a device context object ends up with the only GDI driver attached -- `null_driver`. The latter implements the `pGetTextMetrics` callback function as do-nothing code. This causes the `NtGdiGetTextMetricsW()` function to fail not modifying fields of its `metrics` argument. In result the `normalize_nonclientmetrics()` ends up with uninitialized `tm` local variable after call to the `get_text_metr_size()` function. Using uninitialized fields of the `TEXTMETRICW` structure gives unpredictable results.
This memset(3)'s the `tm` structure before using. After that, even if we failed to load the \`FreeType font library', the \`CaptionHeight', \`SmCaptionHeight' and \`MenuHeight' metrics keep their current values (the `normalize_nonclientmetrics()` function is called after `get_twips_entry()` callback function, thus value of an entry should not be negative).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7316