DosExitList

DosExitList

#define INCL_DOSPROCESS

USHORT  rc = DosExitList(FcnCode_Order, RtnAddress);

USHORT           FcnCode_Order; /* Function request code/Order */
PFNEXITLIST      RtnAddress;    /* Address of routine */

USHORT           rc;            /* return code */

Example

In this example, TestRoutine is added to the exitlist sequence. Routines in the exitlist sequence must use DosExitList instead of DosExit to end.

#define INCL_DOSPROCESS
#define INCL_VIO
#define ROUTINE_ORDER 0xEE00
#define VIO_HANDLE 0

USHORT rc;

VOID APIENTRY TestRoutine2()
   {
   USHORT r;

   VioWrtTTY("This runs last...\n",         /* String to be written */
             18,                            /* Length of string */
             VIO_HANDLE);                   /* Video handle */
   r = DosExitList(EXLST_EXIT,                   /* Function request
                                                        code/order */
                   (PFNEXITLIST) TestRoutine2);  /* Address of routine */
   }

main()
   {
   rc = DosExitList(EXLST_ADD | ROUTINE_ORDER,   /* Function request
                                                           code/order */
                    (PFNEXITLIST) TestRoutine2); /* Address of routine */
   }


[Back: DosExitCritSec]
[Next: DosFileIO]