[WIN32K]
[reactos.git] / reactos / win32ss / user / ntuser / object.c
index 01964de..321d90f 100644 (file)
@@ -710,14 +710,15 @@ UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner)
             return;
     }
 
-    oldppi->UserHandleCount--;
-    IntDereferenceProcessInfo(oldppi);
-    ppi->UserHandleCount++;
-    IntReferenceProcessInfo(ppi);
 #if DBG
     oldppi->DbgHandleCount[type]--;
     ppi->DbgHandleCount[type]++;
 #endif
+
+    oldppi->UserHandleCount--;
+    IntDereferenceProcessInfo(oldppi);
+    ppi->UserHandleCount++;
+    IntReferenceProcessInfo(ppi);
 }
 
 BOOLEAN