mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:23:34 +00:00
[GDI32]
Improve GdiAllocBatchCommand formatting and fix MSVC warnings svn path=/trunk/; revision=53708
This commit is contained in:
parent
19b8dfac16
commit
679d1e828c
1 changed files with 15 additions and 37 deletions
|
@ -298,7 +298,7 @@ GdiAllocBatchCommand(
|
||||||
USHORT Cmd)
|
USHORT Cmd)
|
||||||
{
|
{
|
||||||
PTEB pTeb;
|
PTEB pTeb;
|
||||||
ULONG ulSize;
|
USHORT cjSize;
|
||||||
PGDIBATCHHDR pHdr;
|
PGDIBATCHHDR pHdr;
|
||||||
|
|
||||||
/* Get a pointer to the TEB */
|
/* Get a pointer to the TEB */
|
||||||
|
@ -318,45 +318,23 @@ GdiAllocBatchCommand(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the size of the entry */
|
/* Get the size of the entry */
|
||||||
switch(Cmd)
|
if (Cmd == GdiBCPatBlt) cjSize = 0;
|
||||||
{
|
else if (Cmd == GdiBCPolyPatBlt) cjSize = 0;
|
||||||
case GdiBCPatBlt:
|
else if (Cmd == GdiBCTextOut) cjSize = 0;
|
||||||
ulSize = 0;
|
else if (Cmd == GdiBCExtTextOut) cjSize = 0;
|
||||||
break;
|
else if (Cmd == GdiBCSetBrushOrg) cjSize = 0;
|
||||||
case GdiBCPolyPatBlt:
|
else if (Cmd == GdiBCExtSelClipRgn) cjSize = 0;
|
||||||
ulSize = 0;
|
else if (Cmd == GdiBCSelObj) cjSize = sizeof(GDIBSOBJECT);
|
||||||
break;
|
else if (Cmd == GdiBCDelRgn) cjSize = sizeof(GDIBSOBJECT);
|
||||||
case GdiBCTextOut:
|
else if (Cmd == GdiBCDelObj) cjSize = sizeof(GDIBSOBJECT);
|
||||||
ulSize = 0;
|
else cjSize = 0;
|
||||||
break;
|
|
||||||
case GdiBCExtTextOut:
|
|
||||||
ulSize = 0;
|
|
||||||
break;
|
|
||||||
case GdiBCSetBrushOrg:
|
|
||||||
ulSize = 0;
|
|
||||||
break;
|
|
||||||
case GdiBCExtSelClipRgn:
|
|
||||||
ulSize = 0;
|
|
||||||
break;
|
|
||||||
case GdiBCSelObj:
|
|
||||||
ulSize = sizeof(GDIBSOBJECT);
|
|
||||||
break;
|
|
||||||
case GdiBCDelRgn:
|
|
||||||
ulSize = sizeof(GDIBSOBJECT);
|
|
||||||
break;
|
|
||||||
case GdiBCDelObj:
|
|
||||||
ulSize = sizeof(GDIBSOBJECT);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Unsupported operation */
|
/* Unsupported operation */
|
||||||
if (ulSize == 0) return NULL;
|
if (cjSize == 0) return NULL;
|
||||||
|
|
||||||
/* Check if the buffer is full */
|
/* Check if the buffer is full */
|
||||||
if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
|
if ((pTeb->GdiBatchCount >= GDI_BatchLimit) ||
|
||||||
((pTeb->GdiTebBatch.Offset + ulSize) > GDIBATCHBUFSIZE))
|
((pTeb->GdiTebBatch.Offset + cjSize) > GDIBATCHBUFSIZE))
|
||||||
{
|
{
|
||||||
/* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
|
/* Call win32k, the kernel will call NtGdiFlushUserBatch to flush
|
||||||
the current batch */
|
the current batch */
|
||||||
|
@ -367,12 +345,12 @@ GdiAllocBatchCommand(
|
||||||
pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
|
pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset);
|
||||||
|
|
||||||
/* Update Offset and batch count */
|
/* Update Offset and batch count */
|
||||||
pTeb->GdiTebBatch.Offset += ulSize;
|
pTeb->GdiTebBatch.Offset += cjSize;
|
||||||
pTeb->GdiBatchCount++;
|
pTeb->GdiBatchCount++;
|
||||||
|
|
||||||
/* Fill in the core fields */
|
/* Fill in the core fields */
|
||||||
pHdr->Cmd = Cmd;
|
pHdr->Cmd = Cmd;
|
||||||
pHdr->Size = ulSize;
|
pHdr->Size = cjSize;
|
||||||
|
|
||||||
return pHdr;
|
return pHdr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue