diff --git a/reactos/lib/gdi32/objects/dc.c b/reactos/lib/gdi32/objects/dc.c index 09c0f879f57..b6c901fe9e0 100644 --- a/reactos/lib/gdi32/objects/dc.c +++ b/reactos/lib/gdi32/objects/dc.c @@ -8,6 +8,8 @@ #include #include +#define NDEBUG +#include /* * @implemented @@ -555,11 +557,15 @@ SetWindowOrgEx( */ BOOL STDCALL -DeleteObject( - HGDIOBJ a0 - ) +DeleteObject(HGDIOBJ Obj) { - return NtGdiDeleteObject(a0); + if (0 != ((DWORD) Obj & 0x00800000)) + { + DPRINT1("Trying to delete system object 0x%x\n", Obj); + return FALSE; + } + + return NtGdiDeleteObject(Obj); }