Process Hacker
handlep.h File Reference

Go to the source code of this file.

Data Structures

struct  _PH_HANDLE_TABLE
 

Macros

#define PH_HANDLE_TABLE_ENTRY_TYPE   0x1
 
#define PH_HANDLE_TABLE_ENTRY_IN_USE   0x0
 
#define PH_HANDLE_TABLE_ENTRY_FREE   0x1
 
#define PH_HANDLE_TABLE_ENTRY_LOCKED   0x2
 
#define PH_HANDLE_TABLE_ENTRY_LOCKED_SHIFT   1
 
#define PH_HANDLE_TABLE_LEVEL_ENTRIES   256
 
#define PH_HANDLE_TABLE_LEVEL_MASK   0x3
 
#define PH_HANDLE_TABLE_LOCKS   8
 
#define PH_HANDLE_TABLE_LOCK_INDEX(HandleValue)   ((HandleValue) % PH_HANDLE_TABLE_LOCKS)
 
#define PH_HANDLE_VALUE_INVALID   ((ULONG)-1)
 
#define PH_HANDLE_VALUE_SHIFT   2
 
#define PH_HANDLE_VALUE_BIAS   4
 
#define PH_HANDLE_VALUE_LEVEL0(HandleValue)   ((HandleValue) & 0xff)
 
#define PH_HANDLE_VALUE_LEVEL1_U(HandleValue)   ((HandleValue) >> 8)
 
#define PH_HANDLE_VALUE_LEVEL1(HandleValue)   (PH_HANDLE_VALUE_LEVEL1_U(HandleValue) & 0xff)
 
#define PH_HANDLE_VALUE_LEVEL2_U(HandleValue)   ((HandleValue) >> 16)
 
#define PH_HANDLE_VALUE_LEVEL2(HandleValue)   (PH_HANDLE_VALUE_LEVEL2_U(HandleValue) & 0xff)
 
#define PH_HANDLE_VALUE_IS_INVALID(HandleValue)   (((HandleValue) >> 24) != 0)
 

Typedefs

typedef struct _PH_HANDLE_TABLE PH_HANDLE_TABLE
 
typedef struct _PH_HANDLE_TABLEPPH_HANDLE_TABLE
 

Functions

FORCEINLINE VOID PhpLockHandleTableShared (_Inout_ PPH_HANDLE_TABLE HandleTable, _In_ ULONG Index)
 
FORCEINLINE VOID PhpUnlockHandleTableShared (_Inout_ PPH_HANDLE_TABLE HandleTable, _In_ ULONG Index)
 
FORCEINLINE HANDLE PhpEncodeHandle (_In_ ULONG HandleValue)
 
FORCEINLINE ULONG PhpDecodeHandle (_In_ HANDLE Handle)
 
VOID PhpBlockOnLockedHandleTableEntry (_Inout_ PPH_HANDLE_TABLE HandleTable, _In_ PPH_HANDLE_TABLE_ENTRY HandleTableEntry)
 
PPH_HANDLE_TABLE_ENTRY PhpAllocateHandleTableEntry (_Inout_ PPH_HANDLE_TABLE HandleTable, _Out_ PULONG HandleValue)
 
VOID PhpFreeHandleTableEntry (_Inout_ PPH_HANDLE_TABLE HandleTable, _In_ ULONG HandleValue, _Inout_ PPH_HANDLE_TABLE_ENTRY HandleTableEntry)
 
BOOLEAN PhpAllocateMoreHandleTableEntries (_In_ PPH_HANDLE_TABLE HandleTable, _In_ BOOLEAN Initialize)
 
PPH_HANDLE_TABLE_ENTRY PhpLookupHandleTableEntry (_In_ PPH_HANDLE_TABLE HandleTable, _In_ ULONG HandleValue)
 
ULONG PhpMoveFreeHandleTableEntries (_Inout_ PPH_HANDLE_TABLE HandleTable)
 
PPH_HANDLE_TABLE_ENTRY PhpCreateHandleTableLevel0 (_In_ PPH_HANDLE_TABLE HandleTable, _In_ BOOLEAN Initialize)
 
VOID PhpFreeHandleTableLevel0 (_In_ PPH_HANDLE_TABLE_ENTRY Table)
 
PPH_HANDLE_TABLE_ENTRYPhpCreateHandleTableLevel1 (_In_ PPH_HANDLE_TABLE HandleTable)
 
VOID PhpFreeHandleTableLevel1 (_In_ PPH_HANDLE_TABLE_ENTRY *Table)
 
PPH_HANDLE_TABLE_ENTRY ** PhpCreateHandleTableLevel2 (_In_ PPH_HANDLE_TABLE HandleTable)
 
VOID PhpFreeHandleTableLevel2 (_In_ PPH_HANDLE_TABLE_ENTRY **Table)
 

Macro Definition Documentation

#define PH_HANDLE_TABLE_ENTRY_FREE   0x1

Definition at line 6 of file handlep.h.

#define PH_HANDLE_TABLE_ENTRY_IN_USE   0x0

Definition at line 5 of file handlep.h.

#define PH_HANDLE_TABLE_ENTRY_LOCKED   0x2

Definition at line 11 of file handlep.h.

#define PH_HANDLE_TABLE_ENTRY_LOCKED_SHIFT   1

Definition at line 12 of file handlep.h.

#define PH_HANDLE_TABLE_ENTRY_TYPE   0x1

