MQ_INIT_EXIT - Initialize exit environment
Exit providers can supply an MQ_INIT_EXIT function to perform connection-level initialization.
Syntax
- MQ_INIT_EXIT (pExitParms, pExitContext, pCompCode, pReason)
Parameters
The MQ_INIT_EXIT call has the following parameters.
pExitParms (PMQAXP) - input/output
Exit parameter structure.
pExitContext (PMQAXC) - input/output
Exit context structure.
pCompCode (PMQLONG) - input/output
Completion code.
pReason (PMQLONG) - input/output
Reason code qualifying pCompCode.
Usage notes
- The MQ_INIT_EXIT function can issue the MQXEP call to register the addresses of the exit functions for the particular MQ calls to be intercepted. It is not necessary to intercept all MQ calls, or to intercept both MQXR_BEFORE and MQXR_AFTER calls. For example, an exit suite could choose to intercept only the MQXR_BEFORE call of MQPUT .
- Storage that is to be used by exit functions in the exit suite can be acquired by the MQ_INIT_EXIT function. Alternatively, exit functions can acquire storage when they are invoked, as and when needed. However, all storage should be freed before the exit suite is terminated; the MQ_TERM_EXIT function can free the storage, or an exit function invoked earlier.
- If MQ_INIT_EXIT returns MQXCC_FAILED in the ExitResponse field of MQAXP, or fails in some other way, the MQCONN or MQCONNX call that caused MQ_INIT_EXIT to be invoked also fails, with the CompCode and Reason parameters set to appropriate values.
- An MQ_INIT_EXIT function cannot issue MQ calls other than MQXEP .
C invocation
MQ_INIT_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason);The parameters passed to the exit are declared as follows:
PMQAXP pExitParms; /* Exit parameter structure */ PMQAXC pExitContext; /* Exit context structure */ PMQLONG pCompCode; /* Completion code */ PMQLONG pReason; /* Reason code qualifying CompCode */