[NTOS:KE:X64] Implement flushing the GDI batch

This commit is contained in:
Timo Kreuzer 2019-05-28 11:06:56 +02:00
parent c86c55ace7
commit fbdff437fd

View file

@ -432,6 +432,28 @@ KiSystemCallHandler(
Offset = (ServiceNumber >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK;
ServiceNumber &= SERVICE_NUMBER_MASK;
/* Check for win32k system calls */
if (Offset & SERVICE_TABLE_TEST)
{
ULONG GdiBatchCount;
/* Read the GDI batch count from the TEB */
_SEH2_TRY
{
GdiBatchCount = NtCurrentTeb()->GdiBatchCount;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
GdiBatchCount = 0;
}
/* Flush batch, if there are entries */
if (GdiBatchCount != 0)
{
KeGdiFlushUserBatch();
}
}
/* Get descriptor table */
DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset);