HandAndHand
Use the HandAndHand function to concatenate two relocatable blocks.
FUNCTION HandAndHand (aHndl, bHndl: Handle): OSErr;
aHndl
- A handle to the first relocatable block, whose contents do not change but are concatenated to the end of the second relocatable block.
bHndl
- A handle to the second relocatable block, whose size the Memory Manager expands so that it can concatenate the information from
aHndl to the end of the contents of this block.
DESCRIPTION
The HandAndHand function concatenates the information from the relocatable block to which aHndl is a handle onto the end of the relocatable block to which bHndl is a handle. The aHndl variable remains unchanged.
- WARNING
- The
HandAndHand function dereferences the handle aHndl. You must call the HLock procedure to lock the block before calling HandAndHand. Afterward, you can call the HUnlock procedure to unlock it. Alternatively, you can save the block's original state by calling the HGetState function, lock the block by calling HLock, and then restore the original settings by calling HSetState.
SPECIAL CONSIDERATIONS
Because HandAndHand moves memory, you should not call it at interrupt time.
ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for HandAndHand are
| Registers on entry |
| A0 | Handle to be concatenated |
| A1 | Handle to contain itself, data from A0's handle |
| Registers on exit |
| A0 | Handle to concatenated data |
| 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 |