mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 17:03:00 +00:00
[Gdi32] Batch Type Select Mode for Testing
Do not allow setting hdc if no batch type is found. See CORE-15988.
This commit is contained in:
parent
34cbb45ff6
commit
5418f394ab
1 changed files with 10 additions and 10 deletions
|
@ -392,16 +392,6 @@ GdiAllocBatchCommand(
|
||||||
/* Check if we have a valid environment */
|
/* Check if we have a valid environment */
|
||||||
if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
|
if (!pTeb || !pTeb->Win32ThreadInfo) return NULL;
|
||||||
|
|
||||||
/* Do we use a DC? */
|
|
||||||
if (hdc)
|
|
||||||
{
|
|
||||||
/* If the batch DC is NULL, we set this one as the new one */
|
|
||||||
if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
|
|
||||||
|
|
||||||
/* If not, check if the batch DC equal to our DC */
|
|
||||||
else if (pTeb->GdiTebBatch.HDC != hdc) return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the size of the entry */
|
/* Get the size of the entry */
|
||||||
if (Cmd == GdiBCPatBlt) cjSize = sizeof(GDIBSPATBLT);
|
if (Cmd == GdiBCPatBlt) cjSize = sizeof(GDIBSPATBLT);
|
||||||
else if (Cmd == GdiBCPolyPatBlt) cjSize = sizeof(GDIBSPPATBLT);
|
else if (Cmd == GdiBCPolyPatBlt) cjSize = sizeof(GDIBSPPATBLT);
|
||||||
|
@ -417,6 +407,16 @@ GdiAllocBatchCommand(
|
||||||
/* Unsupported operation */
|
/* Unsupported operation */
|
||||||
if (cjSize == 0) return NULL;
|
if (cjSize == 0) return NULL;
|
||||||
|
|
||||||
|
/* Do we use a DC? */
|
||||||
|
if (hdc)
|
||||||
|
{
|
||||||
|
/* If the batch DC is NULL, we set this one as the new one */
|
||||||
|
if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc;
|
||||||
|
|
||||||
|
/* If not, check if the batch DC equal to our DC */
|
||||||
|
else if (pTeb->GdiTebBatch.HDC != hdc) 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 + cjSize) > GDIBATCHBUFSIZE))
|
((pTeb->GdiTebBatch.Offset + cjSize) > GDIBATCHBUFSIZE))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue