=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Avoid accessing the device after minimize in ddraw.
Alexandre Julliard
julliard at winehq.org
Mon Oct 15 16:15:28 CDT 2018
Module: wine
Branch: master
Commit: 7a36efc3bc37a13c5ec9b914e5a233cc5e0b9608
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7a36efc3bc37a13c5ec9b914e5a233cc5e0b9608
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sat Oct 13 16:13:52 2018 -0700
wined3d: Avoid accessing the device after minimize in ddraw.
Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/swapchain.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 9c48de2..5cca4be 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -1132,13 +1132,15 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
{
struct wined3d_device *device = swapchain->device;
BOOL filter_messages = device->filter_messages;
+ BOOL focus_messages = device->wined3d->flags & WINED3D_FOCUS_MESSAGES;
/* This code is not protected by the wined3d mutex, so it may run while
* wined3d_device_reset is active. Testing on Windows shows that changing
* focus during resets and resetting during focus change events causes
* the application to crash with an invalid memory access. */
- device->filter_messages = !(device->wined3d->flags & WINED3D_FOCUS_MESSAGES);
+ if (!focus_messages)
+ device->filter_messages = 1;
if (activate)
{
@@ -1190,7 +1192,8 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
ShowWindow(swapchain->device_window, SW_MINIMIZE);
}
- device->filter_messages = filter_messages;
+ if (!focus_messages)
+ device->filter_messages = filter_messages;
}
HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapchain, unsigned int buffer_count,
More information about the wine-cvs
mailing list