Changeset 5326 for trunk/src/ddraw/initterm.cpp
- Timestamp:
- Mar 18, 2001, 10:44:46 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/initterm.cpp
r5305 r5326 33 33 #include <winconst.h> 34 34 #include <odinlx.h> 35 #include <exitlist.h> 35 36 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 36 37 #include <initdll.h> 38 #include "os2fsdd.h" // For RestorePM() 39 37 40 38 41 extern "C" { … … 44 47 static HMODULE dllHandle = 0; 45 48 49 static void APIENTRY cleanup(ULONG ulReason); 50 46 51 //****************************************************************************** 47 52 //****************************************************************************** 48 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)53 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 49 54 { 50 55 switch (fdwReason) … … 58 63 59 64 case DLL_PROCESS_DETACH: 65 #ifdef __IBMCPP__ 60 66 ctordtorTerm(); 67 #endif 61 68 return TRUE; 62 69 } … … 71 78 /* calling this function. */ 72 79 /****************************************************************************/ 73 ULONG DLLENTRYPOINT_CCONV DLLENTRYPOINT_NAME(ULONG hModule, ULONG ulFlag) 80 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 81 ulFlag) 74 82 { 75 83 … … 83 91 case 0 : 84 92 { 93 APIRET rc; 94 95 #ifdef __IBMCPP__ 96 ctordtorInit(); 97 #endif 85 98 DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath); 86 99 char *endofpath = strrchr(ddrawPath, '\\'); 87 if(endofpath) *(endofpath+1) = 0; 88 89 ctordtorInit(); 100 if (endofpath) 101 *(endofpath+1) = '\0'; 90 102 91 103 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 92 104 93 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab,105 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab, 94 106 DDRAW_MAJORIMAGE_VERSION, DDRAW_MINORIMAGE_VERSION, 95 107 IMAGE_SUBSYSTEM_WINDOWS_GUI); 96 if(dllHandle == 0) 97 return 0UL; 108 if (dllHandle == 0) 109 return 0UL; 110 111 rc = DosExitList(EXITLIST_NONCOREDLL | EXLST_ADD, cleanup); 112 if (rc) 113 return 0UL; 98 114 99 115 break; … … 101 117 case 1 : 102 118 if(dllHandle) { 103 119 UnregisterLxDll(dllHandle); 104 120 } 105 121 break; … … 115 131 //****************************************************************************** 116 132 //****************************************************************************** 133 134 static void APIENTRY cleanup(ULONG ulReason) 135 { 136 dprintf(("DDRAW processing exitlist")); 137 RestorePM(); 138 dprintf(("DDRAW exitlist done")); 139 140 DosExitList(EXLST_EXIT, cleanup); 141 } 142 //****************************************************************************** 143 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.