mirror of
https://github.com/reactos/reactos.git
synced 2024-12-01 07:23:33 +08:00
60 lines
2.0 KiB
C
60 lines
2.0 KiB
C
#pragma once
|
|
|
|
typedef struct _USER_REFERENCE_ENTRY
|
|
{
|
|
SINGLE_LIST_ENTRY Entry;
|
|
PVOID obj;
|
|
} USER_REFERENCE_ENTRY, *PUSER_REFERENCE_ENTRY;
|
|
|
|
extern PUSER_HANDLE_TABLE gHandleTable;
|
|
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);
|
|
|
|
static __inline VOID
|
|
UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
|
|
{
|
|
PTHREADINFO W32Thread;
|
|
|
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
|
ASSERT(W32Thread != NULL);
|
|
ASSERT(UserReferenceEntry != NULL);
|
|
UserReferenceEntry->obj = obj;
|
|
UserReferenceObject(obj);
|
|
PushEntryList(&W32Thread->ReferencesList, &UserReferenceEntry->Entry);
|
|
}
|
|
|
|
static __inline VOID
|
|
UserDerefObjectCo(PVOID obj)
|
|
{
|
|
PTHREADINFO W32Thread;
|
|
PSINGLE_LIST_ENTRY ReferenceEntry;
|
|
PUSER_REFERENCE_ENTRY UserReferenceEntry;
|
|
UNREFERENCED_LOCAL_VARIABLE(UserReferenceEntry);
|
|
|
|
ASSERT(obj != NULL);
|
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
|
ASSERT(W32Thread != NULL);
|
|
ReferenceEntry = PopEntryList(&W32Thread->ReferencesList);
|
|
ASSERT(ReferenceEntry != NULL);
|
|
UserReferenceEntry = CONTAINING_RECORD(ReferenceEntry, USER_REFERENCE_ENTRY, Entry);
|
|
ASSERT(UserReferenceEntry != NULL);
|
|
|
|
ASSERT(obj == UserReferenceEntry->obj);
|
|
UserDereferenceObject(obj);
|
|
}
|
|
|
|
void FreeProcMarkObject(_In_ PVOID Object);
|
|
|
|
/* EOF */
|