Author: jimtabor
Date: Sat Jan 16 06:56:22 2010
New Revision: 45096
URL:
http://svn.reactos.org/svn/reactos?rev=45096&view=rev
Log:
[Win32k]
- Fix the window handle De/Reference throttler issue. Used mIrc.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/object.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] Sat Jan 16 06:56:22
2010
@@ -396,37 +396,26 @@
BOOL
FASTCALL
-UserDereferenceObject(PVOID obj)
-{
- ASSERT(((PHEAD)obj)->cLockObj >= 1);
-
- if (--((PHEAD)obj)->cLockObj <= 0)
+UserDereferenceObject(PVOID object)
+{
+ PUSER_HANDLE_ENTRY entry;
+ USER_OBJECT_TYPE type;
+
+ ASSERT(((PHEAD)object)->cLockObj >= 1);
+
+ if ((INT)--((PHEAD)object)->cLockObj <= 0)
{
- return TRUE;
- }
- return FALSE;
-}
-
-BOOL
-FASTCALL
-UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle )
-{
- PUSER_HANDLE_ENTRY entry;
- PVOID object;
- USER_OBJECT_TYPE type;
-
- if (!(entry = handle_to_entry( ht, handle )))
- {
- SetLastNtError( STATUS_INVALID_HANDLE );
- return FALSE;
- }
-
- entry->flags = HANDLEENTRY_INDESTROY;
-
- if (UserDereferenceObject(entry->ptr))
- {
+ entry = handle_to_entry(gHandleTable, ((PHEAD)object)->h );
+
+ DPRINT("warning! Dereference to zero! Obj -> 0x%x\n", object);
+
+ ((PHEAD)object)->cLockObj = 0;
+
+ if (!(entry->flags & HANDLEENTRY_INDESTROY))
+ return TRUE;
+
type = entry->type;
- object = free_user_entry(ht, entry );
+ free_user_entry(gHandleTable, entry );
switch (type)
{
@@ -446,6 +435,23 @@
BOOL
FASTCALL
+UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle )
+{
+ PUSER_HANDLE_ENTRY entry;
+
+ if (!(entry = handle_to_entry( ht, handle )))
+ {
+ SetLastNtError( STATUS_INVALID_HANDLE );
+ return FALSE;
+ }
+
+ entry->flags = HANDLEENTRY_INDESTROY;
+
+ return UserDereferenceObject(entry->ptr);
+}
+
+BOOL
+FASTCALL
UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type )
{
PVOID body = UserGetObject(gHandleTable, h, type);