HeapPtrToHandle Function (ROM Call 0x23A)

alloc.h

HANDLE HeapPtrToHandle (void *Ptr);

Determines the handle associated with a block.

HeapPtrToHandle returns the handle associated to the block whose beginning is pointed to by Ptr (or H_NULL if Ptr does not point to the beginning of a block).
This routine works by searching the entire table of handles for the given pointer. It will return meaningful results only if the block of memory was not moved (e.g. by heap compression) since the pointer was originally obtained.
Note: PtrToHandle, implemented in the GCC4TI library, returns the handle associated to the block referenced by the pointer, even if the pointer does not point to the beginning of the block.


See also: PtrToHandle