ReactOS  0.4.15-dev-5496-g599ba9c
object.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _USER_REFERENCE_ENTRY
 

Typedefs

typedef struct _USER_REFERENCE_ENTRY USER_REFERENCE_ENTRY
 
typedef struct _USER_REFERENCE_ENTRYPUSER_REFERENCE_ENTRY
 

Functions

VOID FASTCALL UserReferenceObject (PVOID obj)
 
PVOID FASTCALL UserReferenceObjectByHandle (HANDLE handle, HANDLE_TYPE type)
 
BOOL FASTCALL UserDereferenceObject (PVOID obj)
 
PVOID FASTCALL UserCreateObject (PUSER_HANDLE_TABLE ht, struct _DESKTOP *pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
 
BOOL FASTCALL UserDeleteObject (HANDLE h, HANDLE_TYPE type)
 
PVOID UserGetObject (PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
 
PVOID UserGetObjectNoErr (PUSER_HANDLE_TABLE, HANDLE, HANDLE_TYPE)
 
BOOL FASTCALL UserCreateHandleTable (VOID)
 
BOOL FASTCALL UserObjectInDestroy (HANDLE)
 
void DbgUserDumpHandleTable ()
 
PVOID FASTCALL ValidateHandle (HANDLE handle, HANDLE_TYPE type)
 
BOOLEAN UserDestroyObjectsForOwner (PUSER_HANDLE_TABLE Table, PVOID Owner)
 
BOOL FASTCALL UserMarkObjectDestroy (PVOID)
 
PVOID FASTCALL UserAssignmentLock (PVOID *ppvObj, PVOID pvNew)
 
PVOID FASTCALL UserAssignmentUnlock (PVOID *ppvObj)
 
static __inline VOID UserRefObjectCo (PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
 
static __inline VOID UserDerefObjectCo (PVOID obj)
 
void FreeProcMarkObject (_In_ PVOID Object)
 

Variables

PUSER_HANDLE_TABLE gHandleTable
 

Typedef Documentation

◆ PUSER_REFERENCE_ENTRY

◆ USER_REFERENCE_ENTRY

Function Documentation

◆ DbgUserDumpHandleTable()

void DbgUserDumpHandleTable ( )

◆ FreeProcMarkObject()

void FreeProcMarkObject ( _In_ PVOID  Object)

Definition at line 175 of file object.c.

177 {
178  PPROCESSINFO ppi = ((PPROCMARKHEAD)Object)->ppi;
179 
181 
182  ppi->UserHandleCount--;
184 }
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:44
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define IntDereferenceProcessInfo(ppi)
Definition: win32.h:186
struct _PROCMARKHEAD * PPROCMARKHEAD

Referenced by FreeCurIconObject().

◆ UserAssignmentLock()

PVOID FASTCALL UserAssignmentLock ( PVOID ppvObj,
PVOID  pvNew 
)

Definition at line 840 of file object.c.

841 {
842  PVOID pvOld = *ppvObj;
843  *ppvObj = pvNew;
844 
845  if (pvOld && pvOld == pvNew)
846  return pvOld;
847 
848  if (pvNew)
849  UserReferenceObject(pvNew);
850 
851  if (pvOld)
852  {
853  if (UserDereferenceObject(pvOld))
854  pvOld = NULL;
855  }
856 
857  return pvOld;
858 }
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
#define NULL
Definition: types.h:112
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731

Referenced by co_UserActivateKbl(), co_UserActivateKeyboardLayout(), InitThreadCallback(), IntCreateWindow(), IntImmActivateLayout(), IntTranslateKbdMessage(), NtUserSetThreadLayoutHandles(), and UserCreateInputContext().

◆ UserAssignmentUnlock()

PVOID FASTCALL UserAssignmentUnlock ( PVOID ppvObj)

Definition at line 861 of file object.c.

862 {
863  PVOID pvOld = *ppvObj;
864  *ppvObj = NULL;
865 
866  if (pvOld)
867  {
868  if (UserDereferenceObject(pvOld))
869  pvOld = NULL;
870  }
871 
872  return pvOld;
873 }
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
#define NULL
Definition: types.h:112

Referenced by co_UserFreeWindow(), ExitThreadCallback(), and IntWinStaObjectDelete().

◆ UserCreateHandleTable()

BOOL FASTCALL UserCreateHandleTable ( VOID  )

Definition at line 536 of file object.c.

537 {
538  PVOID mem;
539  INT HandleCount = 1024 * 4;
540 
541  // FIXME: Don't alloc all at once! Must be mapped into umode also...
542  mem = UserHeapAlloc(sizeof(USER_HANDLE_ENTRY) * HandleCount);
543  if (!mem)
544  {
545  ERR("Failed creating handle table\n");
546  return FALSE;
547  }
548 
550  if (gHandleTable == NULL)
551  {
552  UserHeapFree(mem);
553  ERR("Failed creating handle table\n");
554  return FALSE;
555  }
556 
557  // FIXME: Make auto growable
558  UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * HandleCount);
559 
560  return TRUE;
561 }
#define TRUE
Definition: types.h:120
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:44
static __inline PVOID UserHeapAlloc(SIZE_T Bytes)
Definition: usrheap.h:34
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
Definition: ntuser.h:16
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
VOID UserInitHandleTable(PUSER_HANDLE_TABLE ht, PVOID mem, ULONG bytes)
Definition: object.c:407
Definition: mem.c:156
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by InitUserImpl().

◆ UserCreateObject()

PVOID FASTCALL UserCreateObject ( PUSER_HANDLE_TABLE  ht,
struct _DESKTOP pDesktop,
PTHREADINFO  pti,
HANDLE h,
HANDLE_TYPE  type,
ULONG  size 
)

◆ UserDeleteObject()

BOOL FASTCALL UserDeleteObject ( HANDLE  h,
HANDLE_TYPE  type 
)

Definition at line 717 of file object.c.

718 {
720 
721  if (!body) return FALSE;
722 
723  ASSERT( ((PHEAD)body)->cLockObj >= 1);
724  ASSERT( ((PHEAD)body)->cLockObj < 0x10000);
725 
726  return UserFreeHandle(gHandleTable, h);
727 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FALSE
Definition: types.h:117
Definition: ntuser.h:179
#define ASSERT(a)
Definition: mode.c:44
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL FASTCALL UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:686
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by co_UserFreeWindow(), DestroyCallProc(), IntDestroyCurIconObject(), IntDestroyInputContext(), IntDestroyMenuObject(), IntDestroyMonitorObject(), IntEndDeferWindowPosEx(), IntFreeElementData(), IntFreeHook(), IntRemoveEvent(), NtUserCallOneParam(), NtUserConvertMemHandle(), NtUserCreateAcceleratorTable(), RemoveTimer(), UnloadKbdFile(), UserDestroyAccelTable(), UserDestroyInputContext(), UserLoadKbdFile(), UserLoadKbdLayout(), and UserUnloadKbl().

◆ UserDereferenceObject()

BOOL FASTCALL UserDereferenceObject ( PVOID  obj)

Definition at line 644 of file object.c.

645 {
646  PHEAD ObjHead = Object;
647 
648  ASSERT(ObjHead->cLockObj >= 1);
649  ASSERT(ObjHead->cLockObj < 0x10000);
650 
651  if (--ObjHead->cLockObj == 0)
652  {
655 
656  entry = handle_to_entry(gHandleTable, ObjHead->h);
657 
658  ASSERT(entry != NULL);
659  /* The entry should be marked as in deletion */
661 
662  type = entry->type;
663  ASSERT(type != TYPE_FREE);
665 
666  /* We can now get rid of everything */
668 
669 #if 0
670  /* Call the object destructor */
671  ASSERT(ObjectCallbacks[type].ObjectCleanup != NULL);
672  ObjectCallbacks[type].ObjectCleanup(Object);
673 #endif
674 
675  /* And free it */
677  ObjectCallbacks[type].ObjectFree(Object);
678 
679  return TRUE;
680  }
681  return FALSE;
682 }
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341
#define TRUE
Definition: types.h:120
static __inline void * free_user_entry(PUSER_HANDLE_TABLE ht, PUSER_HANDLE_ENTRY entry)
Definition: object.c:417
HANDLE h
Definition: ntuser.h:181
static const struct @4919 ObjectCallbacks[TYPE_CTYPES]
#define FALSE
Definition: types.h:117
void(* ObjectFree)(PVOID)
Definition: object.c:253
Definition: ntuser.h:179
Definition: ntuser.h:16
#define ASSERT(a)
Definition: mode.c:44
uint32_t entry
Definition: isohybrid.c:63
DWORD cLockObj
Definition: ntuser.h:182
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
enum _HANDLE_TYPE HANDLE_TYPE
#define NULL
Definition: types.h:112
#define HANDLEENTRY_INDESTROY
Definition: ntuser.h:14
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by _Success_(), co_UserCreateWindowEx(), co_UserFreeWindow(), co_UserSetParent(), co_WinPosSearchChildren(), CreateCallProc(), DefWndDoSizeMove(), DesktopWindowProc(), ExitThreadCallback(), FreeCurIconObject(), IntAddSynthesizedFormats(), IntCleanupCurIconCache(), IntCreateCurIconHandle(), IntCreateWindow(), IntDefWindowProc(), IntDestroyClass(), IntDestroyMonitorObject(), IntEndDeferWindowPosEx(), IntRemoveCursorFromList(), IntSetAconData(), IntSetOwner(), IntSynthesizeDib(), IntSystemSetCursor(), MENU_DrawBitmapItem(), MsqCleanupMessageQueue(), NtUserConvertMemHandle(), NtUserCreateAcceleratorTable(), NtUserDestroyCursor(), NtUserDrawIconEx(), NtUserGetCursorFrameInfo(), NtUserGetIconSize(), NtUserSetCursor(), NtUserSetWindowsHookEx(), NtUserSetWinEventHook(), NtUserUnhookWindowsHookEx(), RemoveTimer(), UserAssignmentLock(), UserAssignmentUnlock(), UserAttachThreadInput(), UserCreateInputContext(), UserCreateMenu(), UserDerefObjectCo(), UserDrawCaption(), UserDrawSysMenuButton(), UserFreeHandle(), UserLoadKbdFile(), UserLoadKbdLayout(), UserSetClassLongPtr(), and UserSetCursorIconData().

◆ UserDerefObjectCo()

static __inline VOID UserDerefObjectCo ( PVOID  obj)
static

Definition at line 40 of file object.h.

41 {
42  PTHREADINFO W32Thread;
43  PSINGLE_LIST_ENTRY ReferenceEntry;
44  PUSER_REFERENCE_ENTRY UserReferenceEntry;
45 
46  ASSERT(obj != NULL);
47  W32Thread = PsGetCurrentThreadWin32Thread();
48  ASSERT(W32Thread != NULL);
49  ReferenceEntry = PopEntryList(&W32Thread->ReferencesList);
50  ASSERT(ReferenceEntry != NULL);
51  UserReferenceEntry = CONTAINING_RECORD(ReferenceEntry, USER_REFERENCE_ENTRY, Entry);
52  ASSERT(UserReferenceEntry != NULL);
53 
54  ASSERT(obj == UserReferenceEntry->obj);
56 }
Definition: ntbasedef.h:628
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
PVOID obj
Definition: object.h:6
Definition: object.h:3
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
FORCEINLINE PSINGLE_LIST_ENTRY PopEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead)
Definition: rtlfuncs.h:240
#define ASSERT(a)
Definition: mode.c:44
BOOL FASTCALL UserDereferenceObject(PVOID obj)
Definition: object.c:644
#define NULL
Definition: types.h:112
SINGLE_LIST_ENTRY ReferencesList
Definition: win32.h:157
base of all file and directory entries
Definition: entries.h:82

Referenced by ActivateOtherWindowMin(), co_HOOK_CallHooks(), co_IntCreateDefaultImeWindow(), co_IntPaintWindows(), co_IntProcessKeyboardMessage(), co_IntSendActivateMessages(), co_IntSendDeactivateMessages(), co_IntSendMessageTimeoutSingle(), co_IntSendMessageWithCallBack(), co_IntUnloadKeyboardLayoutEx(), co_IntUpdateWindows(), co_UserActivateKeyboardLayout(), co_UserCreateWindowEx(), co_UserGetUpdateRect(), co_UserGetUpdateRgn(), co_UserSetParent(), co_VIS_WindowLayoutChanged(), co_WinPosActivateOtherWindow(), co_WinPosArrangeIconicWindows(), co_WinPosWindowFromPoint(), DefWndHandleSetCursor(), DefWndHandleSysCommand(), IntActivateWindow(), IntCheckImeShowStatus(), IntCreateWindow(), IntDeactivateWindow(), IntDefWindowProc(), IntDestroyOwnedWindows(), IntEndDeferWindowPosEx(), IntFocusSetInputContext(), IntImmActivateLayout(), IntNotifyWinEvent(), IntScrollWindowEx(), IntSendChildNCPaint(), IntSendFocusMessages(), IntSendMessageToUI(), IntSendOpenStatusNotify(), IntSendParentNotify(), MENU_EnsureMenuItemVisible(), MENU_ShowPopup(), NtGdiUpdateColors(), NtUserBeginPaint(), NtUserCallHwndLock(), NtUserCallHwndParam(), NtUserCallHwndParamLock(), NtUserDestroyWindow(), NtUserEnableScrollBar(), NtUserEndPaint(), NtUserFillWindow(), NtUserGetMenuBarInfo(), NtUserGetScrollBarInfo(), NtUserHideCaret(), NtUserMessageCall(), NtUserNotifyWinEvent(), NtUserRedrawWindow(), NtUserSBGetParms(), NtUserScrollWindowEx(), NtUserSetActiveWindow(), NtUserSetFocus(), NtUserSetInternalWindowPos(), NtUserSetMenu(), NtUserSetScrollBarInfo(), NtUserSetScrollInfo(), NtUserSetShellWindowEx(), NtUserSetWindowPlacement(), NtUserSetWindowPos(), NtUserShowCaret(), NtUserShowScrollBar(), NtUserShowWindow(), NtUserShowWindowAsync(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), NtUserWindowFromPoint(), SpiNotifyNCMetricsChanged(), and WinPosDoOwnedPopups().

◆ UserDestroyObjectsForOwner()

BOOLEAN UserDestroyObjectsForOwner ( PUSER_HANDLE_TABLE  Table,
PVOID  Owner 
)

Definition at line 754 of file object.c.

755 {
756  int i;
758  BOOLEAN Ret = TRUE;
759 
760  /* Sweep the whole handle table */
761  for (i = 0; i < Table->allocated_handles; i++)
762  {
763  Entry = &Table->handles[i];
764 
765  if (Entry->pi != Owner)
766  continue;
767 
768  /* Do not destroy if it's already been done */
769  if (Entry->flags & HANDLEENTRY_INDESTROY)
770  continue;
771 
772  /* Call destructor */
773  if (!ObjectCallbacks[Entry->type].ObjectDestroy(Entry->ptr))
774  {
775  ERR("Failed destructing object %p, type %u.\n", Entry->ptr, Entry->type);
776  /* Don't return immediately, we must continue destroying the other objects */
777  Ret = FALSE;
778  }
779  }
780 
781  return Ret;
782 }
ASMGENDATA Table[]
Definition: genincdata.c:61
struct _Entry Entry
Definition: kefuncs.h:629
#define TRUE
Definition: types.h:120
static const struct @4919 ObjectCallbacks[TYPE_CTYPES]
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
Definition: ntuser.h:16
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1597
#define HANDLEENTRY_INDESTROY
Definition: ntuser.h:14
base of all file and directory entries
Definition: entries.h:82

Referenced by ExitThreadCallback(), and UserProcessDestroy().

◆ UserGetObject()

PVOID UserGetObject ( PUSER_HANDLE_TABLE  ht,
HANDLE  handle,
HANDLE_TYPE  type 
)

Definition at line 495 of file object.c.

496 {
498 
499  ASSERT(ht);
500 
501  if (!(entry = handle_to_entry(ht, handle )) || entry->type != type)
502  {
504  return NULL;
505  }
506  return entry->ptr;
507 }
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
Definition: ntuser.h:16
#define ASSERT(a)
Definition: mode.c:44
uint32_t entry
Definition: isohybrid.c:63
static const struct newhuff ht[]
Definition: huffman.h:296
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:28

Referenced by co_HOOK_CallHooks(), IntCreateWindow(), IntDeferWindowPos(), IntEndDeferWindowPosEx(), IntGetHookObject(), IntImmProcessKey(), IntSetClassWndProc(), IntSetWindowProc(), IntSynthesizeBitmap(), NtUserCreateLocalMemHandle(), NtUserQueryInputContext(), NtUserUnhookWinEvent(), NtUserUpdateInputContext(), UserDeleteObject(), UserGetAccelObject(), UserGetCallProcInfo(), UserGetMenuObject(), UserGetMonitorObject(), UserGetWindowObject(), and UserReferenceObjectByHandle().

◆ UserGetObjectNoErr()

PVOID UserGetObjectNoErr ( PUSER_HANDLE_TABLE  ,
HANDLE  ,
HANDLE_TYPE   
)

Definition at line 481 of file object.c.

482 {
484 
485  ASSERT(ht);
486 
487  if (!(entry = handle_to_entry(ht, handle )) || entry->type != type)
488  {
489  return NULL;
490  }
491  return entry->ptr;
492 }
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341
Definition: ntuser.h:16
#define ASSERT(a)
Definition: mode.c:44
uint32_t entry
Definition: isohybrid.c:63
static const struct newhuff ht[]
Definition: huffman.h:296
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by IntDestroyInputContext(), NC_IconForWindow(), NtUserAssociateInputContext(), NtUserDestroyInputContext(), NtUserSetCursor(), and ValidateHwndNoErr().

◆ UserMarkObjectDestroy()

BOOL FASTCALL UserMarkObjectDestroy ( PVOID  )

Definition at line 621 of file object.c.

622 {
624  PHEAD ObjHead = Object;
625 
626  entry = handle_to_entry(gHandleTable, ObjHead->h);
627 
628  ASSERT(entry != NULL);
629 
630  entry->flags |= HANDLEENTRY_DESTROY;
631 
632  if (ObjHead->cLockObj > 1)
633  {
634  entry->flags &= ~HANDLEENTRY_INDESTROY;
635  TRACE("Count %d\n",ObjHead->cLockObj);
636  return FALSE;
637  }
638 
639  return TRUE;
640 }
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341
#define TRUE
Definition: types.h:120
HANDLE h
Definition: ntuser.h:181
#define FALSE
Definition: types.h:117
Definition: ntuser.h:179
Definition: ntuser.h:16
#define TRACE(s)
Definition: solgame.cpp:4
#define ASSERT(a)
Definition: mode.c:44
uint32_t entry
Definition: isohybrid.c:63
DWORD cLockObj
Definition: ntuser.h:182
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define HANDLEENTRY_DESTROY
Definition: ntuser.h:13
#define NULL
Definition: types.h:112
#define HANDLEENTRY_INDESTROY
Definition: ntuser.h:14
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by co_IntUnloadKeyboardLayoutEx(), co_UserFreeWindow(), IntDestroyMenuObject(), and UserDestroyInputContext().

◆ UserObjectInDestroy()

BOOL FASTCALL UserObjectInDestroy ( HANDLE  )

Definition at line 703 of file object.c.

704 {
706 
707  if (!(entry = handle_to_entry( gHandleTable, h )))
708  {
710  return TRUE;
711  }
712  return (entry->flags & HANDLEENTRY_INDESTROY);
713 }
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:245
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: ntuser.h:16
uint32_t entry
Definition: isohybrid.c:63
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:37
#define HANDLEENTRY_INDESTROY
Definition: ntuser.h:14
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by co_CallHook(), IntDestroyClass(), IntSetMenuItemInfo(), NtUserSetCursor(), UserAttachThreadInput(), UserGetCurIconObject(), VerifyMenu(), and VerifyWnd().

◆ UserReferenceObject()

◆ UserReferenceObjectByHandle()

PVOID FASTCALL UserReferenceObjectByHandle ( HANDLE  handle,
HANDLE_TYPE  type 
)

Definition at line 741 of file object.c.

742 {
743  PVOID object;
744 
746  if (object)
747  {
748  UserReferenceObject(object);
749  }
750  return object;
751 }
coclass MSXML2::XSLTemplate40 object
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731

Referenced by UserGetCurIconObject().

◆ UserRefObjectCo()

static __inline VOID UserRefObjectCo ( PVOID  obj,
PUSER_REFERENCE_ENTRY  UserReferenceEntry 
)
static

Definition at line 27 of file object.h.

28 {
29  PTHREADINFO W32Thread;
30 
31  W32Thread = PsGetCurrentThreadWin32Thread();
32  ASSERT(W32Thread != NULL);
33  ASSERT(UserReferenceEntry != NULL);
34  UserReferenceEntry->obj = obj;
36  PushEntryList(&W32Thread->ReferencesList, &UserReferenceEntry->Entry);
37 }
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
FORCEINLINE VOID PushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
Definition: rtlfuncs.h:253
PVOID obj
Definition: object.h:6
#define ASSERT(a)
Definition: mode.c:44
SINGLE_LIST_ENTRY Entry
Definition: object.h:5
#define NULL
Definition: types.h:112
SINGLE_LIST_ENTRY ReferencesList
Definition: win32.h:157
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731

Referenced by ActivateOtherWindowMin(), co_HOOK_CallHooks(), co_IntCreateDefaultImeWindow(), co_IntPaintWindows(), co_IntProcessKeyboardMessage(), co_IntSendActivateMessages(), co_IntSendDeactivateMessages(), co_IntSendMessageTimeoutSingle(), co_IntSendMessageWithCallBack(), co_IntUnloadKeyboardLayoutEx(), co_IntUpdateWindows(), co_UserActivateKeyboardLayout(), co_UserCreateWindowEx(), co_UserGetUpdateRect(), co_UserGetUpdateRgn(), co_UserSetParent(), co_VIS_WindowLayoutChanged(), co_WinPosActivateOtherWindow(), co_WinPosArrangeIconicWindows(), co_WinPosWindowFromPoint(), DefWndHandleSetCursor(), DefWndHandleSysCommand(), IntActivateWindow(), IntCheckImeShowStatus(), IntCreateWindow(), IntDeactivateWindow(), IntDefWindowProc(), IntDestroyOwnedWindows(), IntEndDeferWindowPosEx(), IntFocusSetInputContext(), IntImmActivateLayout(), IntNotifyWinEvent(), IntScrollWindowEx(), IntSendChildNCPaint(), IntSendFocusMessages(), IntSendMessageToUI(), IntSendOpenStatusNotify(), IntSendParentNotify(), MENU_EnsureMenuItemVisible(), MENU_ShowPopup(), NtGdiUpdateColors(), NtUserBeginPaint(), NtUserCallHwndLock(), NtUserCallHwndParam(), NtUserCallHwndParamLock(), NtUserDestroyWindow(), NtUserEnableScrollBar(), NtUserEndPaint(), NtUserFillWindow(), NtUserGetMenuBarInfo(), NtUserGetScrollBarInfo(), NtUserHideCaret(), NtUserMessageCall(), NtUserNotifyWinEvent(), NtUserRedrawWindow(), NtUserSBGetParms(), NtUserScrollWindowEx(), NtUserSetActiveWindow(), NtUserSetFocus(), NtUserSetInternalWindowPos(), NtUserSetMenu(), NtUserSetScrollBarInfo(), NtUserSetScrollInfo(), NtUserSetShellWindowEx(), NtUserSetWindowPlacement(), NtUserSetWindowPos(), NtUserShowCaret(), NtUserShowScrollBar(), NtUserShowWindow(), NtUserShowWindowAsync(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), NtUserWindowFromPoint(), SpiNotifyNCMetricsChanged(), and WinPosDoOwnedPopups().

◆ ValidateHandle()

PVOID FASTCALL ValidateHandle ( HANDLE  handle,
HANDLE_TYPE  type 
)

Variable Documentation

◆ gHandleTable

PUSER_HANDLE_TABLE gHandleTable

Definition at line 13 of file object.c.