Author: tkreuzer
Date: Sun Dec 30 19:11:22 2012
New Revision: 58061
URL:
http://svn.reactos.org/svn/reactos?rev=58061&view=rev
Log:
[WIN32K]
Add more ASSERTs
Modified:
branches/dib_rewrite/win32ss/gdi/eng/bitblt_new.c
branches/dib_rewrite/win32ss/gdi/eng/pdevobj.h
branches/dib_rewrite/win32ss/gdi/eng/surface.c
branches/dib_rewrite/win32ss/gdi/eng/surface.h
branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c
Modified: branches/dib_rewrite/win32ss/gdi/eng/bitblt_new.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/bit…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] Sun Dec 30 19:11:22
2012
@@ -132,6 +132,9 @@
ASSERT(prclTrg->top >= 0);
ASSERT(prclTrg->right <= psoTrg->sizlBitmap.cx);
ASSERT(prclTrg->bottom <= psoTrg->sizlBitmap.cy);
+ ASSERT_DEVLOCK(psoTrg);
+ ASSERT_DEVLOCK(psoSrc);
+ ASSERT_DEVLOCK(psoMask);
rcTrg = *prclTrg;
Modified: branches/dib_rewrite/win32ss/gdi/eng/pdevobj.h
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/pde…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/pdevobj.h [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/pdevobj.h [iso-8859-1] Sun Dec 30 19:11:22 2012
@@ -190,4 +190,11 @@
_In_ PPDEVOBJ ppdev,
_Out_ PSIZEL psizl);
+BOOL
+FORCEINLINE
+PDEVOBJ_bLockIsOwned(PPDEVOBJ ppdev)
+{
+ return ExIsResourceAcquiredExclusiveLite((PERESOURCE)ppdev->hsemDevLock);
+}
+
#endif /* !__WIN32K_PDEVOBJ_H */
Modified: branches/dib_rewrite/win32ss/gdi/eng/surface.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/sur…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/surface.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/surface.c [iso-8859-1] Sun Dec 30 19:11:22 2012
@@ -291,6 +291,17 @@
return BI_BITFIELDS;
}
+BOOL
+NTAPI
+SURFACE_bIsDeviceSurface(
+ _In_ PSURFACE psurf)
+{
+ PPDEVOBJ ppdev = (PPDEVOBJ)psurf->SurfObj.hdev;
+
+ /* Check if the surface is the related PDEVOBJ's surface */
+ return ((ppdev != 0) && (psurf == ppdev->pSurface));
+}
+
HBITMAP
APIENTRY
EngCreateBitmap(
Modified: branches/dib_rewrite/win32ss/gdi/eng/surface.h
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/sur…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/surface.h [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/surface.h [iso-8859-1] Sun Dec 30 19:11:22 2012
@@ -81,6 +81,8 @@
PDEV_SURFACE = 0x80000000
};
+#define SURFOBJ_TO_SURFACE(pso) CONTAINING_RECORD(pso, SURFACE, SurfObj)
+
#define BMF_POOLALLOC 0x100
#define PDEV_SURFACE 0x80000000
@@ -131,6 +133,17 @@
SURFACE_iCompression(
_In_ PSURFACE psurf);
+BOOL
+NTAPI
+SURFACE_bIsDeviceSurface(
+ _In_ PSURFACE psurf);
+
+#define SURFOBJ_bIsDeviceSurface(pso) \
+ SURFACE_bIsDeviceSurface(SURFOBJ_TO_SURFACE(pso))
+
+#define ASSERT_DEVLOCK(pso) \
+ ASSERT(!pso || !SURFOBJ_bIsDeviceSurface(pso) || \
+ PDEVOBJ_bLockIsOwned((PPDEVOBJ)pso->hdev))
VOID
@@ -146,3 +159,4 @@
*(PVOID*)&psurf->ppal = ppal;
}
+
Modified: branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/ntgdi/d…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] Sun Dec 30 19:11:22
2012
@@ -1092,7 +1092,6 @@
if ((pbmi->bmiHeader.biSize < sizeof(BITMAPINFOHEADER)) ||
(pbmi->bmiHeader.biSize > cjMaxInfo))
{
- iResult = 0;
goto cleanup;
}