PHANDLE_TABLE_ENTRY
ExpLookupHandleTableEntry (
IN PHANDLE_TABLE HandleTable,
IN EXHANDLE Handle
)
/*++
Routine Description:
This routine looks up and returns the table entry for the
specified handle value.
Arguments:
HandleTable - Supplies the handle table being queried
Handle - Supplies the handle value being queried
Return Value:
Returns a pointer to the corresponding table entry for the input
handle. Or NULL if the handle value is invalid (i.e., too large
for the tables current allocation.
--*/
{
ULONG i,j,k,l;
PAGED_CODE();
//
// Decode the handle index into its separate table indicies
//
l = (Handle.Index >> 24) & 255;
i = (Handle.Index >> 16) & 255;
j = (Handle.Index >> 8) & 255;
k = (Handle.Index) & 255;
//
// The last bits should be 0 into a valid handle. If a function calls
// ExpLookupHandleTableEntry for a kernel handle, it should decode the handle
// before.
//
if ( l != 0 ) {
//
// Invalid handle. Return a NULL table entry.
//
return NULL;
}
//
// Check that the top level table is present
//
if (HandleTable->Table[i] == NULL) {
return NULL;
}
//
// Check that the mid level table is present
//