Module: wine
Branch: master
Commit: ab3416c61fb17207e0831f7709da4d2911b07fb2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ab3416c61fb17207e0831f77…
Author: Simon McVittie <smcv(a)collabora.com>
Date: Wed Oct 20 11:07:27 2021 +0200
winebus.sys: Add code path to bypass udevd and use inotify.
In a container with a non-trivial user namespace, we cannot rely on
libudev communicating with udevd as a way to monitor device nodes,
for the following reasons:
* If uid 0 from the host is not mapped to uid 0 in the container, libudev
cannot authenticate netlink messages from the host, because their sender
uid appears to be the overflowuid. Resolving this by mapping uid 0 into
the container is not allowed when creating user namespaces as an
unprivileged user, and even when running as a privileged user, it might
be desirable for the real uid 0 to not be mapped as a way to harden the
security boundary between container and host.
* Depending on the container configuration, initial enumeration might
not be able to read /run/udev from the host system. If it can't, sysfs
attributes will still work because those are read directly from the
kernel via sysfs, but udev properties coming from user-space rules
(in particular ID_INPUT_JOYSTICK and friends) will appear to be missing.
* The protocols between udevd and libudev (netlink messages for monitoring,
and /run/udev for initial enumeration) are considered to be private to
a particular version of udev, and are not a stable API; but in a
container, we cannot expect that our copy of libudev is at exactly the
same version as udevd on the host system.
Sidestep this by adding a code path that continues to use libudev for
the parts that work regardless of whether udevd is running or can be
communicated with.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winebus.sys/bus_udev.c | 276 ++++++++++++++++++++++++++++++++++++++++++--
dlls/winebus.sys/main.c | 2 +
dlls/winebus.sys/unixlib.h | 1 +
3 files changed, 268 insertions(+), 11 deletions(-)
Diff: https://source.winehq.org/git/wine.git/?a=commitdiff;h=ab3416c61fb17207e083…
Module: wine
Branch: master
Commit: 22dae167d326036ef3b91eb1d5c45acdaa89eb0c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=22dae167d326036ef3b91eb1…
Author: Simon McVittie <smcv(a)collabora.com>
Date: Wed Oct 20 11:07:26 2021 +0200
winebus.sys: Treat udev actions other than "remove" as "add".
As per https://github.com/systemd/systemd/blob/v247-rc1/NEWS#L5
there are more kernel uevent types than just "add" and "remove",
and we should be treating everything other than "remove" as being
potentially an "add".
To cope with this, try_add_device() now checks whether the same device
was already added. If so, we ignore it.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winebus.sys/bus_udev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 1dfce05e4bc..57e5a169a69 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -1404,16 +1404,14 @@ static void process_monitor_event(struct udev_monitor *monitor)
if (!action)
WARN("No action received\n");
- else if (strcmp(action, "add") == 0)
+ else if (strcmp(action, "remove"))
udev_add_device(dev);
- else if (strcmp(action, "remove") == 0)
+ else
{
impl = find_device_from_udev(dev);
if (impl) bus_event_queue_device_removed(&event_queue, &impl->unix_device);
else WARN("failed to find device for udev device %p\n", dev);
}
- else
- WARN("Unhandled action %s\n", debugstr_a(action));
udev_device_unref(dev);
}
Module: wine
Branch: master
Commit: 8892b79118fde5f2307ecbbdb03a8d0c489c8b3d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8892b79118fde5f2307ecbbd…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com>
Date: Wed Oct 20 10:07:59 2021 +0800
user32: Change the position and size of layered windows before flushing their surfaces.
When UpdateLayeredWindow() is called to paint a window and update its
size, USER_Driver->pUpdateLayeredWindow() needs to be called after the
window position and size are updated. Otherwise, UpdateLayeredWindow()
may flush the painted content to a smaller window and then enlarge it,
losing the painted result.
Fix Word 2016 window frame corruption after restoring from maximized state.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/user32/win.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index e07b7d39e4b..4d0240f21a8 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -4134,10 +4134,8 @@ BOOL WINAPI UpdateLayeredWindowIndirect( HWND hwnd, const UPDATELAYEREDWINDOWINF
TRACE( "window %p win %s client %s\n", hwnd,
wine_dbgstr_rect(&window_rect), wine_dbgstr_rect(&client_rect) );
- if (!USER_Driver->pUpdateLayeredWindow( hwnd, info, &window_rect )) return FALSE;
-
set_window_pos( hwnd, 0, flags, &window_rect, &client_rect, NULL );
- return TRUE;
+ return USER_Driver->pUpdateLayeredWindow( hwnd, info, &window_rect );
}