[ros-diffs] [jimtabor] 30145: Allow batch flush to handle null DCs.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Mon Nov 5 03:25:44 CET 2007


Author: jimtabor
Date: Mon Nov  5 05:25:43 2007
New Revision: 30145

URL: http://svn.reactos.org/svn/reactos?rev=30145&view=rev
Log:
Allow batch flush to handle null DCs.

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

Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c?rev=30145&r1=30144&r2=30145&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c Mon Nov  5 05:25:43 2007
@@ -18,9 +18,9 @@
 FASTCALL
 GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
 {
-  PDC dc = DC_LockDc(hDC);
-  if (!dc) return 0;
-  // The thread is on the end of sunset.
+  PDC dc = NULL;
+  if (hDC) dc = DC_LockDc(hDC);
+  // The thread is approaching the end of sunset.
   switch(pHdr->Cmd)
   {
      case GdiBCPatBlt: // Highest pri first!
@@ -33,6 +33,7 @@
         break;
      case GdiBCSetBrushOrg:
      {
+        if (!dc) break;
         PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG) pHdr;
         dc->Dc_Attr.ptlBrushOrigin = pgSBO->ptlBrushOrigin;
         break;
@@ -49,10 +50,9 @@
         break;
      }
      default:
-       DC_UnlockDc(dc);
-       return 0;
+        break;
   }
-  DC_UnlockDc(dc);
+  if (dc) DC_UnlockDc(dc);
   return pHdr->Size; // Return the full size of the structure.
 }
 




More information about the Ros-diffs mailing list