Definition at line 4 of file handlep.h.

#define PH_HANDLE_TABLE_LEVEL_ENTRIES   256

Definition at line 25 of file handlep.h.

#define PH_HANDLE_TABLE_LEVEL_MASK   0x3

Definition at line 26 of file handlep.h.

#define PH_HANDLE_TABLE_LOCK_INDEX (   HandleValue)    ((HandleValue) % PH_HANDLE_TABLE_LOCKS)

Definition at line 29 of file handlep.h.

#define PH_HANDLE_TABLE_LOCKS   8

Definition at line 28 of file handlep.h.

#define PH_HANDLE_VALUE_BIAS   4

Definition at line 73 of file handlep.h.

#define PH_HANDLE_VALUE_INVALID   ((ULONG)-1)

Definition at line 71 of file handlep.h.

#define PH_HANDLE_VALUE_IS_INVALID (   HandleValue)    (((HandleValue) >> 24) != 0)

Definition at line 80 of file handlep.h.

#define PH_HANDLE_VALUE_LEVEL0 (   HandleValue)    ((HandleValue) & 0xff)

Definition at line 75 of file handlep.h.

#define PH_HANDLE_VALUE_LEVEL1 (   HandleValue)    (PH_HANDLE_VALUE_LEVEL1_U(HandleValue) & 0xff)

Definition at line 77 of file handlep.h.

#define PH_HANDLE_VALUE_LEVEL1_U (   HandleValue)    ((HandleValue) >> 8)

Definition at line 76 of file handlep.h.

#define PH_HANDLE_VALUE_LEVEL2 (   HandleValue)    (PH_HANDLE_VALUE_LEVEL2_U(HandleValue) & 0xff)

Definition at line 79 of file handlep.h.

#define PH_HANDLE_VALUE_LEVEL2_U (   HandleValue)    ((HandleValue) >> 16)

Definition at line 78 of file handlep.h.

#define PH_HANDLE_VALUE_SHIFT   2

Definition at line 72 of file handlep.h.

Typedef Documentation

Function Documentation

PPH_HANDLE_TABLE_ENTRY PhpAllocateHandleTableEntry ( _Inout_ PPH_HANDLE_TABLE  HandleTable,
_Out_ PULONG  HandleValue 
)

Definition at line 477 of file handle.c.

BOOLEAN PhpAllocateMoreHandleTableEntries ( _In_ PPH_HANDLE_TABLE  HandleTable,
_In_ BOOLEAN  Initialize 
)

Definition at line 641 of file handle.c.

VOID PhpBlockOnLockedHandleTableEntry ( _Inout_ PPH_HANDLE_TABLE  HandleTable,
_In_ PPH_HANDLE_TABLE_ENTRY  HandleTableEntry 
)

Definition at line 166 of file handle.c.

PPH_HANDLE_TABLE_ENTRY PhpCreateHandleTableLevel0 ( _In_ PPH_HANDLE_TABLE  HandleTable,
_In_ BOOLEAN  Initialize 
)

Definition at line 1014 of file handle.c.

PPH_HANDLE_TABLE_ENTRY* PhpCreateHandleTableLevel1 ( _In_ PPH_HANDLE_TABLE  HandleTable)

Definition at line 1063 of file handle.c.

PPH_HANDLE_TABLE_ENTRY** PhpCreateHandleTableLevel2 ( _In_ PPH_HANDLE_TABLE  HandleTable)

Definition at line 1094 of file handle.c.

FORCEINLINE ULONG PhpDecodeHandle ( _In_ HANDLE  Handle)

Definition at line 89 of file handlep.h.

FORCEINLINE HANDLE PhpEncodeHandle ( _In_ ULONG  HandleValue)

Definition at line 82 of file handlep.h.

VOID PhpFreeHandleTableEntry ( _Inout_ PPH_HANDLE_TABLE  HandleTable,
_In_ ULONG  HandleValue,
_Inout_ PPH_HANDLE_TABLE_ENTRY  HandleTableEntry 
)

Definition at line 596 of file handle.c.

VOID PhpFreeHandleTableLevel0 ( _In_ PPH_HANDLE_TABLE_ENTRY  Table)

Definition at line 1056 of file handle.c.

VOID PhpFreeHandleTableLevel1 ( _In_ PPH_HANDLE_TABLE_ENTRY Table)

Definition at line 1087 of file handle.c.

VOID PhpFreeHandleTableLevel2 ( _In_ PPH_HANDLE_TABLE_ENTRY **  Table)

Definition at line 1114 of file handle.c.

FORCEINLINE VOID PhpLockHandleTableShared ( _Inout_ PPH_HANDLE_TABLE  HandleTable,
_In_ ULONG  Index 
)

Definition at line 47 of file handlep.h.

PPH_HANDLE_TABLE_ENTRY PhpLookupHandleTableEntry ( _In_ PPH_HANDLE_TABLE  HandleTable,
_In_ ULONG  HandleValue 
)

Definition at line 858 of file handle.c.

ULONG PhpMoveFreeHandleTableEntries ( _Inout_ PPH_HANDLE_TABLE  HandleTable)

Definition at line 912 of file handle.c.

FORCEINLINE VOID PhpUnlockHandleTableShared ( _Inout_ PPH_HANDLE_TABLE  HandleTable,
_In_ ULONG  Index 
)

Definition at line 55 of file handlep.h.