Author: jimtabor Date: Wed Sep 19 17:24:58 2007 New Revision: 29105
URL: http://svn.reactos.org/svn/reactos?rev=29105&view=rev Log: Win32k: - Add thread information pointer to the user handle entry. This will be useful for checking handles, if the handle is not part of the current thread. - Add a test to make sure the current process passes the gHandleTable pointer to user32. - These changes are important for allowing User32 to read-only the handle object information. Not 100% compatible, we need NtUserProcessConnect and CsrClientConnectToServer. Need a full understanding how they both work with User32. Ref: - https://www.microsoft.com/msj/0397/hood/hood0397.aspx - http://www.winterdom.com/dev/ui/wnd.html
Modified: trunk/reactos/subsystems/win32/win32k/include/object.h trunk/reactos/subsystems/win32/win32k/ntuser/object.c
Modified: trunk/reactos/subsystems/win32/win32k/include/object.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/object.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/object.h Wed Sep 19 17:24:58 2007 @@ -20,6 +20,7 @@ typedef struct _USER_HANDLE_ENTRY { void *ptr; /* pointer to object */ + PW32THREADINFO pti; // pointer to Win32ThreadInfo unsigned short type; /* object type (0 if free) */ unsigned short generation; /* generation counter */ } USER_HANDLE_ENTRY, * PUSER_HANDLE_ENTRY; @@ -41,11 +42,11 @@ otFree = 0, otWindow, otMenu, + otCursorIcon, + otHook = 5, + otCallProc = 7, otAccel, - otCursorIcon, - otHook, - otMonitor, - otCallProc + otMonitor = 12
} USER_OBJECT_TYPE;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/object.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c Wed Sep 19 17:24:58 2007 @@ -108,6 +108,7 @@ ret = entry->ptr; entry->ptr = ht->freelist; entry->type = 0; + entry->pti = 0; ht->freelist = entry;
usedHandles--; @@ -123,6 +124,8 @@ return 0; entry->ptr = object; entry->type = type; + entry->pti = GetW32ThreadInfo(); + if (entry->pti->pi->UserHandleTable == NULL) GetW32ProcessInfo(); if (++entry->generation >= 0xffff) entry->generation = 1; return entry_to_handle(ht, entry );