71 pti->acExclusiveLockCount[((
ULONG_PTR)hobj >> 16) & 0x1f]++;
87 pti->acExclusiveLockCount[((
ULONG_PTR)hobj >> 16) & 0x1f]--;
110#define ASSERT_SHARED_OBJECT_TYPE(objt) \
111 ASSERT((objt) == GDIObjType_SURF_TYPE || \
112 (objt) == GDIObjType_PAL_TYPE || \
113 (objt) == GDIObjType_LFONT_TYPE || \
114 (objt) == GDIObjType_PATH_TYPE || \
115 (objt) == GDIObjType_BRUSH_TYPE)
116#define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt) \
117 ASSERT((objt) == GDIObjType_DC_TYPE || \
118 (objt) == GDIObjType_RGN_TYPE || \
119 (objt) == GDIObjType_UMPD_TYPE || \
120 (objt) == GDIObjType_META_TYPE)
121#define ASSERT_TRYLOCK_OBJECT_TYPE(objt) \
122 ASSERT((objt) == GDIObjType_DRVOBJ_TYPE)
124#define ASSERT_LOCK_ORDER(hobj)
125#define ASSERT_SHARED_OBJECT_TYPE(objt)
126#define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt)
127#define ASSERT_TRYLOCK_OBJECT_TYPE(objt)
130#if defined(_M_IX86) || defined(_M_AMD64)
131#define InterlockedOr16 _InterlockedOr16
134#define GDIOBJ_POOL_TAG(type) ('00hG' + (((type) & 0x1f) << 24))
278 DPRINT1(
"INITGDI: Could not allocate a GDI handle table.\n");
288 DPRINT1(
"INITGDI: Failed to map handle table section\n");
300 DPRINT1(
"INITGDI: Failed to allocate reference table.\n");
384 ULONG iFirst, iNext, iPrev;
387 DPRINT(
"Enter InterLockedPopFreeEntry\n");
403 DPRINT1(
"No more GDI handles left!\n");
404#if DBG_ENABLE_GDIOBJ_BACKTRACES
405 DbgDumpGdiHandleTableWithBT();
420 iNext |= (iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000;
427 while (iPrev != iFirst);
441 ULONG iToFree, iFirst, iPrev, idxToFree;
443 DPRINT(
"Enter ENTRY_vPushFreeEntry\n");
466 iToFree = idxToFree | ((iFirst & ~GDI_HANDLE_INDEX_MASK) + 0x10000);
473 while (iPrev != iFirst);
480 ULONG ulIndex, cNewRefs, cOldRefs;
497 DPRINT(
"GDIOBJ: Slot is not valid: 0x%lx, hobh=%p\n", cOldRefs, hobj);
504 DPRINT(
"GDIOBJ: Wrong unique value. Handle: 0x%4x, entry: 0x%4x\n",
514 DPRINT(
"GDIOBJ: Cannot reference foreign handle %p, pentry=%p:%lx.\n",
520 cNewRefs = cOldRefs + 1;
525 while (cNewRefs != cOldRefs + 1);
548 pentry->
Objt = objt & 0x1f;
577 if (!pobj)
return NULL;
587#if DBG_ENABLE_GDIOBJ_BACKTRACES
633 ULONG cRefs, ulIndex;
700 if ((((
ULONG_PTR)hobj >> 16) & 0x1f) != objt)
702 DPRINT(
"GDIOBJ: Wrong type. handle=%p, type=%x\n", hobj, objt);
710 DPRINT(
"GDIOBJ: Requested handle 0x%p is not valid.\n", hobj);
720 DPRINT1(
"GDIOBJ: Cannot reference object %p with exclusive lock.\n", hobj);
767 if ((((
ULONG_PTR)hobj >> 16) & 0x1f) != objt)
769 DPRINT(
"Wrong object type: hobj=0x%p, objt=0x%x\n", hobj, objt);
780 DPRINT(
"GDIOBJ: Requested handle 0x%p is not valid.\n", hobj);
795 ULONG cRefs, ulIndex;
836 if ((((
ULONG_PTR)hobj >> 16) & 0x1f) != objt)
838 DPRINT(
"Wrong object type: hobj=0x%p, objt=0x%x\n", hobj, objt);
849 DPRINT(
"GDIOBJ: Requested handle 0x%p is not valid.\n", hobj);
882 ULONG cRefs, ulIndex;
928 DPRINT1(
"GDIOBJ: Could not get a free entry.\n");
958 DPRINT(
"GDIOBJ: Created handle: %p\n", pobj->
hHmgr);
975 DPRINT(
"Trying to set ownership of stock object %p to %lx\n", pobj->
hHmgr, ulNewOwner);
985 if (ulOldOwner == ulNewOwner)
1037 UINT auiIndices[3] = {0, 1, 2};
1043 for (
i = 0;
i < ulCount - 1;
i++)
1045 for (
j =
i + 1;
j < ulCount;
j++)
1050 tmp = auiIndices[
i];
1051 auiIndices[
i] = auiIndices[
j];
1052 auiIndices[
j] = tmp;
1058 for (
i = 0;
i < ulCount;
i++)
1061 if (ahObj[auiIndices[
i]] ==
NULL)
1063 apObj[auiIndices[
i]] =
NULL;
1071 if (apObj[auiIndices[
i]] ==
NULL)
1076 if (apObj[auiIndices[
i]])
1151 if (!pentry)
return FALSE;
1165 DPRINT1(
"GreDeleteObject: Cannot delete stock object %p.\n", hobj);
1173 DPRINT1(
"GreDeleteObject: Trying to delete invalid object %p\n", hobj);
1180 DPRINT1(
"GreDeleteObject: Trying to delete global object %p\n", hobj);
1194 ULONG ulIndex, ulOwner;
1204 DPRINT1(
"GreGetObjectOwner: invalid handle 0x%p.\n", hobj);
1232 DPRINT(
"GreSetObjectOwner: Got stock object %p\n", hobj);
1240 DPRINT(
"GreSetObjectOwner: Invalid handle 0x%p.\n", hobj);
1280 DPRINT1(
"GreGetObject: Invalid object type\n");
1287 DPRINT(
"GreGetObject: Could not lock object\n");
1315 DPRINT1(
"GDI object type of 0x%p not implemented\n", hobj);
1328 IN INT cjBufferSize,
1331 UINT iResult, cjMaxSize;
1344 cjMaxSize =
min((
UINT)cjBufferSize,
sizeof(
object));
1356 cjMaxSize =
min(cjMaxSize, iResult);
1387 DPRINT1(
"NtGdiCreateClientObj: Invalid object type 0x%lx.\n",
ulType);
1397 DPRINT1(
"NtGdiCreateClientObj: Could not allocate a clientobj.\n");
1408 DPRINT1(
"NtGdiCreateClientObj: Could not create a handle.\n");
1464 DPRINT1(
"GDIOBJ: Requested handle 0x%p is not valid.\n", *phObj);
1479 *phObj = pobj->
hHmgr;
1498 DPRINT1(
"GDIOBJ: Requested handle 0x%p is not valid.\n", *phObj);
1513 *phObj = pobj->
hHmgr;
1578 return pvMappedView;
1589 DPRINT(
"CleanupForProcess prochandle %p Pid %p\n",
1618 DPRINT(
"Completed cleanup for process %p\n",
Process->UniqueProcessId);
1619 if (ppi->GDIHandleCount != 0)
1621 DPRINT1(
"Leaking %d handles!\n", ppi->GDIHandleCount);
1633 DPRINT1(
"Leaking object. Index=%lx, type=0x%x, refcount=%lx\n",
NTSTATUS NTAPI MmMapViewInSessionSpace(IN PVOID Section, OUT PVOID *MappedBase, IN OUT PSIZE_T ViewSize)
#define InterlockedIncrement
#define InterlockedDecrement
#define UlongToHandle(ul)
INT APIENTRY BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer)
VOID NTAPI BRUSH_vDeleteObject(PVOID pvObject)
INT FASTCALL BRUSH_GetObject(PBRUSH pbr, INT cjBuffer, LPLOGBRUSH plbBuffer)
PGDI_POOL GetBrushAttrPool(VOID)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
VOID NTAPI DC_vCleanup(PVOID ObjectBody)
#define NT_SUCCESS(StatCode)
VOID NTAPI DRIVEROBJ_vCleanup(PVOID pObject)
DRIVEROBJ cleanup function.
#define ExAllocatePoolWithTag(hernya, size, tag)
#define ExInitializePushLock
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
FORCEINLINE VOID ExReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define GDI_OBJECT_TYPE_DONTCARE
#define GDI_HANDLE_STOCK_MASK
#define GDI_HANDLE_GET_INDEX(h)
#define GDI_HANDLE_GET_TYPE(h)
#define GDI_HANDLE_BASETYPE_MASK
#define GDI_HANDLE_INDEX_MASK
#define GDI_HANDLE_IS_STOCKOBJ(h)
@ GDILoObjType_LO_FONT_TYPE
@ GDILoObjType_LO_PALETTE_TYPE
@ GDILoObjType_LO_CLIENTOBJ_TYPE
@ GDILoObjType_LO_BRUSH_TYPE
@ GDILoObjType_LO_BITMAP_TYPE
@ GDILoObjType_LO_METAFILE_TYPE
@ GDILoObjType_LO_METADC16_TYPE
@ GDILoObjType_LO_EXTPEN_TYPE
@ GDILoObjType_LO_METAFILE16_TYPE
@ GDILoObjType_LO_PEN_TYPE
#define DBG_LOGEVENT(pslh, type, val)
#define DBG_CLEANUP_EVENT_LIST(pslh)
#define DBG_DUMP_EVENT_LIST(pslh)
#define DBG_INITLOG(pslh)
BOOL NTAPI DbgGdiHTIntegrityCheck(VOID)
ULONG NTAPI DbgCaptureStackBackTace(_Out_writes_(cFramesToCapture) PVOID *ppvFrames, _In_ ULONG cFramesToSkip, _In_ ULONG cFramesToCapture)
VOID(NTAPI * GDICLEANUPPROC)(PVOID ObjectBody)
#define GDI_OBJECT_STACK_LEVELS
static const unsigned RESERVE_ENTRIES_COUNT
VOID(NTAPI * GDIOBJDELETEPROC)(PVOID ObjectBody)
struct _GDI_HANDLE_TABLE GDI_HANDLE_TABLE
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
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 GLint GLint j
#define EXCEPTION_EXECUTE_HANDLER
#define InterlockedExchangeAdd
#define InterlockedCompareExchange
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
VOID NTAPI ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
#define ExFreePoolWithTag(_P, _T)
#define __analysis_assume(expr)
#define _Interlocked_operand_
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
#define SECTION_ALL_ACCESS
#define DBG_UNREFERENCED_PARAMETER(P)
#define GDI_OBJ_HMGR_POWNED
#define GDI_OBJ_HMGR_PUBLIC
#define GDI_ENTRY_STOCK_MASK
#define GDI_OBJ_HMGR_RESTRICTED
#define GDI_OBJ_HMGR_NONE
@ GDIObjType_CLIENTOBJ_TYPE
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
NTSTATUS NTAPI PsLookupProcessByProcessId(IN HANDLE ProcessId, OUT PEPROCESS *Process)
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
HANDLE NTAPI PsGetCurrentProcessId(VOID)
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
#define _SEH2_EXCEPT(...)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
NTSTATUS NTAPI MmCreateSection(OUT PVOID *Section, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL, IN PFILE_OBJECT FileObject OPTIONAL)
union _ENTRY::_OBJECTOWNER ObjectOwner
union _ENTRY::_EINFO einfo
struct _GDI_POOL * pPoolBrushAttr
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
struct _BASEOBJECT * pobj
_In_z_ PCWSTR _In_ ULONG ulType
VOID NTAPI SURFACE_vCleanup(PVOID ObjectBody)
ULONG FASTCALL FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
volatile ULONG gulFirstUnused
static VOID InitLookasideList(UCHAR objt, ULONG cjSize)
volatile ULONG gulFirstFree
static PENTRY ENTRY_pentPopFreeEntry(VOID)
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
POBJ NTAPI GDIOBJ_ReferenceObjectByHandle(HGDIOBJ hobj, UCHAR objt)
VOID NTAPI GDIOBJ_vDereferenceObject(POBJ pobj)
PVOID NTAPI GDIOBJ_pvGetObjectAttr(POBJ pobj)
static PVOID gpvGdiHdlTblSection
BOOL NTAPI GreSetObjectOwnerEx(HGDIOBJ hobj, ULONG ulOwner, ULONG Flags)
BOOL NTAPI GDIOBJ_ConvertFromStockObj(HGDIOBJ *phObj)
FORCEINLINE ULONG InterlockedReadUlong(_In_ _Interlocked_operand_ ULONG volatile *Source)
static VOID IncrementGdiHandleCount(ULONG ulProcessId)
static VOID NTAPI GDIOBJ_vCleanup(PVOID ObjectBody)
VOID NTAPI GDIOBJ_vFreeObject(POBJ pobj)
static PPAGED_LOOKASIDE_LIST gpaLookasideList
W32KAPI INT APIENTRY NtGdiExtGetObjectW(IN HANDLE hobj, IN INT cjBufferSize, OUT LPVOID lpBuffer)
FORCEINLINE void INCREASE_THREAD_LOCK_COUNT(_In_ HANDLE hobj)
W32KAPI BOOL APIENTRY NtGdiDeleteClientObj(IN HANDLE hobj)
HGDIOBJ NTAPI GDIOBJ_hInsertObject(POBJ pobj, ULONG ulOwner)
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
FORCEINLINE void DECREASE_THREAD_LOCK_COUNT(_In_ HANDLE hobj)
static HGDIOBJ ENTRY_hInsertObject(PENTRY pentry, POBJ pobj, UCHAR objt, ULONG ulOwner)
static VOID DecrementGdiHandleCount(ULONG ulProcessId)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
BOOL NTAPI GDI_CleanupForProcess(struct _EPROCESS *Process)
VOID NTAPI GDIOBJ_vSetObjectOwner(POBJ pobj, ULONG ulNewOwner)
#define GDIOBJ_POOL_TAG(type)
#define ASSERT_SHARED_OBJECT_TYPE(objt)
PGDIOBJ NTAPI GDIOBJ_LockObject(HGDIOBJ hobj, UCHAR objt)
ULONG NTAPI GreGetObjectOwner(HGDIOBJ hobj)
static const GDICLEANUPPROC apfnCleanup[]
NTSTATUS NTAPI InitGdiHandleTable(void)
static const GDIOBJDELETEPROC apfnDelete[]
FORCEINLINE VOID IncrementCurrentProcessGdiHandleCount(void)
POBJ NTAPI GDIOBJ_AllocateObject(UCHAR objt, ULONG cjSize, FLONG fl)
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
PVOID NTAPI GDI_MapHandleTable(PEPROCESS pProcess)
static VOID ENTRY_vPushFreeEntry(PENTRY pentFree)
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
PGDIOBJ NTAPI GDIOBJ_ShareLockObj(HGDIOBJ hObj, DWORD ExpectedType)
W32KAPI HANDLE APIENTRY NtGdiCreateClientObj(IN ULONG ulType)
INT NTAPI GreGetObject(IN HGDIOBJ hobj, IN INT cbCount, OUT PVOID pvBuffer)
#define ASSERT_TRYLOCK_OBJECT_TYPE(objt)
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
PGDI_HANDLE_TABLE GdiHandleTable
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
FORCEINLINE VOID DecrementCurrentProcessGdiHandleCount(void)
#define ASSERT_LOCK_ORDER(hobj)
#define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt)
PGDIOBJ NTAPI GDIOBJ_TryLockObject(HGDIOBJ hobj, UCHAR objt)
static PENTRY ENTRY_ReferenceEntryByHandle(HGDIOBJ hobj, FLONG fl)
VOID NTAPI GDIOBJ_vReferenceObjectByPointer(POBJ pobj)
FORCEINLINE BOOLEAN ExTryAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
INT FASTCALL PALETTE_GetObject(PPALETTE ppal, INT cbCount, LPLOGBRUSH lpBuffer)
VOID NTAPI PALETTE_vCleanup(PVOID ObjectBody)
INT APIENTRY PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer)
VOID NTAPI REGION_vCleanup(PVOID ObjectBody)
_Must_inspect_result_ _In_ ULONG Flags
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
#define ObDereferenceObject
#define PsGetCurrentProcess