From 4f2e87a42f994611c90a78def31c7cf94df96460 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 20 Jul 2013 12:12:13 +0000 Subject: [PATCH] [WIN32K] Modify DBG_LOGEVENT to reference the parameter variable in non-logging mode, bring back cRefs variable in GDIOBJ_vReferenceObjectByPointer svn path=/trunk/; revision=59538 --- reactos/win32ss/gdi/ntgdi/gdidebug.h | 2 +- reactos/win32ss/gdi/ntgdi/gdiobj.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/gdidebug.h b/reactos/win32ss/gdi/ntgdi/gdidebug.h index dd868a1e401..a5139687081 100644 --- a/reactos/win32ss/gdi/ntgdi/gdidebug.h +++ b/reactos/win32ss/gdi/ntgdi/gdidebug.h @@ -47,7 +47,7 @@ VOID NTAPI DbgPrintEvent(PLOGENTRY pLogEntry); #define DBG_DUMP_EVENT_LIST(pslh) DbgDumpEventList(pslh) #define DBG_CLEANUP_EVENT_LIST(pslh) DbgCleanupEventList(pslh) #else -#define DBG_LOGEVENT(pslh, type, val) +#define DBG_LOGEVENT(pslh, type, val) ((void)(val)) #define DBG_INITLOG(pslh) #define DBG_DUMP_EVENT_LIST(pslh) #define DBG_CLEANUP_EVENT_LIST(pslh) diff --git a/reactos/win32ss/gdi/ntgdi/gdiobj.c b/reactos/win32ss/gdi/ntgdi/gdiobj.c index 2401d15875a..a5d75bba98c 100644 --- a/reactos/win32ss/gdi/ntgdi/gdiobj.c +++ b/reactos/win32ss/gdi/ntgdi/gdiobj.c @@ -570,18 +570,20 @@ VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj) { + ULONG cRefs; + /* Check if the object has a handle */ if (GDI_HANDLE_GET_INDEX(pobj->hHmgr)) { /* Increase the handle's reference count */ ULONG ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr); ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0); - InterlockedIncrement((LONG*)&gpaulRefCount[ulIndex]); + cRefs = InterlockedIncrement((LONG*)&gpaulRefCount[ulIndex]); } else { /* Increase the object's reference count */ - InterlockedIncrement((LONG*)&pobj->ulShareCount); + cRefs = InterlockedIncrement((LONG*)&pobj->ulShareCount); } DBG_LOGEVENT(&pobj->slhLog, EVENT_REFERENCE, cRefs); -- 2.17.1