From ca4c2640e78207592ca8b5d0976c324228a1a0c0 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Mon, 20 Feb 2017 10:10:37 +0000 Subject: [PATCH] [WIN32K] - Don't try to delete the pattern bitmap in UserInitialize. - Set the correct owner before deleting the update region in co_UserFreeWindow. - Fixes some "Trying to delete global object" debug prints. svn path=/trunk/; revision=73855 --- reactos/win32ss/user/ntuser/ntuser.c | 3 +-- reactos/win32ss/user/ntuser/window.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/ntuser.c b/reactos/win32ss/user/ntuser/ntuser.c index 275479c7b9c..d86e5634869 100644 --- a/reactos/win32ss/user/ntuser/ntuser.c +++ b/reactos/win32ss/user/ntuser/ntuser.c @@ -154,9 +154,8 @@ UserInitialize(VOID) if (hPattern55AABitmap == NULL) return STATUS_INSUFFICIENT_RESOURCES; - //NT_VERIFY(GreSetBitmapOwner(hPattern55AABitmap, GDI_OBJ_HMGR_PUBLIC)); gpsi->hbrGray = IntGdiCreatePatternBrush(hPattern55AABitmap); - GreDeleteObject(hPattern55AABitmap); + if (gpsi->hbrGray == NULL) return STATUS_INSUFFICIENT_RESOURCES; } diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 7b7fb72ec7f..861b26625cf 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -602,6 +602,7 @@ LRESULT co_UserFreeWindow(PWND Window, MsqDecPaintCountQueue(Window->head.pti); if (Window->hrgnUpdate > HRGN_WINDOW && GreIsHandleValid(Window->hrgnUpdate)) { + IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED); GreDeleteObject(Window->hrgnUpdate); } Window->hrgnUpdate = NULL; -- 2.17.1