Using the EXITPARAM Structure

Function prototype

The function to be executed must be a function in a library with the following prototype:

void MyFunc(LPEXITPARAM lpep);

Definition of the EXITPARAM structure

The definition of the EXITPARAM structure is as follows:

struct tagExitParamStruct
{
   DWORD         dwSize;
   DWORD         dwToLen;
   DWORD         dwFromLen;
   DWORD         dwMapInstance;
   void FAR *    lpv;
   LPSTR         lpszCmdLine;
   BYTE HUGE *   lpDataToApp;
   BYTE HUGE *   lpDataFromApp;
   UINT          uRetryCount;
   UINT          uRetryInterval;
   BOOL          bRollback;
   BOOL          bCleanup;
   int           nReturn;
   char          szErrMsg[100];
   char          szFile[260];
   void FAR *    lpMapHandle;
   void FAR *    lpInternal;
   void FAR *    lpCmdStruct;
   void FAR *    lpAdaptParms;
   void FAR *    lpContext;
   void FAR *    lpWildcard;
   void FAR *    lpfnMS;
   void FAR *    lpMS;
   DWORD         dwWildcardSize;
   LPSTR         lpszMapDirectory;
   WORD          wCardNum;
   WORD          wCleanupAction;
   WORD          wScope;
   UINT          uUnitSize;
   BOOL          bBurst;
   BOOL          bFromRule;
   BOOL          bSource;
   DWORD         dwRecords;
};
typedef struct tagExitParamStruct EXITPARAM;
typedef struct tagExitParamStruct FAR * LPEXITPARAM;

The engine environment sets up the EXITPARAM structure and the function should fill in the result. The engine will allocate and free the memory associated with lpDataToApp. The function must allocate the memory for lpDataFromApp. For all Windows operating systems, use the Windows macro GlobalAllocPtr defined in windowsx.h. For all other operating systems, use the C-runtime malloc function. The engine will free this memory.

Table 1. Components of EXITPARAM as used with the EXIT function.
Component Used as Usage
dwSize Input Size (in bytes) of EXITPARAM to assure correct compatibility
dwToLen Input Length (size in bytes) of lpDataToApp
dwFromLen Output Length (size in bytes) of lpDataFromApp
dwMapInstance Not used
lpv Not used
LpszCmdLine Not used
lpDataToApp Input Data sent to the function. This is the third parameter of the EXIT function
lpDataFromApp Output Data sent back to the server from the function
uRetryCount Not used
uRetryInterval Not used
bRollback Not Used
bCleanup Not used
nReturn Output Return code based on the outcome of the function
szErrMsg Output String message based on nReturn
szFile Not used
lpInternal Not used
lpCmdStruct Not used
lpAdaptParms Not used
lpContext Not used
lpWildcard Not used
dwWildcardSize Not used
lpszMapDirectory Not used
wCardNum Not used
wCleanupAction Not used
wScope Not used
uUnitSize Not used
bBurst Not used
lpfnMS Not used.
lpMS Not used
dwRecords Not used

There is no interaction with the nReturn or szErrMsg fields. However, this might change in a future release.