Author: jimtabor
Date: Thu Jun 5 21:59:12 2008
New Revision: 33863
URL:
http://svn.reactos.org/svn/reactos?rev=33863&view=rev
Log:
Attempt to fix bug 3259. Use IntGdiCleanDC for error checking.
Modified:
trunk/reactos/subsystems/win32/win32k/include/dc.h
trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Thu Jun 5 21:59:12
2008
@@ -261,6 +261,8 @@
#define DC_UnlockDc(pDC) \
GDIOBJ_UnlockObjByPtr ((POBJ)pDC)
+extern PDC defaultDCstate;
+
NTSTATUS FASTCALL InitDcImpl(VOID);
PGDIDEVICE FASTCALL IntEnumHDev(VOID);
HDC FASTCALL DC_AllocDC(PUNICODE_STRING Driver);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Thu Jun 5 21:59:12
2008
@@ -19,7 +19,6 @@
/* NOTE - I think we should store this per window station (including gdi objects) */
static PDCE FirstDce = NULL;
-static PDC defaultDCstate = NULL;
//static INT DCECount = 0; // Count of DCE in system.
#define DCX_CACHECOMPAREMASK (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | \
@@ -228,13 +227,11 @@
{
if (!(dce->DCXFlags & DCX_NORESETATTRS))
{
- PDC dc;
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */
IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
- dc = DC_LockDc ( dce->hDC );
// Clean the DC
- IntGdiCopyFromSaveState(dc, defaultDCstate, dce->hDC ); // Was SetDCState.
+ if (!IntGdiCleanDC(dce->hDC)) return 0;
dce->DCXFlags &= ~DCX_DCEBUSY;
if (dce->DCXFlags & DCX_DCEDIRTY)
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Thu Jun 5 21:59:12
2008
@@ -33,7 +33,7 @@
PGDIDEVICE pPrimarySurface = &PrimarySurface;
static KEVENT VideoDriverNeedsPreparation;
static KEVENT VideoDriverPrepared;
-static PDC defaultDCstate = NULL;
+PDC defaultDCstate = NULL;
NTSTATUS FASTCALL
@@ -952,10 +952,11 @@
IntGdiCleanDC(HDC hDC)
{
PDC dc;
+ if (!hDC) return FALSE;
dc = DC_LockDc ( hDC );
+ if (!dc) return FALSE;
// Clean the DC
if (defaultDCstate) IntGdiCopyFromSaveState(dc, defaultDCstate, hDC );
- DC_UnlockDc(dc);
return TRUE;
}