* Sync to trunk HEAD (r53473).
[reactos.git] / subsystems / win32 / win32k / ntuser / windc.c
index a225e52..568fb37 100644 (file)
@@ -11,8 +11,7 @@
 
 #include <win32k.h>
 
-#define NDEBUG
-#include <debug.h>
+DBG_DEFAULT_CHANNEL(UserDce);
 
 int FASTCALL CLIPPING_UpdateGCRegion(DC* Dc);
 
@@ -94,7 +93,7 @@ DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type)
       return NULL;
   }
   DCECount++;
-  DPRINT("Alloc DCE's! %d\n",DCECount);
+  TRACE("Alloc DCE's! %d\n",DCECount);
   pDce->hwndCurrent = (Window ? Window->head.h : NULL);
   pDce->pwndOrg  = Window;
   pDce->pwndClip = Window;
@@ -113,7 +112,7 @@ DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type)
   }
   else
   {
-     DPRINT("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC);
+     TRACE("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC);
      GreSetDCOwner(pDce->hDC, GDI_OBJ_HMGR_NONE);
      pDce->ptiOwner = NULL;
   }
@@ -225,7 +224,7 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
          }
       }
       dce->DCXFlags &= ~DCX_DCEBUSY;
-      DPRINT("Exit!!!!! DCX_CACHE!!!!!!   hDC-> %x \n", dce->hDC);
+      TRACE("Exit!!!!! DCX_CACHE!!!!!!   hDC-> %x \n", dce->hDC);
       if (!GreSetDCOwner(dce->hDC, GDI_OBJ_HMGR_NONE))
          return 0;
       dce->ptiOwner = NULL; // Reset ownership.
@@ -372,7 +371,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
             else
             {
                if (Wnd->pcls->pdce) hDC = ((PDCE)Wnd->pcls->pdce)->hDC;
-               DPRINT("We have CLASS!!\n");
+               TRACE("We have CLASS!!\n");
             }
          }
 /*         else // For Testing!
@@ -524,7 +523,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
 
    if (!GreIsHandleValid(Dce->hDC))
    {
-      DPRINT1("FIXME: Got DCE with invalid hDC! 0x%x\n", Dce->hDC);
+      ERR("FIXME: Got DCE with invalid hDC! 0x%x\n", Dce->hDC);
       Dce->hDC = DceCreateDisplayDC();
       /* FIXME: Handle error */
    }
@@ -568,7 +567,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
    {
       if (Dce->hrgnClip != NULL)
       {
-         DPRINT1("Should not be called!!\n");
+         ERR("Should not be called!!\n");
          GreDeleteObject(Dce->hrgnClip);
          Dce->hrgnClip = NULL;
       }
@@ -581,7 +580,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
 
    if (Dce->DCXFlags & DCX_CACHE)
    {
-      DPRINT("ENTER!!!!!! DCX_CACHE!!!!!!   hDC-> %x\n", Dce->hDC);
+      TRACE("ENTER!!!!!! DCX_CACHE!!!!!!   hDC-> %x\n", Dce->hDC);
       // Need to set ownership so Sync dcattr will work.
       GreSetDCOwner(Dce->hDC, GDI_OBJ_HMGR_POWNED);
       Dce->ptiOwner = GetW32ThreadInfo(); // Set the temp owning
@@ -625,7 +624,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
   if (Force &&
       GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED)
   {
-     DPRINT("Change ownership for DCE! -> %x\n" , pdce);
+     TRACE("Change ownership for DCE! -> %x\n" , pdce);
      // Note: Windows sets W32PF_OWNDCCLEANUP and moves on.
      if (GreIsHandleValid(pdce->hDC))
      {
@@ -633,7 +632,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
      }
      else
      {
-         DPRINT1("Attempted to change ownership of an DCEhDC 0x%x currently being destroyed!!!\n",pdce->hDC);
+         ERR("Attempted to change ownership of an DCEhDC 0x%x currently being destroyed!!!\n",pdce->hDC);
          Hit = TRUE;
      }
   }
@@ -655,14 +654,14 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
 
   if (IsListEmpty(&pdce->List))
   {
-      DPRINT1("List is Empty! DCE! -> %x\n" , pdce);
+      ERR("List is Empty! DCE! -> %x\n" , pdce);
       return NULL;
   }
 
   ExFreePoolWithTag(pdce, USERTAG_DCE);
 
   DCECount--;
-  DPRINT("Freed DCE's! %d \n", DCECount);
+  TRACE("Freed DCE's! %d \n", DCECount);
 
   return ret;
 }
@@ -680,7 +679,7 @@ DceFreeWindowDCE(PWND Window)
 
   if (DCECount <= 0)
   {
-     DPRINT1("FreeWindowDCE No Entry! %d\n",DCECount);
+     ERR("FreeWindowDCE No Entry! %d\n",DCECount);
      return;
   }
 
@@ -690,12 +689,12 @@ DceFreeWindowDCE(PWND Window)
   {
      if (!pDCE)
      {
-        DPRINT1("FreeWindowDCE No DCE Pointer!\n");
+        ERR("FreeWindowDCE No DCE Pointer!\n");
         break;
      }
      if (IsListEmpty(&pDCE->List))
      {
-        DPRINT1("FreeWindowDCE List is Empty!!!!\n");
+        ERR("FreeWindowDCE List is Empty!!!!\n");
         break;
      }
      if ( pDCE->hwndCurrent == Window->head.h &&
@@ -713,10 +712,10 @@ DceFreeWindowDCE(PWND Window)
               pDCE->DCXFlags = DCX_DCEEMPTY|DCX_CACHE;
               pDCE->hwndCurrent = 0;
 
-              DPRINT("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %x \n", pDCE->hDC);
+              TRACE("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %x \n", pDCE->hDC);
               if (!GreSetDCOwner( pDCE->hDC, GDI_OBJ_HMGR_NONE))
               {
-                  DPRINT1("Fail Owner Switch hDC-> %x \n", pDCE->hDC);
+                  ERR("Fail Owner Switch hDC-> %x \n", pDCE->hDC);
                   break;
               }
               /* Do not change owner so thread can clean up! */
@@ -729,7 +728,7 @@ DceFreeWindowDCE(PWND Window)
            }
            else
            {
-              DPRINT1("Not POWNED or CLASSDC hwndCurrent -> %x \n", pDCE->hwndCurrent);
+              ERR("Not POWNED or CLASSDC hwndCurrent -> %x \n", pDCE->hwndCurrent);
               // ASSERT(FALSE); /* bug 5320 */
            }
         }
@@ -738,13 +737,13 @@ DceFreeWindowDCE(PWND Window)
            if (pDCE->DCXFlags & DCX_DCEBUSY) /* shared cache DCE */
            {
               /* FIXME: AFAICS we are doing the right thing here so
-               * this should be a DPRINT. But this is best left as an ERR
+               * this should be a TRACE. But this is best left as an ERR
                * because the 'application error' is likely to come from
                * another part of Wine (i.e. it's our fault after all).
-               * We should change this to DPRINT when ReactOS is more stable
+               * We should change this to TRACE when ReactOS is more stable
                * (for 1.0?).
                */
-              DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
+              ERR("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
               DceReleaseDC(pDCE, FALSE);
            }
            pDCE->DCXFlags |= DCX_DCEEMPTY;
@@ -944,7 +943,7 @@ UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
   INT nRet = 0;
   BOOL Hit = FALSE;
 
-  DPRINT("%p %p\n", Window, hDc);
+  TRACE("%p %p\n", Window, hDc);
   pLE = LEDce.Flink;
   dce = CONTAINING_RECORD(pLE, DCE, List);
   do
@@ -1001,7 +1000,7 @@ NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
   PWND Wnd=NULL;
   DECLARE_RETURN(HDC);
 
-  DPRINT("Enter NtUserGetDCEx\n");
+  TRACE("Enter NtUserGetDCEx\n");
   UserEnterExclusive();
 
   if (hWnd && !(Wnd = UserGetWindowObject(hWnd)))
@@ -1011,7 +1010,7 @@ NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
   RETURN( UserGetDCEx(Wnd, ClipRegion, Flags));
 
 CLEANUP:
-  DPRINT("Leave NtUserGetDCEx, ret=%i\n",_ret_);
+  TRACE("Leave NtUserGetDCEx, ret=%i\n",_ret_);
   UserLeave();
   END_CLEANUP;
 }
@@ -1037,7 +1036,7 @@ NtUserGetWindowDC(HWND hWnd)
 HDC APIENTRY
 NtUserGetDC(HWND hWnd)
 {
DPRINT("NtUGetDC -> %x:%x\n", hWnd, !hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE );
TRACE("NtUGetDC -> %x:%x\n", hWnd, !hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE );
 
   return NtUserGetDCEx(hWnd, NULL, NULL == hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE);
 }