Ignore:
Timestamp:
Aug 16, 1999, 6:55:33 PM (26 years ago)
Author:
sandervl
Message:

Put back ctordtorinit/Term

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/initterm.cpp

    r510 r511  
    1 /* $Id: initterm.cpp,v 1.4 1999-08-16 16:28:03 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.5 1999-08-16 16:55:33 sandervl Exp $ */
    22
    33/*
     
    2727#define  INCL_DOSMODULEMGR
    2828#define  INCL_DOSPROCESS
    29 #include <os2wrap.h>    //Odin32 OS/2 api wrappers
     29#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    3030#include <stdlib.h>
    3131#include <stdio.h>
     
    3333#include <odin.h>
    3434#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
     35
     36extern "C" {
     37void CDECL _ctordtorInit( void );
     38void CDECL _ctordtorTerm( void );
     39}
     40
     41/*-------------------------------------------------------------------*/
     42/* A clean up routine registered with DosExitList must be used if    */
     43/* runtime calls are required and the runtime is dynamically linked. */
     44/* This will guarantee that this clean up routine is run before the  */
     45/* library DLL is terminated.                                        */
     46/*-------------------------------------------------------------------*/
     47static void APIENTRY cleanup(ULONG reason);
     48
    3549
    3650/****************************************************************************/
     
    5670   switch (ulFlag) {
    5771      case 0 :
    58          CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
     72         _ctordtorInit();
     73
     74         /*******************************************************************/
     75         /* A DosExitList routine must be used to clean up if runtime calls */
     76         /* are required and the runtime is dynamically linked.             */
     77         /*******************************************************************/
     78
     79         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
     80         if(rc)
     81                return 0UL;
     82
    5983         break;
    6084      case 1 :
     
    6993   return 1UL;
    7094}
     95
     96
     97static void APIENTRY cleanup(ULONG ulReason)
     98{
     99   _ctordtorTerm();
     100   DosExitList(EXLST_EXIT, cleanup);
     101   return ;
     102}
Note: See TracChangeset for help on using the changeset viewer.