These asserts are not useless.
A DWORD can also underflow (due to a bug), hence the point of these ASSERTs -- the only bug is that the ASSERT should cast to LONG.
Best regards, Alex Ionescu
On Fri, Sep 2, 2011 at 9:23 AM, akhaldi@svn.reactos.org wrote:
Author: akhaldi Date: Fri Sep 2 09:23:20 2011 New Revision: 53527
URL: http://svn.reactos.org/svn/reactos?rev=53527&view=rev Log: [WIN32K]
- Remove some useless asserts considering cLockObj is DWORD.
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu...
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -74,7 +74,6 @@ return NULL; }
- ASSERT(Menu->head.cLockObj >= 0); return Menu;
}
@@ -137,11 +136,8 @@ { PMENU_OBJECT Menu = UserGetMenuObject(hMenu); if (Menu)
- {
ASSERT(Menu->head.cLockObj >= 0);Menu->head.cLockObj++;- }
- return Menu;
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu...
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -93,8 +93,6 @@ return NULL; }
- ASSERT(Monitor->head.cLockObj >= 0);
- return Monitor;
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu...
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -61,11 +61,8 @@
Window = UserGetWindowObject(hWnd); if (Window)
- {
ASSERT(Window->head.cLockObj >= 0);Window->head.cLockObj++;- }
- return Window;
}
@@ -86,8 +83,6 @@ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); return NULL; }
ASSERT(Window->head.cLockObj >= 0);
return Window;
}
Am 02.09.2011 13:05, schrieb Alex Ionescu:
These asserts are not useless.
A DWORD can also underflow (due to a bug), hence the point of these ASSERTs -- the only bug is that the ASSERT should cast to LONG.
Best regards, Alex Ionescu
They were in the complete wrong place then.
It's okay, the check is handled with referencing in object.c.
On Fri, Sep 2, 2011 at 7:22 AM, Timo Kreuzer timo.kreuzer@web.de wrote:
Am 02.09.2011 13:05, schrieb Alex Ionescu:
These asserts are not useless.
A DWORD can also underflow (due to a bug), hence the point of these ASSERTs -- the only bug is that the ASSERT should cast to LONG.
Best regards, Alex Ionescu
They were in the complete wrong place then.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev