Changeset 2650 for trunk/src/oleaut32/initterm.cpp
- Timestamp:
- Feb 5, 2000, 3:19:44 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/initterm.cpp
r2518 r2650 1 /* $Id: initterm.cpp,v 1. 5 2000-01-26 11:26:04sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.6 2000-02-05 02:07:03 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #include <odin.h> 34 34 #include <win32type.h> 35 #include <winconst.h> 35 36 #include <odinlx.h> 36 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ … … 39 40 void CDECL _ctordtorInit( void ); 40 41 void CDECL _ctordtorTerm( void ); 42 43 //Win32 resource table (produced by wrc) 44 extern DWORD _Resource_PEResTab; 41 45 } 42 46 … … 51 55 void Hash_Initialise(void); 52 56 53 /*-------------------------------------------------------------------*/ 54 /* A clean up routine registered with DosExitList must be used if */ 55 /* runtime calls are required and the runtime is dynamically linked. */ 56 /* This will guarantee that this clean up routine is run before the */ 57 /* library DLL is terminated. */ 58 /*-------------------------------------------------------------------*/ 59 static void APIENTRY cleanup(ULONG reason); 57 //****************************************************************************** 58 //****************************************************************************** 59 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 60 { 61 switch (fdwReason) 62 { 63 case DLL_PROCESS_ATTACH: 64 return TRUE; 60 65 66 case DLL_THREAD_ATTACH: 67 case DLL_THREAD_DETACH: 68 return TRUE; 61 69 70 case DLL_PROCESS_DETACH: 71 _ctordtorTerm(); 72 ClosePrivateLogFiles(); 73 return TRUE; 74 } 75 return FALSE; 76 } 62 77 /****************************************************************************/ 63 78 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 93 108 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 94 109 95 /*******************************************************************/ 96 /* A DosExitList routine must be used to clean up if runtime calls */ 97 /* are required and the runtime is dynamically linked. */ 98 /*******************************************************************/ 99 100 if(RegisterLxDll(hModule, 0, 0) == FALSE) 110 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 101 111 return 0UL; 102 103 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);104 if(rc)105 return 0UL;106 112 107 113 #ifdef DEFAULT_LOGGING_OFF … … 112 118 OpenPrivateLogFiles(); 113 119 } 114 115 120 Hash_Initialise(); 116 117 121 118 122 break; … … 130 134 return 1UL; 131 135 } 132 133 134 static void APIENTRY cleanup(ULONG ulReason) 135 { 136 _ctordtorTerm(); 137 ClosePrivateLogFiles(); 138 DosExitList(EXLST_EXIT, cleanup); 139 return ; 140 } 136 //****************************************************************************** 137 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.