-#include <w32k.h>
+#include <win32k.h>
#define NDEBUG
#include <debug.h>
FASTCALL
DoDeviceSync( SURFOBJ *Surface, PRECTL Rect, FLONG fl)
{
- PGDIDEVICE Device = (GDIDEVICE*)Surface->hdev;
+ PPDEVOBJ Device = (PDEVOBJ*)Surface->hdev;
// No punting and "Handle to a surface, provided that the surface is device-managed.
// Otherwise, dhsurf is zero".
if (!(Device->flFlags & PDEV_DRIVER_PUNTED_CALL) && (Surface->dhsurf))
{
if (Device->DriverFunctions.SynchronizeSurface)
- return Device->DriverFunctions.SynchronizeSurface(Surface, Rect, fl);
+ {
+ Device->DriverFunctions.SynchronizeSurface(Surface, Rect, fl);
+ }
else
{
if (Device->DriverFunctions.Synchronize)
- return Device->DriverFunctions.Synchronize(Surface->dhpdev, Rect);
+ {
+ Device->DriverFunctions.Synchronize(Surface->dhpdev, Rect);
+ }
}
}
- return;
}
VOID
SynchonizeDriver(FLONG Flags)
{
SURFOBJ *SurfObj;
- PGDIDEVICE Device;
+ PPDEVOBJ Device;
if (Flags & GCAPS2_SYNCFLUSH)
Flags = DSS_FLUSH_EVENT;
Flags = DSS_TIMER_EVENT;
Device = IntEnumHDev();
-
- SurfObj = EngLockSurface( Device->pSurface );
+// UNIMPLEMENTED;
+//ASSERT(FALSE);
+ SurfObj = 0;// EngLockSurface( Device->pSurface );
if(!SurfObj) return;
DoDeviceSync( SurfObj, NULL, Flags);
EngUnlockSurface(SurfObj);
FASTCALL
GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
{
- PDC_ATTR Dc_Attr = NULL;
+ BOOL Hit = FALSE;
+ ULONG Cmd = 0, Size = 0;
+ PDC_ATTR pdcattr = NULL;
if (dc)
{
- Dc_Attr = dc->pDc_Attr;
- if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ pdcattr = dc->pdcattr;
}
- // The thread is approaching the end of sunset.
- switch(pHdr->Cmd)
+
+ _SEH2_TRY
+ {
+ Cmd = pHdr->Cmd;
+ Size = pHdr->Size; // Return the full size of the structure.
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Hit = TRUE;
+ }
+ _SEH2_END;
+
+ if (Hit)
+ {
+ DPRINT1("WARNING! GdiBatch Fault!\n");
+ return 0;
+ }
+
+ // FYI! The thread is approaching the end of sunset.
+ switch(Cmd)
{
case GdiBCPatBlt: // Highest pri first!
break;
case GdiBCSetBrushOrg:
{
PGDIBSSETBRHORG pgSBO;
- if(!dc) break;
+ if (!dc) break;
pgSBO = (PGDIBSSETBRHORG) pHdr;
- Dc_Attr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
+ pdcattr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
+ IntptlBrushOrigin(dc, pgSBO->ptlBrushOrigin.x, pgSBO->ptlBrushOrigin.y);
break;
}
case GdiBCExtSelClipRgn:
case GdiBCSelObj:
{
PGDIBSOBJECT pgO;
- if(!dc) break;
+ PTEXTOBJ pNewFnt = NULL;
+
+ if (!dc) break;
pgO = (PGDIBSOBJECT) pHdr;
- TextIntRealizeFont((HFONT) pgO->hgdiobj, NULL);
- Dc_Attr->ulDirty_ &= ~(DIRTY_CHARSET);
+
+ if (NT_SUCCESS(TextIntRealizeFont((HFONT)pgO->hgdiobj,NULL)))
+ {
+ /* LFONTOBJ use share and locking. */
+ pNewFnt = TEXTOBJ_LockText(pgO->hgdiobj);
+
+ dc->dclevel.plfnt = pNewFnt;
+ dc->hlfntCur = pgO->hgdiobj;
+ pdcattr->hlfntNew = pgO->hgdiobj;
+ pdcattr->ulDirty_ |= DIRTY_CHARSET;
+ pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
+ }
+ if (pNewFnt) TEXTOBJ_UnlockText(pNewFnt);
+ break;
}
- case GdiBCDelObj:
case GdiBCDelRgn:
+ DPRINT("Delete Region Object!\n");
+ case GdiBCDelObj:
{
PGDIBSOBJECT pgO = (PGDIBSOBJECT) pHdr;
- NtGdiDeleteObject( pgO->hgdiobj );
+ GreDeleteObject( pgO->hgdiobj );
break;
}
default:
break;
}
- return pHdr->Size; // Return the full size of the structure.
+ return Size;
}
/*
HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
/* If hDC is zero and the buffer fills up with delete objects we need
- to run anyway. So, hard code to the system batch limit. */
- if ((hDC) || (GdiBatchCount >= GDI_BATCH_LIMIT))
+ to run anyway.
+ */
+ if (hDC || GdiBatchCount)
{
PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
PDC pDC = NULL;
// No need to init anything, just go!
for (; GdiBatchCount > 0; GdiBatchCount--)
{
+ ULONG Size;
// Process Gdi Batch!
- pHdr += GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
+ Size = GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
+ if (!Size) break;
+ pHdr += Size;
}
if (pDC)