[ros-diffs] [jimtabor] 29394: Fixed an old typo bug from rev 3450 by dwelch. Add support for DCX_NORESETATTRS and fixed up IntWindowFromDC.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Fri Oct 5 08:47:43 CEST 2007


Author: jimtabor
Date: Fri Oct  5 10:47:42 2007
New Revision: 29394

URL: http://svn.reactos.org/svn/reactos?rev=29394&view=rev
Log:
Fixed an old typo bug from rev 3450 by dwelch. Add support for DCX_NORESETATTRS and fixed up IntWindowFromDC.

Modified:
    trunk/reactos/subsystems/win32/win32k/ntuser/windc.c

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/windc.c?rev=29394&r1=29393&r2=29394&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Fri Oct  5 10:47:42 2007
@@ -248,22 +248,25 @@
 
    if (dce->DCXFlags & DCX_CACHE)
    {
-      /* make the DC clean so that SetDCState doesn't try to update the vis rgn */
-      IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
-
-      PDC dc = DC_LockDc ( dce->hDC );
-      IntGdiCopyFromSaveState(dc, defaultDCstate, dce->hDC ); // Was SetDCState.
-
-      dce->DCXFlags &= ~DCX_DCEBUSY;
-      if (dce->DCXFlags & DCX_DCEDIRTY)
-      {
+     if (!(dce->DCXFlags & DCX_NORESETATTRS))
+     {
+       /* make the DC clean so that SetDCState doesn't try to update the vis rgn */
+       IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
+
+       PDC dc = DC_LockDc ( dce->hDC );
+       IntGdiCopyFromSaveState(dc, defaultDCstate, dce->hDC ); // Was SetDCState.
+
+       dce->DCXFlags &= ~DCX_DCEBUSY;
+       if (dce->DCXFlags & DCX_DCEDIRTY)
+       {
          /* don't keep around invalidated entries
           * because SetDCState() disables hVisRgn updates
           * by removing dirty bit. */
          dce->hwndCurrent = 0;
          dce->DCXFlags &= DCX_CACHE;
          dce->DCXFlags |= DCX_DCEEMPTY;
-      }
+       }
+     }
    }
    return 1;
 }
@@ -400,7 +403,7 @@
    if (Flags & DCX_NOCLIPCHILDREN)
    {
       Flags |= DCX_CACHE;
-      Flags |= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
+      Flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
    }
 
    if (Flags & DCX_WINDOW)
@@ -475,6 +478,12 @@
       {
          UpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
       }
+      else
+      {
+      /* we should free dce->clip_rgn here, but Windows apparently doesn't */
+         Dce->DCXFlags &= ~(DCX_EXCLUDERGN | DCX_INTERSECTRGN);
+         Dce->hClipRgn = NULL;
+      }
 #if 1 /* FIXME */
       UpdateVisRgn = TRUE;
 #endif
@@ -592,17 +601,18 @@
 IntWindowFromDC(HDC hDc)
 {
    DCE *Dce;
+   HWND Ret = NULL;
    KeEnterCriticalRegion();
    for (Dce = FirstDce; Dce != NULL; Dce = Dce->next)
    {
       if(Dce->hDC == hDc)
       {
-         KeLeaveCriticalRegion();
-         return Dce->hwndCurrent;
+         Ret = Dce->hwndCurrent;
+         break;
       }
    }
    KeLeaveCriticalRegion();
-   return 0;
+   return Ret;
 }
 
 




More information about the Ros-diffs mailing list