Allow batch flush to handle null DCs.

svn path=/trunk/; revision=30145
This commit is contained in:
James Tabor 2007-11-05 02:25:43 +00:00
parent 1423476391
commit 0dc4496ea8

View file

@ -18,9 +18,9 @@ ULONG
FASTCALL FASTCALL
GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr) GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
{ {
PDC dc = DC_LockDc(hDC); PDC dc = NULL;
if (!dc) return 0; if (hDC) dc = DC_LockDc(hDC);
// The thread is on the end of sunset. // The thread is approaching the end of sunset.
switch(pHdr->Cmd) switch(pHdr->Cmd)
{ {
case GdiBCPatBlt: // Highest pri first! case GdiBCPatBlt: // Highest pri first!
@ -33,6 +33,7 @@ GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
break; break;
case GdiBCSetBrushOrg: case GdiBCSetBrushOrg:
{ {
if (!dc) break;
PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG) pHdr; PGDIBSSETBRHORG pgSBO = (PGDIBSSETBRHORG) pHdr;
dc->Dc_Attr.ptlBrushOrigin = pgSBO->ptlBrushOrigin; dc->Dc_Attr.ptlBrushOrigin = pgSBO->ptlBrushOrigin;
break; break;
@ -49,10 +50,9 @@ GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
break; break;
} }
default: default:
DC_UnlockDc(dc); break;
return 0;
} }
DC_UnlockDc(dc); if (dc) DC_UnlockDc(dc);
return pHdr->Size; // Return the full size of the structure. return pHdr->Size; // Return the full size of the structure.
} }