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 |
| A0 | Pointer to source |
| A1 | Handle to destination |
| D0 | Number of bytes to copy |
| Registers on exit |
| A0 | Handle to destination |
| D0 | Result code |
RESULT CODES
| noErr | 0 | No error |
| memFullErr | -108 | Not enough memory |
| nilHandleErr | -109 | NIL master pointer |
| memWZErr | -111 | Attempt to operate on a free block |