Changeset 2650 for trunk/src/winmm/initterm.cpp
- Timestamp:
- Feb 5, 2000, 3:19:44 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/winmm/initterm.cpp
r1144 r2650 1 /* $Id: initterm.cpp,v 1. 7 1999-10-05 19:24:00 phallerExp $ */1 /* $Id: initterm.cpp,v 1.8 2000-02-05 02:16:21 sandervl Exp $ */ 2 2 3 3 /* … … 35 35 #include <odin.h> 36 36 #include <win32type.h> 37 #include <winconst.h> 37 38 #include <odinlx.h> 38 39 #include "auxiliary.h" … … 43 44 void CDECL _ctordtorInit( void ); 44 45 void CDECL _ctordtorTerm( void ); 46 47 //Win32 resource table (produced by wrc) 48 extern DWORD _Resource_PEResTab; 45 49 } 50 //****************************************************************************** 51 //****************************************************************************** 52 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 53 { 54 switch (fdwReason) 55 { 56 case DLL_PROCESS_ATTACH: 57 return TRUE; 46 58 47 /*-------------------------------------------------------------------*/ 48 /* A clean up routine registered with DosExitList must be used if */ 49 /* runtime calls are required and the runtime is dynamically linked. */ 50 /* This will guarantee that this clean up routine is run before the */ 51 /* library DLL is terminated. */ 52 /*-------------------------------------------------------------------*/ 53 static void APIENTRY cleanup(ULONG reason); 59 case DLL_THREAD_ATTACH: 60 case DLL_THREAD_DETACH: 61 return TRUE; 54 62 55 56 63 case DLL_PROCESS_DETACH: 64 auxOS2Close(); /* SvL: Close aux device if necessary */ 65 IRTMidiShutdown; /* JT: Shutdown RT Midi subsystem, if running. */ 66 _ctordtorTerm(); 67 return TRUE; 68 } 69 return FALSE; 70 } 57 71 /****************************************************************************/ 58 72 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 81 95 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 82 96 83 if(RegisterLxDll(hModule, 0, 0) == FALSE)97 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 84 98 return 0UL; 85 86 /*******************************************************************/87 /* A DosExitList routine must be used to clean up if runtime calls */88 /* are required and the runtime is dynamically linked. */89 /*******************************************************************/90 91 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);92 if(rc)93 return 0UL;94 99 95 100 break; … … 107 112 return 1UL; 108 113 } 109 110 111 static void APIENTRY cleanup(ULONG ulReason) 112 { 113 auxOS2Close(); /* SvL: Close aux device if necessary */ 114 IRTMidiShutdown; /* JT: Shutdown RT Midi subsystem, if running. */ 115 _ctordtorTerm(); 116 DosExitList(EXLST_EXIT, cleanup); 117 return ; 118 } 119 114 //****************************************************************************** 115 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.