[WIN32SS:GDI] Add a sanity assert
[reactos.git] / win32ss / gdi / eng / pdevobj.c
index 450d37f..a9f959b 100644 (file)
@@ -15,7 +15,7 @@ PPDEVOBJ gppdevPrimary = NULL;
 static PPDEVOBJ gppdevList = NULL;
 static HSEMAPHORE ghsemPDEV;
 
-INIT_FUNCTION
+CODE_SEG("INIT")
 NTSTATUS
 NTAPI
 InitPDEVImpl(VOID)
@@ -365,6 +365,7 @@ EngpCreatePDEV(
     }
     else
     {
+        ASSERT(gpPrimaryGraphicsDevice);
         pGraphicsDevice = gpPrimaryGraphicsDevice;
     }
 
@@ -630,7 +631,7 @@ EngpGetPDEV(
     if (ppdev)
     {
         /* Yes, reference the PDEV */
-        InterlockedIncrement(&ppdev->cPdevRefs);
+        PDEVOBJ_vReference(ppdev);
     }
     else
     {