Ignore:
Timestamp:
Jul 20, 2001, 5:42:38 PM (24 years ago)
Author:
sandervl
Message:

initterm update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/initterm.cpp

    r5873 r6375  
    4646#include "dbglocal.h"
    4747
    48 BOOL MULTIMEDIA_MciInit(void);
    49 BOOL MULTIMEDIA_CreateIData(HINSTANCE hinstDLL);
    50 void MULTIMEDIA_DeleteIData(void);
    51 
    52 extern "C" {
    53 void IRTMidiShutdown();  // IRTMidi shutdown routine
    54 
    55  //Win32 resource table (produced by wrc)
    56  extern DWORD _Resource_PEResTab;
    57 }
    58 static HMODULE dllHandle = 0;
    59 
    60 //******************************************************************************
    61 //******************************************************************************
    62 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    63 {
    64   static BOOL           bInitDone = FALSE;
    65 
    66   switch (fdwReason)
    67     {
    68     case DLL_PROCESS_ATTACH:
    69     {
    70         if (!MULTIMEDIA_CreateIData(hinstDLL))
    71             return FALSE;
    72 
    73         if (!bInitDone) { /* to be done only once */
    74             if (!MULTIMEDIA_MciInit() /*|| !MMDRV_Init() */ ) {
    75                 MULTIMEDIA_DeleteIData();
    76                 return FALSE;
    77             }
    78             bInitDone = TRUE;
    79         }
    80         DWORD dwVolume;
    81 
    82         dwVolume = PROFILE_GetOdinIniInt(WINMM_SECTION, DEFVOL_KEY, 100);
    83         dwVolume = (dwVolume*0xFFFF)/100;
    84         dwVolume = (dwVolume << 16) | dwVolume;
    85         WaveOut::setDefaultVolume(dwVolume);
    86         return TRUE;
    87    }
    88 
    89    case DLL_THREAD_ATTACH:
    90    case DLL_THREAD_DETACH:
    91         return TRUE;
    92 
    93    case DLL_PROCESS_DETACH:
    94         MULTIMEDIA_DeleteIData();
    95         auxOS2Close(); /* SvL: Close aux device if necessary */
    96         IRTMidiShutdown;  /* JT: Shutdown RT Midi subsystem, if running. */
    97         ctordtorTerm();
    98         return TRUE;
    99    }
    100    return FALSE;
    101 }
    10248/****************************************************************************/
    10349/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    12167        ctordtorInit();
    12268
    123         ParseLogStatus();
    124 
    12569        CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    126         dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab);
    127         if(dllHandle == 0)
    128             return 0UL;/* Error */
    129 
    130         dprintf(("winmm init %s %s (%x)", __DATE__, __TIME__, DLLENTRYPOINT_NAME));
    131         break;
     70        return inittermWinmm(hModule, ulFlag);
    13271    case 1 :
    133         auxOS2Close(); /* SvL: Close aux device if necessary */
    134         if(dllHandle) {
    135             UnregisterLxDll(dllHandle);
    136         }
     72        inittermWinmm(hModule, ulFlag);
     73        ctordtorTerm();
    13774        break;
    13875    default  :
Note: See TracChangeset for help on using the changeset viewer.