Author: pschweitzer
Date: Fri May 27 21:21:36 2011
New Revision: 51965
URL:
http://svn.reactos.org/svn/reactos?rev=51965&view=rev
Log:
[NTOSKRNL]
Fix struct size checking for debug remove locks.
Spotted by Roel
Modified:
trunk/reactos/ntoskrnl/io/iomgr/remlock.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/remlock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/remlock.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/remlock.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/remlock.c [iso-8859-1] Fri May 27 21:21:36 2011
@@ -50,7 +50,7 @@
switch (RemlockSize)
{
/* Check if this is a debug lock */
- case sizeof(IO_REMOVE_LOCK_DBG_BLOCK):
+ case (sizeof(IO_REMOVE_LOCK_DBG_BLOCK) + sizeof(IO_REMOVE_LOCK_COMMON_BLOCK)):
/* Setup debug parameters */
Lock->Dbg.Signature = 'COLR';
Lock->Dbg.HighWatermark = HighWatermark;
@@ -92,7 +92,7 @@
if (!Lock->Common.Removed)
{
/* Check what kind of lock this is */
- if (RemlockSize == sizeof(IO_REMOVE_LOCK_DBG_BLOCK))
+ if (RemlockSize == (sizeof(IO_REMOVE_LOCK_DBG_BLOCK) +
sizeof(IO_REMOVE_LOCK_COMMON_BLOCK)))
{
ASSERT(Lock->Dbg.HighWatermark == 0 || LockValue <=
Lock->Dbg.HighWatermark);
@@ -154,7 +154,7 @@
PEXTENDED_IO_REMOVE_LOCK Lock = (PEXTENDED_IO_REMOVE_LOCK)RemoveLock;
/* Check what kind of lock this is */
- if (RemlockSize == sizeof(IO_REMOVE_LOCK_DBG_BLOCK))
+ if (RemlockSize == (sizeof(IO_REMOVE_LOCK_DBG_BLOCK) +
sizeof(IO_REMOVE_LOCK_COMMON_BLOCK)))
{
/* Acquire blocks queue */
KeAcquireSpinLock(&(Lock->Dbg.Spin), &OldIrql);
@@ -265,7 +265,7 @@
}
/* Check what kind of lock this is */
- if (RemlockSize == sizeof(IO_REMOVE_LOCK_DBG_BLOCK))
+ if (RemlockSize == (sizeof(IO_REMOVE_LOCK_DBG_BLOCK) +
sizeof(IO_REMOVE_LOCK_COMMON_BLOCK)))
{
/* A block must be remaining */
ASSERT(Lock->Dbg.Blocks);