Important: The information in this document is obsolete and should not be used for new development.
ReplaceGestalt
You can use theReplaceGestaltfunction to replace the function that is currently associated with a selector.
FUNCTION ReplaceGestalt (selector: OSType; gestaltFunction: SelectorFunctionUUP; VAR oldGestaltFunction: SelectorFunctionUUP): OSErr;
selector- The selector code for the function being replaced.
gestaltFunction- A pointer to the new selector function.
oldGestaltFunction- On exit, a pointer to the function previously associated with the specified selector.
DESCRIPTION
TheReplaceGestaltfunction replaces the selector function associated with an existing selector code.So that your function can call the function previously associated with the selector,
ReplaceGestaltplaces the address of the old selector function in theoldGestaltFunctionparameter. IfReplaceGestaltreturns an error of any type, then the value ofoldGestaltFunctionis undefined.SPECIAL CONSIDERATIONS
TheReplaceGestaltfunction might move memory and should not be called at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for theReplaceGestaltfunction are
Registers on entry A0 Address of new selector function D0 Selector code
Registers on exit A0 Address of old selector function D0 Result code RESULT CODES
noErr 0 No error gestaltUndefSelectorErr -5551 Undefined selector gestaltLocationErr -5553 Function not in system heap SEE ALSO
See "Modifying a Selector Function" on page 1-13 for a discussion of replacing selector functions. See "Adding a New Selector Code" beginning on page 1-10 for a sample selector function.