Application was quering for SQL_MAX_COLUMNS_IN_TABLE (101).
Let all fields through and only convert ones that need it.
--
v2: odbc32: Always pass through the field id to SQLColAttributes/W
https://gitlab.winehq.org/wine/wine/-/merge_requests/6365
Right now this should not do anything because all windows are per-monitor DPI aware. When this is changed this will automatically fall back to window surface scaling through `NtGdiStretchBlt` in win32u.
This has the disadvantage that `NtGdiStretchBlt` is doing an absolutely terrible job at upscaling. This then adds a way for drivers to opt-in and do their own surface scaling before falling back to win32u. Alternatively and perhaps better, we could pull libcairo and use it to scale the surface contents with high quality filtering instead of using GDI.
--
v5: win32u: Implement DPI scaled window surface.
win32u: Move window_surface creation helper to dce.c.
win32u: Map window rects DPI before calling into the drivers.
win32u: Map window region DPI before calling into the drivers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6331
This allows to use DLLOVERRIDES with native DLLs, making it more convenient for testing and debugging. This will also makes it possible to create an alternative media source implementation with a different backend without breaking the current one.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6362
Motivation for values tests is to be able to test compilation output, regardless of specific binary layout.
--
v2: d3dx9/tests: Add a test for matrix majority class.
d3dx9/tests: Remove unused fields from effect values test data.
d3dx9/tests: Use explicit numeric values as expected test results.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6266
Added 32x32 icons for TTI_INFO_LARGE, TTI_WARNING_LARGE and TTI_ERROR_LARGE. User-defined icons passed through TTM_SETTITLE message are still drawn as 16x16 icons.
--
v4: explorer.exe: fix handling ballon icon flags
comctl32/tooltip: Support large standard title icons.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6317
And fix the regressions from part1.
--
v2: user32: Remove NtUserDriverCallback* kernel callbacks.
winemac: Route kernel callbacks through user32.
winex11: Route kernel callbacks through user32.
winex11: Use a UINT64 for the foreign_window_proc parameter.
winex11: Wrap x11drv_dnd_post_drop params in a struct.
winex11: Wrap x11drv_dnd_enter_event params in a struct.
winex11: Wrap x11drv_dnd_drop_event params in a struct.
opengl32: Remove unnecessary function addresses.
opengl32: Add missing WOW64 process_attach unixlib entry.
win32u: Add missing thunk lock parameters callback.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6354
Right now this should not do anything because all windows are per-monitor DPI aware. When this is changed this will automatically fall back to window surface scaling through `NtGdiStretchBlt` in win32u.
This has the disadvantage that `NtGdiStretchBlt` is doing an absolutely terrible job at upscaling. This then adds a way for drivers to opt-in and do their own surface scaling before falling back to win32u. Alternatively and perhaps better, we could pull libcairo and use it to scale the surface contents with high quality filtering instead of using GDI.
--
v4: win32u: Implement DPI scaled window surface.
win32u: Move window_surface creation helper to dce.c.
win32u: Map window rects DPI before calling into the drivers.
win32u: Map window region DPI before calling into the drivers.
win32u: Only allow a custom visible rect for toplevel windows.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6331
mlang/tests: Add test for multibyte string truncation
mlang: Fix bug when multibyte string truncation in ConvertINetMultiByteToUnicode
Signed-off-by: YeshunYe <yeyeshun(a)uniontech.com>
--
v5: mlang: Fix bad characters in MBCS of ConvertINetMultiByteToUnicode
mlang/tests: Add test for bad characters of MBCS
https://gitlab.winehq.org/wine/wine/-/merge_requests/6294
Fixes a bug where `rundll32.exe advpack.dll,DelNodeRunDLL32 "c:\test",1` is only supposed to delete "test" if the directory is empty.
Also causes the [DelDirs Inf section](https://www.mdgx.com/INF_web/deldirs.htm) to work correctly.
Notes:
- I changed the code so it ignores the result of `SetFileAttributesW` because the user might not have FILE_WRITE_ATTRIBUTES even if they have DELETE rights. This seems to match Windows (XP NTFS).
--
v4: advpack: DelNode support ADN_DEL_IF_EMPTY flag
https://gitlab.winehq.org/wine/wine/-/merge_requests/6347
Fixes a bug where `rundll32.exe advpack.dll,DelNodeRunDLL32 "c:\test",1` is only supposed to delete "test" if the directory is empty.
Also causes the [DelDirs Inf section](https://www.mdgx.com/INF_web/deldirs.htm) to work correctly.
Notes:
- I changed the code so it ignores the result of `SetFileAttributesW` because the user might not have FILE_WRITE_ATTRIBUTES even if they have DELETE rights. This seems to match Windows (XP NTFS).
--
v3: advpack: DelNode support ADN_DEL_IF_EMPTY flag
https://gitlab.winehq.org/wine/wine/-/merge_requests/6347
On Sat Aug 24 19:23:49 2024 +0000, Vibhav Pant wrote:
> Hm, the `BroadcastSystemMessage` calls wouldn't work since the
> \`DBT_BROADCAST_DEVICEINTERFACE\` struct needs to be first constructed.
> That being said, I have tried to added code that does that to 1/4. 1/4
> also shouldn't have any `DBT_DEVTYP_HANDLE` related code anymore, let me
> know if that works.
1/4 also merges the old 1/4 commit, and has been split into 2 commits - for introducing `new_event` and friends.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79915
On Sat Aug 24 19:22:08 2024 +0000, Elizabeth Figura wrote:
> Patch 1/4 still needs to be merged into 2/4.
> The BroadcastSystemMessage() calls seem to have been inadvertently
> removed in 2/4, and the split isn't quite complete—it still introduces
> DBT_DEVTYP_HANDLE support in plugplay_send_event(). Ideally separating
> the new_event() helper would also be a separate commit, so that you're
> not moving code and changing it at the same time.
Hm, the `BroadcastSystemMessage` calls wouldn't work since the \`DBT_BROADCAST_DEVICEINTERFACE\` struct needs to be first constructed. That being said, I have tried to added code that does that to 1/4. 1/4 also shouldn't have any `DBT_DEVTYP_HANDLE` related code anymore, let me know if that works.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79913
This is a heavily simplified version of Michael Müller's staging patch
(the staging version got broken by the PE/Unix split)
I rebased that staging patch but I thought it was too big for what it
does (so I did this instead)
As for automatically changing the status, SM_MEDIACENTER would require
Windows version checks (which are never used in Wine) and SM_TABLETPC
would likely require touchscreen/tablet detection (rbernon is working
on some touch stuff so that could be useful)
--
v2: win32u: Enable the media center metric by default.
win32u: Add registry key for changing tablet status.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5234
PnP device notifications/events are currently sent and received from the `plugplay` service as the raw-bytes for the `DBT_DEVTYP_DEVICEINTERFACE` struct that needs to be sent from the PnP code in `ntoskrnl.exe`. While simple, it does not support sending `DBT_DEVTYP_HANDLE` events, as they also include a `HANDLE` to the device the event comes from, which cannot simply be sent as raw bytes. This MR reworks how notifications are sent and received from the `plugplay` service, by:
1. Introducing new structs `DEVICE_BROADCAST_HANDLE` and `DEVICE_BROADCAST_DEVICEINTERFACE` in `plugplay.idl`. The structs are similar to their counterparts in `dbt.h` without the `devicetype` and `size` fields added for the header.
2. Re-write `plugplay_{send,get}_event` to use the newly added union `DEVICE_BROADCAST`, which uses the `devicetype` value as the discriminant. A deep copy of this union is then appended to the event queue of every registered listener.
3. Re-write `I_ScRegisterDeviceNotification` and `device_notify_proc` in `sechost/service.c` to use the newly added types instead. Additionally, add support for registering for `DBT_DEVTYPE_HANDLE` notifications, for which the `OBJECT_NAME_INFORMATION` value for the device `HANDLE` is used to filter notifications in order to correctly dispatch them to their registered callbacks.
4. Re-write the callbacks in `user32/input.c` to accept the `DEVICE_BROADCAST` union instead, and construct the appropriate `DEV_BROADCAST_*` struct from it, which gets sent to `SendMessageTimeoutW` as usual.
Support for `DBT_DEVTYP_HANDLE` is needed for the Bluetooth driver stack I have been working on recently, which uses `DBT_DEVTYP_HANDLE` events to notify userspace about newly found Bluetooth devices during discovery and incoming authentication requests, as documented by MS [here](https://learn.microsoft.com/en-us/windows/win32/bluetooth/bluetooth-a….
--
v30: plugplay: Add support for DBT_DEVTYP_HANDLE device notifications.
plugplay: Broadcast PnP events on a dedicated thread.
plugplay: Separate deep-copying the received event into new_event.
plugplay: Separate device broadcast event types into their own structs.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315
PnP device notifications/events are currently sent and received from the `plugplay` service as the raw-bytes for the `DBT_DEVTYP_DEVICEINTERFACE` struct that needs to be sent from the PnP code in `ntoskrnl.exe`. While simple, it does not support sending `DBT_DEVTYP_HANDLE` events, as they also include a `HANDLE` to the device the event comes from, which cannot simply be sent as raw bytes. This MR reworks how notifications are sent and received from the `plugplay` service, by:
1. Introducing new structs `DEVICE_BROADCAST_HANDLE` and `DEVICE_BROADCAST_DEVICEINTERFACE` in `plugplay.idl`. The structs are similar to their counterparts in `dbt.h` without the `devicetype` and `size` fields added for the header.
2. Re-write `plugplay_{send,get}_event` to use the newly added union `DEVICE_BROADCAST`, which uses the `devicetype` value as the discriminant. A deep copy of this union is then appended to the event queue of every registered listener.
3. Re-write `I_ScRegisterDeviceNotification` and `device_notify_proc` in `sechost/service.c` to use the newly added types instead. Additionally, add support for registering for `DBT_DEVTYPE_HANDLE` notifications, for which the `OBJECT_NAME_INFORMATION` value for the device `HANDLE` is used to filter notifications in order to correctly dispatch them to their registered callbacks.
4. Re-write the callbacks in `user32/input.c` to accept the `DEVICE_BROADCAST` union instead, and construct the appropriate `DEV_BROADCAST_*` struct from it, which gets sent to `SendMessageTimeoutW` as usual.
Support for `DBT_DEVTYP_HANDLE` is needed for the Bluetooth driver stack I have been working on recently, which uses `DBT_DEVTYP_HANDLE` events to notify userspace about newly found Bluetooth devices during discovery and incoming authentication requests, as documented by MS [here](https://learn.microsoft.com/en-us/windows/win32/bluetooth/bluetooth-a….
--
v31: plugplay: Add support for DBT_DEVTYP_HANDLE device notifications.
plugplay: Broadcast PnP events on a dedicated thread.
plugplay: Separate deep-copying the received event into new_event.
plugplay: Separate device broadcast event types into their own structs.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315
Takes advantage of linux's ID register emulation. The msr instruction is manually assembled to support older compilers and those that disallow reading e.g. SVE ID registers if unsupported by the target, even though they RAZ if unsupported.
This defines a wine-specific SMBIOS table format ontop of the standard additional processor information block to pass ID registers to wineboot. The index of each table within the SMBIOS directly maps to the core it corresponds to and registers are passed using their numerical IDs to match Windows' registry format and avoid needing to map between names and IDs on both ends (the unix side needs to manually encode the msr's anyway).
Question: would it be reasonable to add a wine/smbios.h header? I'm unsure if the duplication here is for a good reason.
--
v3: wineboot: Populate ARM64 ID register registry keys using SMBIOS info.
ntdll: Populate the SMBIOS with ARM64 ID register values.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6225
Takes advantage of linux's ID register emulation. The msr instruction is manually assembled to support older compilers and those that disallow reading e.g. SVE ID registers if unsupported by the target, even though they RAZ if unsupported.
This defines a wine-specific SMBIOS table format ontop of the standard additional processor information block to pass ID registers to wineboot. The index of each table within the SMBIOS directly maps to the core it corresponds to and registers are passed using their numerical IDs to match Windows' registry format and avoid needing to map between names and IDs on both ends (the unix side needs to manually encode the msr's anyway).
Question: would it be reasonable to add a wine/smbios.h header? I'm unsure if the duplication here is for a good reason.
--
v2: wineboot: Populate ARM64 ID register registry keys using SMBIOS info.
ntdll: Populate the SMBIOS with ARM64 ID register values.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6225
Fixes a bug where `rundll32.exe advpack.dll,DelNodeRunDLL32 "c:\test",1` is only supposed to delete "test" if the directory is empty.
Also causes the [DelDirs Inf section](https://www.mdgx.com/INF_web/deldirs.htm) to work correctly.
Notes:
- I changed the code so it ignores the result of `SetFileAttributesW` because the user might not have FILE_WRITE_ATTRIBUTES even if they have DELETE rights. This seems to match Windows (XP NTFS).
--
v2: advpack: DelNode support ADN_DEL_IF_EMPTY flag
https://gitlab.winehq.org/wine/wine/-/merge_requests/6347
Patch 1/4 still needs to be merged into 2/4.
The BroadcastSystemMessage() calls seem to have been inadvertently removed in 2/4, and the split isn't quite complete—it still introduces DBT_DEVTYP_HANDLE support in plugplay_send_event(). Ideally separating the new_event() helper would also be a separate commit, so that you're not moving code and changing it at the same time.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79797
On Thu Aug 22 19:02:16 2024 +0000, Vibhav Pant wrote:
> It might be too wordy, but what about `with_notify_registration`? I was
> initially thinking `with_hdevnotify`, but that's not very communicative either.
I think with_hdevnotify is better actually; it requires you to know what a HDEVNOTIFY is but is otherwise clear and unambiguous.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79796
IoGetDevicePropertyData is used to implement the `IOCTL_BTH_GET_DEVICE_INFO` Bluetooth IOCTL to fetch cached information for remote devices, without having to access the device extension pointer (which is arguably racy and more fragile).
--
v9: ntoskrnl/tests: Add test for getting and setting device properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6338
Fixes a bug where `rundll32.exe advpack.dll,DelNodeRunDLL32 "c:\test",1` is only supposed to delete "test" if the directory is empty.
Also causes the [DelDirs Inf section](https://www.mdgx.com/INF_web/deldirs.htm) to work correctly.
Notes:
- I changed the code so it ignores the result of `SetFileAttributesW` because the user might not have FILE_WRITE_ATTRIBUTES even if they have DELETE rights. This seems to match Windows (XP NTFS).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6347
Alexandre Julliard (@julliard) commented about dlls/mlang/mlang.c:
> default:
> if (*pcSrcSize == -1)
> *pcSrcSize = lstrlenA(pSrcStr);
> -
> + while (MultiByteToWideChar(dwEncoding, MB_ERR_INVALID_CHARS, pSrcStr, *pcSrcSize, 0, 0) == 0)
> + {
> + (*pcSrcSize)--;
> + }
This will truncate at the first invalid char, it would need a test to show that this is the correct behavior.
Also it won't do the right thing for a zero-length string.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6294#note_79775
If there are two monitors and the primary monitor is on the right side and the virtual desktop
resolution happens to be the same as the primary monitor, then the X11 desktop window will
not have window frames and show as a fullscreen window before this patch. is_desktop_fullscreen()
should check which monitor that it is on to decide whether to use fullscreen mode instead of always
checking against the primary monitor.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6346
Added 32x32 icons for TTI_INFO_LARGE, TTI_WARNING_LARGE and TTI_ERROR_LARGE. User-defined icons passed through TTM_SETTITLE message are still drawn as 16x16 icons.
--
v3: comctl32: changed tooltip icon indices to match the native library
https://gitlab.winehq.org/wine/wine/-/merge_requests/6317
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18382
If an imagelist is created and stored to a file on windows using WriteEx(ImageList_WriteEx is not implemented in WINE), and it is read using ImageList_Read(), it should still read just fine on Windows. On WINE we see the version mismatch as it was made using V6 Comctl32 and WriteEx and return -1 instead.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6343
Right now this should not do anything because all windows are per-monitor DPI aware. When this is changed this will automatically fall back to window surface scaling through `NtGdiStretchBlt` in win32u.
This has the disadvantage that `NtGdiStretchBlt` is doing an absolutely terrible job at upscaling. This then adds a way for drivers to opt-in and do their own surface scaling before falling back to win32u. Alternatively and perhaps better, we could pull libcairo and use it to scale the surface contents with high quality filtering instead of using GDI.
--
v3: win32u: Implement DPI scaled window surface.
win32u: Move window_surface creation helper to dce.c.
win32u: Map window rects DPI before calling into the drivers.
win32u: Map window region DPI before calling into the drivers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6331
--
v7: winex11: Map message pos to physical DPI in move_resize_window.
win32u: Avoid changing thread DPI context in process_hardware_message.
win32u: Factor hardware message point DPI mapping together.
win32u: Use map_window_points with explicit DPI over screen_to_client.
win32u: Split hardware message window lookup to a separate helper.
win32u: Use per-monitor DPI window_from_point in process_mouse_message.
win32u: Parameterize window_from_point dpi.
server: Pass window's per-monitor DPI in set_window_pos.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5819
After an X11 event handler queues messages to another thread, TRUE should be returned and eventually
propagated to X11DRV_ProcessEvents().
When FALSE is always returned in xrandr14_device_change_handler(), a possible hang can happen for
the desktop message queue as follows:
1. The explorer.exe calls GetMessageW() -> NtUserGetMessage() -> wait_objects() -> wait_message().
2. In wait_message(), user_driver->pProcessEvents() gets called in the desktop window thread to
handle RRNotify events and calls xrandr14_device_change_handler() -> display_mode_changed(FALSE)
-> send_message(get_desktop_window(), WM_DISPLAYCHANGE, ...) -> desktop_window_proc() ->
send_message_timeout() -> send_client_message() -> process_message() -> broadcast_message() ->
send_message_timeout() -> send_client_message() -> process_message() -> send_inter_thread_message()
-> wait_message_reply() -> a server set_queue_mask() with skip_wait being 1 -> wake_mask and
changed_mask are set to 0.
3. In wait_message(), user_driver->pProcessEvents() returns FALSE from xrandr14_device_change_handler().
So wait_message() continues to call NtWaitForMultipleObjects().
4. Now NtWaitForMultipleObjects() hangs for INFINITE timeout because wake_mask and changed_mask
for the message queue are set to 0 so the thread is not woke up.
The hang is sensitive to message ordering and only happens in this specific case so it's hard to
reproduce with tests. I believe some of the past test timeouts on TestBots can be attributed to this
bug.
--
v2: winex11.drv: Fix a possible desktop window message queue hang.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5890
On Wed Aug 21 20:50:19 2024 +0000, Elizabeth Figura wrote:
> Eh. I don't like "notify" as a noun, it's still kind of misleading. I
> guess "handle" is also ambiguous for that matter.
It might be too wordy, but what about `with_notify_registration`? I was initially thinking `with_hdevnotify`, but that's not very communicative either.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79645
IoGetDevicePropertyData is used to implement the `IOCTL_BTH_GET_DEVICE_INFO` Bluetooth IOCTL to fetch cached information for remote devices, without having to access the device extension pointer (which is arguably racy and more fragile).
--
v8: ntoskrnl/tests: Add test for getting and setting device properties.
ntoskrnl: Implement IoGetDevicePropertyData().
https://gitlab.winehq.org/wine/wine/-/merge_requests/6338
On Wed Aug 21 21:46:56 2024 +0000, Vibhav Pant wrote:
> Hm, I wasn't able to split the changes here to commits cleanly here :/.
> However, some of the functionality being separated into `new_event`
> should make the code easier to read, perhaps?
The revert + squash trick worked great. Thanks! Let me know if I can organize the commits any better.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6315#note_79639