[Contents] [Index] [Help] [Retrace] [browse <] [Browse >]


NAME
    CallHookPkt -- Invoke a hook function callback. (v36)

SYNOPSIS
    return = CallHookPkt( hook, object, paramPkt )
    D0                    A0    A2      A1

    ULONG CallHookPkt( struct hook *hook, void *object, void *parampkt );

FUNCTION
    Performs the callback standard defined by a hook structure.
    This function is really very simple; it effectively performs
    a JMP to Hook->h_Entry.

    It is probably just as well to do this operation in an
    assembly language function linked in to your program, possibly
    from a compiler supplied library or a builtin function.

    It is anticipated that C programs will often call a 'varargs'
    variant of this function which will be named callhook.  this
    function must be provided in a compiler specific library, but
    an example of use would be:

    returnval = CallHook( hook, dataobject, COMMAND_ID, param1, param2 );

    This function callhook can be implemented in many c compilers
    like this:
    CallHook( hook, object, command, ... )
    struct hook    *hook;
    VOID            *object;
    ULONG           command;
    {
            return ( CallHookPkt( hook, object, (VOID *) &command ) );
    }

INPUTS
    hook           - pointer to hook structure as defined in
                      utility/hooks.h
    Object          - useful data structure in the particular context the
                      hook is being used for.
    ParamPkt        - pointer to a parameter packet (often built on the
                      stack); by convention this packet should start off
                      with a longword command code, and the remaining
                      data in the packet depends on that command.

RESULT
    return          - The meaning of the value returned in D0 depends on
                      the context in which the hook is being used.

NOTES
    The functions called through this function should follow normal
    register conventions unless EXPLICITLY documented otherwise (and
    they have a good reason too).

BUGS

SEE ALSO
    utility/hooks.h