- 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

svn path=/trunk/; revision=29105
This commit is contained in:
James Tabor
2007-09-19 13:24:58 +00:00
parent a7a5e5a486
commit de7c2c63e3
2 changed files with 8 additions and 4 deletions
@@ -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 @@ typedef enum _USER_OBJECT_TYPE
otFree = 0,
otWindow,
otMenu,
otAccel,
otCursorIcon,
otHook,
otMonitor,
otCallProc
otHook = 5,
otCallProc = 7,
otAccel,
otMonitor = 12
} USER_OBJECT_TYPE;
@@ -108,6 +108,7 @@ __inline static void *free_user_entry(PUSER_HANDLE_TABLE ht, PUSER_HANDLE_ENTRY
ret = entry->ptr;
entry->ptr = ht->freelist;
entry->type = 0;
entry->pti = 0;
ht->freelist = entry;
usedHandles--;
@@ -123,6 +124,8 @@ HANDLE UserAllocHandle(PUSER_HANDLE_TABLE ht, PVOID object, USER_OBJECT_TYPE typ
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 );