Author: greatlrd
Date: Wed Jul 19 06:03:22 2006
New Revision: 23167
URL:
http://svn.reactos.org/svn/reactos?rev=23167&view=rev
Log:
more source cleanup
Modified:
trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c Wed Jul 19 06:03:22 2006
@@ -474,32 +474,30 @@
DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface,
GDI_OBJECT_TYPE_DIRECTDRAW);
-#ifdef DX_DEBUG
+
DPRINT1("NtGdiDdDestroySurface\n");
-#endif
- if (pDirectDraw == NULL)
- return DDHAL_DRIVER_NOTHANDLED;
-
- if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_DESTROYSURFACE))
- ddRVal = DDHAL_DRIVER_NOTHANDLED;
- else
- {
- DD_DESTROYSURFACEDATA DestroySurf;
-
- /* FIXME
- * bRealDestroy
- * are we doing right ??
- */
- DestroySurf.lpDD = &pDirectDraw->Global;
-
- DestroySurf.lpDDSurface = hSurface; // ?
- DestroySurf.DestroySurface = pDirectDraw->Surf.DestroySurface;
+
+ if (pDirectDraw != NULL)
+ {
+ if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_DESTROYSURFACE)
+ {
+ DD_DESTROYSURFACEDATA DestroySurf;
+
+ /* FIXME
+ * bRealDestroy
+ * are we doing right ??
+ */
+
+ DestroySurf.lpDD = &pDirectDraw->Global;
+ DestroySurf.lpDDSurface = hSurface; // ?
+ DestroySurf.DestroySurface = pDirectDraw->Surf.DestroySurface;
- ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf);
- }
-
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf);
+ }
+
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ }
+
return ddRVal;
}
@@ -511,33 +509,29 @@
PDD_FLIPDATA puFlipData
)
{
- DWORD ddRVal;
+ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
PDD_DIRECTDRAW_GLOBAL lgpl;
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurfaceTarget,
GDI_OBJECT_TYPE_DIRECTDRAW);
-#ifdef DX_DEBUG
+
DPRINT1("NtGdiDdFlip\n");
-#endif
-
- if (pDirectDraw == NULL)
- return DDHAL_DRIVER_NOTHANDLED;
-
- /* backup the orignal PDev and info */
- lgpl = puFlipData->lpDD;
-
- /* use our cache version instead */
- puFlipData->lpDD = &pDirectDraw->Global;
-
- /* make the call */
- if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP))
- ddRVal = DDHAL_DRIVER_NOTHANDLED;
- else
- ddRVal = pDirectDraw->Surf.Flip(puFlipData);
-
- /* But back the orignal PDev */
- puFlipData->lpDD = lgpl;
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+
+
+ if (pDirectDraw != NULL)
+ {
+ if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP)
+ {
+ lgpl = puFlipData->lpDD;
+ puFlipData->lpDD = &pDirectDraw->Global;
+
+ ddRVal = pDirectDraw->Surf.Flip(puFlipData);
+
+ puFlipData->lpDD = lgpl;
+ }
+
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ }
+
return ddRVal;
}
@@ -547,32 +541,28 @@
HDC hdcClip
)
{
- DWORD ddRVal;
+ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
PDD_DIRECTDRAW_GLOBAL lgpl;
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hSurface,
GDI_OBJECT_TYPE_DIRECTDRAW);
-#ifdef DX_DEBUG
+
DPRINT1("NtGdiDdLock\n");
-#endif
- if (pDirectDraw == NULL)
- return DDHAL_DRIVER_NOTHANDLED;
-
- /* backup the orignal PDev and info */
- lgpl = puLockData->lpDD;
-
- /* use our cache version instead */
- puLockData->lpDD = &pDirectDraw->Global;
-
- /* make the call */
- if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_LOCK))
- ddRVal = DDHAL_DRIVER_NOTHANDLED;
- else
- ddRVal = pDirectDraw->Surf.Lock(puLockData);
-
- /* But back the orignal PDev */
- puLockData->lpDD = lgpl;
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+
+ if (pDirectDraw != NULL)
+ {
+ if (pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_LOCK)
+ {
+ lgpl = puLockData->lpDD;
+ puLockData->lpDD = &pDirectDraw->Global;
+
+ ddRVal = pDirectDraw->Surf.Lock(puLockData);
+
+ puLockData->lpDD = lgpl;
+ }
+
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ }
+
return ddRVal;
}