From 4818f65c04d83b67a29f8f58db682050b07d7f1a Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Sun, 12 Jan 2020 14:54:10 -0600 Subject: [PATCH] user.exe16: Releasing DC does not disable it. ReleaseDC in user32 marks cache DCs as disabled. For user.exe (the 16-bit equivalent), this causes DCs to become inaccessible after release. On Windows, they are still accessible after release. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44408 Signed-off-by: Jeff Smith Signed-off-by: Alexandre Julliard (cherry picked from commit 0778945e34968c66ccbe8a8be1f9749b8383f55e) Signed-off-by: Michael Stefaniuc --- dlls/user.exe16/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/user.exe16/window.c b/dlls/user.exe16/window.c index 10f1389f0a7..bf86719325b 100644 --- a/dlls/user.exe16/window.c +++ b/dlls/user.exe16/window.c @@ -23,6 +23,7 @@ #include "user_private.h" #include "wine/list.h" #include "wine/server.h" +#include "wine/gdi_driver.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(win); @@ -675,7 +676,9 @@ HDC16 WINAPI GetWindowDC16( HWND16 hwnd ) */ INT16 WINAPI ReleaseDC16( HWND16 hwnd, HDC16 hdc ) { - return (INT16)ReleaseDC( WIN_Handle32(hwnd), HDC_32(hdc) ); + INT16 ret = (INT16)ReleaseDC( WIN_Handle32(hwnd), HDC_32(hdc) ); + SetHookFlags( HDC_32(hdc), DCHF_ENABLEDC ); + return ret; }