Author: jgardou
Date: Mon Apr 5 13:53:36 2010
New Revision: 46734
URL:
http://svn.reactos.org/svn/reactos?rev=46734&view=rev
Log:
[WIN32K]
Partially revert 46733
Silence some debug output
Modified:
branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1] Mon Apr
5 13:53:36 2010
@@ -60,7 +60,8 @@
/* Do we have a surface? */
if(ppdev->pSurface)
{
- /* No one should hold a lock on this surface */
+ /* Release the surface and let the driver free it */
+ SURFACE_ShareUnlockSurface(ppdev->pSurface);
ppdev->pfn.DisableSurface(ppdev->dhpdev);
}
@@ -146,8 +147,6 @@
{
HSURF hsurf;
- DPRINT("PDEVOBJ_pSurface()\n");
-
/* Check if we already have a surface */
if (ppdev->pSurface)
{
@@ -291,6 +290,7 @@
PPDEVOBJ ppdev2)
{
PDEVOBJ pdevTmp;
+ HDEV hdev;
/* Exchange data */
pdevTmp = *ppdev;
@@ -310,10 +310,9 @@
/* Exchange surface */
ppdev->pSurface = ppdev2->pSurface;
ppdev2->pSurface = pdevTmp.pSurface;
- if(ppdev->pSurface)
- ppdev->pSurface->SurfObj.hdev = (HDEV)ppdev;
- if(ppdev2->pSurface)
- ppdev2->pSurface->SurfObj.hdev = (HDEV)ppdev2;
+ hdev = ppdev->pSurface->SurfObj.hdev;
+ ppdev->pSurface->SurfObj.hdev = ppdev2->pSurface->SurfObj.hdev;
+ ppdev2->pSurface->SurfObj.hdev = hdev;
/* Exchange devinfo */
ppdev->devinfo = ppdev2->devinfo;
@@ -337,6 +336,7 @@
{
UNICODE_STRING ustrDevice;
PPDEVOBJ ppdevTmp;
+ PSURFACE pSurface;
BOOL retval = FALSE;
/* Lock the PDEV */
@@ -365,14 +365,25 @@
goto leave;
}
- /* 3. Get DirectDraw information */
- /* 4. Enable DirectDraw Not traced */
- /* 5. Copy old PDEV state to new PDEV instance */
-
- /* 6. Switch the PDEVs */
+ /* 3. Create a new surface */
+ pSurface = PDEVOBJ_pSurface(ppdevTmp);
+ if (!pSurface)
+ {
+ DPRINT1("DrvEnableSurface failed\n");
+ goto leave;
+ }
+
+ ASSERT(pSurface->BitsLock);
+
+ /* 4. Get DirectDraw information */
+ /* 5. Enable DirectDraw Not traced */
+ /* 6. Copy old PDEV state to new PDEV instance */
+
+ /* 7. Switch the PDEVs */
PDEVOBJ_vSwitchPdev(ppdev, ppdevTmp);
-
- /* 7. Disable DirectDraw */
+ ASSERT(ppdev->pSurface->BitsLock);
+
+ /* 8. Disable DirectDraw */
PDEVOBJ_vRelease(ppdevTmp);
@@ -384,6 +395,7 @@
EngReleaseSemaphore(ghsemPDEV);
DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface);
+ ASSERT(ppdev->pSurface->BitsLock);
return retval;
}