4 #define PH_HANDLE_TABLE_ENTRY_TYPE 0x1
5 #define PH_HANDLE_TABLE_ENTRY_IN_USE 0x0
6 #define PH_HANDLE_TABLE_ENTRY_FREE 0x1
11 #define PH_HANDLE_TABLE_ENTRY_LOCKED 0x2
12 #define PH_HANDLE_TABLE_ENTRY_LOCKED_SHIFT 1
25 #define PH_HANDLE_TABLE_LEVEL_ENTRIES 256
26 #define PH_HANDLE_TABLE_LEVEL_MASK 0x3
28 #define PH_HANDLE_TABLE_LOCKS 8
29 #define PH_HANDLE_TABLE_LOCK_INDEX(HandleValue) ((HandleValue) % PH_HANDLE_TABLE_LOCKS)
48 _Inout_ PPH_HANDLE_TABLE HandleTable,
56 _Inout_ PPH_HANDLE_TABLE HandleTable,
71 #define PH_HANDLE_VALUE_INVALID ((ULONG)-1)
72 #define PH_HANDLE_VALUE_SHIFT 2
73 #define PH_HANDLE_VALUE_BIAS 4
75 #define PH_HANDLE_VALUE_LEVEL0(HandleValue) ((HandleValue) & 0xff)
76 #define PH_HANDLE_VALUE_LEVEL1_U(HandleValue) ((HandleValue) >> 8)
77 #define PH_HANDLE_VALUE_LEVEL1(HandleValue) (PH_HANDLE_VALUE_LEVEL1_U(HandleValue) & 0xff)
78 #define PH_HANDLE_VALUE_LEVEL2_U(HandleValue) ((HandleValue) >> 16)
79 #define PH_HANDLE_VALUE_LEVEL2(HandleValue) (PH_HANDLE_VALUE_LEVEL2_U(HandleValue) & 0xff)
80 #define PH_HANDLE_VALUE_IS_INVALID(HandleValue) (((HandleValue) >> 24) != 0)
83 _In_ ULONG HandleValue
97 _Inout_ PPH_HANDLE_TABLE HandleTable,
102 _Inout_ PPH_HANDLE_TABLE HandleTable,
103 _Out_ PULONG HandleValue
107 _Inout_ PPH_HANDLE_TABLE HandleTable,
108 _In_ ULONG HandleValue,
113 _In_ PPH_HANDLE_TABLE HandleTable,
114 _In_ BOOLEAN Initialize
118 _In_ PPH_HANDLE_TABLE HandleTable,
119 _In_ ULONG HandleValue
123 _Inout_ PPH_HANDLE_TABLE HandleTable
127 _In_ PPH_HANDLE_TABLE HandleTable,
128 _In_ BOOLEAN Initialize
136 _In_ PPH_HANDLE_TABLE HandleTable
144 _In_ PPH_HANDLE_TABLE HandleTable