Changeset 4818 for trunk/src/dllentry/dllentry.cpp
- Timestamp:
- Dec 17, 2000, 12:33:37 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dllentry/dllentry.cpp
r3993 r4818 1 /* $Id: dllentry.cpp,v 1. 2 2000-08-11 10:56:14 sandervlExp $ */1 /* $Id: dllentry.cpp,v 1.3 2000-12-16 23:31:07 bird Exp $ */ 2 2 3 3 /* … … 37 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 38 38 39 39 40 extern "C" { 41 #ifdef __IBMCPP__ 40 42 void CDECL _ctordtorInit( void ); 41 43 void CDECL _ctordtorTerm( void ); 42 44 #endif 43 45 //Win32 resource table (produced by wrc) 44 46 extern DWORD _Resource_PEResTab; … … 53 55 switch (fdwReason) 54 56 { 55 case DLL_PROCESS_ATTACH:56 57 case DLL_PROCESS_ATTACH: 58 return TRUE; 57 59 58 case DLL_THREAD_ATTACH:59 case DLL_THREAD_DETACH:60 60 case DLL_THREAD_ATTACH: 61 case DLL_THREAD_DETACH: 62 return TRUE; 61 63 62 case DLL_PROCESS_DETACH: 63 _ctordtorTerm(); 64 return TRUE; 64 case DLL_PROCESS_DETACH: 65 #ifdef __IBMCPP__ 66 _ctordtorTerm(); 67 #endif 68 return TRUE; 65 69 } 66 70 return FALSE; 67 71 } 72 73 74 #ifdef __IBMCPP__ 75 68 76 /****************************************************************************/ 69 77 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 74 82 /* calling this function. */ 75 83 /****************************************************************************/ 76 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 77 ulFlag) 84 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag) 78 85 { 79 size_t i;80 APIRET rc;81 82 86 /*-------------------------------------------------------------------------*/ 83 87 /* If ulFlag is zero then the DLL is being loaded so initialization should */ … … 86 90 /*-------------------------------------------------------------------------*/ 87 91 88 switch (ulFlag) { 92 switch (ulFlag) 93 { 89 94 case 0: 90 95 _ctordtorInit(); 96 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 97 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 98 if (dllHandle == 0) 99 return 0UL; 100 break; 91 101 92 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 102 case 1: 103 if (dllHandle) 104 UnregisterLxDll(dllHandle); 105 break; 93 106 94 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);95 if(dllHandle == 0)96 return 0UL;97 98 break;99 case 1:100 if(dllHandle) {101 UnregisterLxDll(dllHandle);102 }103 break;104 107 default: 105 108 return 0UL; … … 111 114 return 1UL; 112 115 } 113 //****************************************************************************** 114 //****************************************************************************** 116 #elif defined(__WATCOM_CPLUSPLUS__) 117 /* 118 * Watcom dll init and term routines. 119 */ 120 121 int __dll_initialize(unsigned long hModule, unsigned long ulFlag) 122 { 123 CheckVersionFromHMOD(PE2LX_VERSION, hModule); 124 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 125 if (dllHandle == 0) 126 return 0; 127 return 1; 128 } 129 130 int __dll_terminate(unsigned long hModule, unsigned long ulFlag) 131 { 132 if (dllHandle) 133 UnregisterLxDll(dllHandle); 134 return 1; 135 } 136 137 #else 138 #error message("compiler is not supported!\n"); 139 #endif
Note:
See TracChangeset
for help on using the changeset viewer.