Author: jgardou
Date: Sat Apr 17 22:51:42 2010
New Revision: 46909
URL:
http://svn.reactos.org/svn/reactos?rev=46909&view=rev
Log:
[WIN32K]
- apply policy into DC_vPrepareDCsForBlit as in GDIOBJ_LockMultipleObjects before
Physicus sees this :-D
- GDIOBJ_LockObj : return NULL when handle is NULL : more speed, less debug output
Modified:
branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c
branches/reactos-yarotows/subsystems/win32/win32k/objects/gdiobj.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Sat
Apr 17 22:51:42 2010
@@ -463,15 +463,50 @@
PDC pdc2,
RECT rc2)
{
- if(pdc1->dctype == DCTYPE_DIRECT)
- {
- EngAcquireSemaphore(pdc1->ppdev->hsemDevLock);
- MouseSafetyOnDrawStart(&pdc1->dclevel.pSurface->SurfObj, rc1.left,
rc1.top, rc1.right, rc1.bottom) ;
- }
- if(pdc2 && pdc2->dctype == DCTYPE_DIRECT)
- {
- EngAcquireSemaphore(pdc2->ppdev->hsemDevLock);
- MouseSafetyOnDrawStart(&pdc2->dclevel.pSurface->SurfObj, rc2.left,
rc2.top, rc2.right, rc2.bottom) ;
+ PDC pdcFirst, pdcSecond;
+ PRECT prcFirst, prcSecond;
+ /* Lock them in good order */
+ if(pdc2)
+ {
+ if((ULONG_PTR)pdc1->BaseObject.hHmgr >=
(ULONG_PTR)pdc2->BaseObject.hHmgr)
+ {
+ pdcFirst = pdc1;
+ prcFirst = &rc1;
+ pdcSecond = pdc2;
+ prcSecond = &rc2;
+ }
+ else
+ {
+ pdcFirst = pdc2;
+ prcFirst = &rc2;
+ pdcSecond = pdc1;
+ prcSecond = &rc1;
+ }
+ }
+ else
+ {
+ pdcFirst = pdc1 ;
+ prcFirst = &rc1;
+ pdcSecond = NULL ;
+ }
+
+ if(pdcFirst && pdcFirst->dctype == DCTYPE_DIRECT)
+ {
+ EngAcquireSemaphore(pdcFirst->ppdev->hsemDevLock);
+ MouseSafetyOnDrawStart(&pdcFirst->dclevel.pSurface->SurfObj,
+ prcFirst->left,
+ prcFirst->top,
+ prcFirst->right,
+ prcFirst->bottom) ;
+ }
+ if(pdcSecond && pdcSecond->dctype == DCTYPE_DIRECT)
+ {
+ EngAcquireSemaphore(pdcSecond->ppdev->hsemDevLock);
+ MouseSafetyOnDrawStart(&pdcSecond->dclevel.pSurface->SurfObj,
+ prcSecond->left,
+ prcSecond->top,
+ prcSecond->right,
+ prcSecond->bottom) ;
}
}
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Sat
Apr 17 22:51:42 2010
@@ -952,6 +952,10 @@
POBJ Object = NULL;
ULONG HandleType, HandleUpper;
+ /* Check for dummy call */
+ if(hObj == NULL)
+ return NULL ;
+
GDIDBG_INITLOOPTRACE();
HandleIndex = GDI_HANDLE_GET_INDEX(hObj);
@@ -959,7 +963,7 @@
HandleUpper = GDI_HANDLE_GET_UPPER(hObj);
/* Check that the handle index is valid. */
- if (HandleIndex >= GDI_HANDLE_COUNT)
+ if (HandleIndex >= GDI_HANDLE_COUNT )
return NULL;
Entry = &GdiHandleTable->Entries[HandleIndex];