[ros-diffs] [greatlrd] 27768: patch from : Paolo Devoti (email devotip at tiscali dot it) ----------------------------------------------------------- Fixed right hdc being save/restore , the #if 0 change was not accpected. the code works fine without it. it was problare cause by another bug. all wine test for gdi32_winetest dc pass now, without any foualt. See issue #2055 for more details.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sat Jul 21 20:41:07 CEST 2007


Author: greatlrd
Date: Sat Jul 21 22:41:06 2007
New Revision: 27768

URL: http://svn.reactos.org/svn/reactos?rev=27768&view=rev
Log:
patch from : Paolo Devoti (email devotip at tiscali dot it)
-----------------------------------------------------------
Fixed right hdc being save/restore , the #if 0 change was not accpected. 
the code works fine without it. it was problare cause by another bug.
all wine test for gdi32_winetest dc pass now, without any foualt. 
See issue #2055 for more details.

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/dc.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dc.c?rev=27768&r1=27767&r2=27768&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sat Jul 21 22:41:06 2007
@@ -1811,42 +1811,44 @@
     return FALSE;
   }
 
-  if(abs(SaveLevel) > dc->saveLevel || SaveLevel == 0)
+  if (SaveLevel < 0)
+      SaveLevel = dc->saveLevel + SaveLevel + 1;
+
+  if(SaveLevel < 0 || dc->saveLevel<SaveLevel)
   {
     DC_UnlockDc(dc);
     return FALSE;
   }
-
-  /* FIXME this calc are not 100% correct I think ??*/
-  if (SaveLevel < 0) SaveLevel = dc->saveLevel + SaveLevel + 1;
   
   success=TRUE;
   while (dc->saveLevel >= SaveLevel)
   {
      HDC hdcs = DC_GetNextDC (dc);
 
-	 dcs = DC_LockDc (hdcs);
+     dcs = DC_LockDc (hdcs);
      if (dcs == NULL)
      {
         DC_UnlockDc(dc);
         return FALSE;
      }
 
-	 DC_SetNextDC (dc, DC_GetNextDC (dcs));
-	 dcs->hNext = 0;
-		 
-	 if (--dc->saveLevel < SaveLevel)
-	 {
-		 DC_UnlockDc( dc );
+     DC_SetNextDC (dc, DC_GetNextDC (dcs));
+     dcs->hNext = 0;
+
+     if (--dc->saveLevel < SaveLevel)
+     {
+         DC_UnlockDc( dc );
          DC_UnlockDc( dcs );
 
-	     NtGdiSetDCState(hDC, hdcs);
-         //if (!PATH_AssignGdiPath( &dc->path, &dcs->path ))
-		 /* FIXME: This might not be quite right, since we're 
-		  * returning FALSE but still destroying the saved DC state 
-		  */
-	     success=FALSE;
-	     dc = DC_LockDc(hDC);
+         NtGdiSetDCState(hDC, hdcs);
+
+        if (!PATH_AssignGdiPath( &dc->w.path, &dcs->w.path ))
+        {
+          /* FIXME: This might not be quite right, since we're
+           * returning FALSE but still destroying the saved DC state */
+          success = FALSE;
+        }
+         dc = DC_LockDc(hDC);
          if(!dc)
          {
             return FALSE;




More information about the Ros-diffs mailing list