[GDI32] Fix issue after a Flush
authorJames Tabor <james.tabor@reactos.org>
Thu, 14 Mar 2019 17:00:53 +0000 (12:00 -0500)
committerJames Tabor <james.tabor@reactos.org>
Thu, 14 Mar 2019 17:00:53 +0000 (12:00 -0500)
While flushing the DC handle goes down with the flush. This was not a
regression, just untested old code.

win32ss/gdi/gdi32/include/gdi32p.h

index f0b4cb4..03ce3af 100644 (file)
@@ -409,6 +409,12 @@ GdiAllocBatchCommand(
         /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
            the current batch */
         NtGdiFlush();
         /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
            the current batch */
         NtGdiFlush();
+
+        // If Flushed, lose the hDC for this batch job! See CORE-15839.
+        if (hdc)
+        {
+            if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
+        }
     }
 
     /* Get the head of the entry */
     }
 
     /* Get the head of the entry */