Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Memory /
Chapter 2 - Memory Manager / Memory Manager Reference
Memory Manager Routines / Manipulating Blocks of Memory


PtrToXHand

To copy data referenced by a pointer to an already existing relocatable block, use the PtrToXHand function.

FUNCTION PtrToXHand (srcPtr: Ptr; dstHndl: Handle; size: LongInt):
                     OSErr;
srcPtr
The address of the first byte to copy.
dstHndl
A handle to an already existing relocatable block to which to copy size bytes, beginning at srcPtr.
size
The number of bytes to copy.
DESCRIPTION
The PtrToXHand function makes the existing handle, specified by dstHndl, a handle to a copy of the number of bytes specified by the size parameter, beginning at the location specified by srcPtr.

SPECIAL CONSIDERATIONS
Because PtrToXHand affects memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for PtrToXHand are
Registers on entry
A0Pointer to source
A1Handle to destination
D0Number of bytes to copy
Registers on exit
A0Handle to destination
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Not enough memory
nilHandleErr-109NIL master pointer
memWZErr-111Attempt to operate on a free block

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996