From 440c35e96058edcf9c1bc0e331c1498a6a9d7608 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 23 Mar 2010 01:34:30 +0000 Subject: [PATCH] - Hack fix for gdibatch, please retest Acrobat reader 7. svn path=/trunk/; revision=46349 --- .../win32/win32k/objects/gdibatch.c | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/gdibatch.c b/reactos/subsystems/win32/win32k/objects/gdibatch.c index b0c8ec9a1e0..bbc36ff6e6b 100644 --- a/reactos/subsystems/win32/win32k/objects/gdibatch.c +++ b/reactos/subsystems/win32/win32k/objects/gdibatch.c @@ -72,7 +72,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) { pdcattr = dc->pdcattr; } - // The thread is approaching the end of sunset. + // FYI! The thread is approaching the end of sunset. switch(pHdr->Cmd) { case GdiBCPatBlt: // Highest pri first! @@ -139,6 +139,7 @@ NTSTATUS APIENTRY NtGdiFlushUserBatch(VOID) { + BOOL Hit; PTEB pTeb = NtCurrentTeb(); ULONG GdiBatchCount = pTeb->GdiBatchCount; @@ -160,8 +161,26 @@ NtGdiFlushUserBatch(VOID) } // No need to init anything, just go! - for (; GdiBatchCount > 0; GdiBatchCount--) - { + for (Hit = FALSE; GdiBatchCount > 0; GdiBatchCount--) + { /* + Looks like a hack, + feels like a hack, + you're right it's a hack, + due to the lack, + of kernel thread locking when it is in sunset! + */ + _SEH2_TRY + { + ((PGDIBATCHHDR)pHdr)->Cmd = ((PGDIBATCHHDR)pHdr)->Cmd; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Hit = TRUE; + } + _SEH2_END; + + if (Hit) break; + // Process Gdi Batch! pHdr += GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr); }