From 1d020c54d96573ff6b06d1dee79b0477692a5172 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Mon, 19 May 2008 20:27:48 +0000 Subject: [PATCH] - Ugly hack about corrupted KernelData pointer, which is being accessed. Hacks around bugs like bug 2954. See issue #2954 for more details. svn path=/trunk/; revision=33601 --- reactos/subsystems/win32/win32k/objects/gdiobj.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 328458c420a..2f4a600e89a 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -720,6 +720,16 @@ LockHandle: { DPRINT1("Attempted to free global gdi handle 0x%x, caller needs to get ownership first!!!\n", hObj); DPRINT1("Type = 0x%lx, KernelData = 0x%p, ProcessId = 0x%p\n", Entry->Type, Entry->KernelData, Entry->ProcessId); + + /* HACK: Ugly and nasty */ + if ((ULONG_PTR)Entry->KernelData < 0x1000) + { + /* It's a memory-corruption bug (probably?), + overcome it by just saying "yes, object destroyed" */ + DPRINT1("Bad kerneldata!!! Blame Win32k developers!\n"); + return TRUE; + } + } else {