Changeset 5366 for trunk/src/winmm/initterm.cpp
- Timestamp:
- Mar 24, 2001, 4:40:04 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/winmm/initterm.cpp
r5356 r5366 26 26 #define INCL_DOSMODULEMGR 27 27 #define INCL_DOSPROCESS 28 #include <os2wrap.h> 28 #include <os2wrap.h> //Odin32 OS/2 api wrappers 29 29 #include <stdlib.h> 30 30 #include <stdio.h> … … 39 39 #include "auxiliary.h" 40 40 41 #define DBG_LOCALLOG 41 #define DBG_LOCALLOG DBG_initterm 42 42 #include "dbglocal.h" 43 43 … … 58 58 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 59 59 { 60 static BOOL 61 60 static BOOL bInitDone = FALSE; 61 62 62 switch (fdwReason) 63 63 { 64 64 case DLL_PROCESS_ATTACH: 65 if (!MULTIMEDIA_CreateIData(hinstDLL)) 66 return FALSE; 67 68 if (!bInitDone) { /* to be done only once */ 69 if (!MULTIMEDIA_MciInit() /*|| !MMDRV_Init() */ ) { 70 MULTIMEDIA_DeleteIData(); 71 return FALSE; 72 } 73 bInitDone = TRUE; 74 } 75 76 return TRUE; 65 if (!MULTIMEDIA_CreateIData(hinstDLL)) 66 return FALSE; 67 68 if (!bInitDone) { /* to be done only once */ 69 if (!MULTIMEDIA_MciInit() /*|| !MMDRV_Init() */ ) { 70 MULTIMEDIA_DeleteIData(); 71 return FALSE; 72 } 73 bInitDone = TRUE; 74 } 75 return TRUE; 77 76 78 77 case DLL_THREAD_ATTACH: 79 78 case DLL_THREAD_DETACH: 80 79 return TRUE; 81 80 82 81 case DLL_PROCESS_DETACH: 83 82 MULTIMEDIA_DeleteIData(); 84 83 auxOS2Close(); /* SvL: Close aux device if necessary */ 85 86 87 84 IRTMidiShutdown; /* JT: Shutdown RT Midi subsystem, if running. */ 85 ctordtorTerm(); 86 return TRUE; 88 87 } 89 88 return FALSE; … … 99 98 ULONG DLLENTRYPOINT_CCONV DLLENTRYPOINT_NAME(ULONG hModule, ULONG ulFlag) 100 99 { 101 size_t i; 102 APIRET rc; 100 /*-------------------------------------------------------------------------*/ 101 /* If ulFlag is zero then the DLL is being loaded so initialization should */ 102 /* be performed. If ulFlag is 1 then the DLL is being freed so */ 103 /* termination should be performed. */ 104 /*-------------------------------------------------------------------------*/ 103 105 104 /*-------------------------------------------------------------------------*/ 105 /* If ulFlag is zero then the DLL is being loaded so initialization should */ 106 /* be performed. If ulFlag is 1 then the DLL is being freed so */ 107 /* termination should be performed. */ 108 /*-------------------------------------------------------------------------*/ 106 switch (ulFlag) 107 { 108 case 0 : 109 ctordtorInit(); 109 110 110 switch (ulFlag) { 111 case 0 : 112 ctordtorInit(); 111 ParseLogStatus(); 113 112 114 ParseLogStatus(); 113 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 114 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 115 if(dllHandle == 0) 116 return 0UL;/* Error */ 115 117 116 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 118 dprintf(("winmm init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME)); 119 break; 120 case 1 : 121 auxOS2Close(); /* SvL: Close aux device if necessary */ 122 if(dllHandle) { 123 UnregisterLxDll(dllHandle); 124 } 125 break; 126 default : 127 return 0UL; 128 } 117 129 118 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 119 if(dllHandle == 0) 120 return 0UL;/* Error */ 121 122 dprintf(("winmm init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME)); 123 124 break; 125 case 1 : 126 auxOS2Close(); /* SvL: Close aux device if necessary */ 127 if(dllHandle) { 128 UnregisterLxDll(dllHandle); 129 } 130 break; 131 default : 132 return 0UL; 133 } 134 135 /***********************************************************/ 136 /* A non-zero value must be returned to indicate success. */ 137 /***********************************************************/ 138 return 1UL; 130 /***********************************************************/ 131 /* A non-zero value must be returned to indicate success. */ 132 /***********************************************************/ 133 return 1UL; 139 134 } 140 135 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.