https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4624f32f37c0855d6694672e2fe9719b312ac36

commit b4624f32f37c0855d6694672e2fe9719b312ac36
Author:     James Tabor <[email protected]>
AuthorDate: Thu Mar 14 12:00:53 2019 -0500
Commit:     James Tabor <[email protected]>
CommitDate: Thu Mar 14 12:00:53 2019 -0500

    [GDI32] Fix issue after a Flush
    
    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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/win32ss/gdi/gdi32/include/gdi32p.h 
b/win32ss/gdi/gdi32/include/gdi32p.h
index f0b4cb46d9..03ce3afcf8 100644
--- a/win32ss/gdi/gdi32/include/gdi32p.h
+++ b/win32ss/gdi/gdi32/include/gdi32p.h
@@ -409,6 +409,12 @@ GdiAllocBatchCommand(
         /* 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 */

Reply via email to