Ignore:
Timestamp:
Dec 3, 2000, 11:19:43 PM (25 years ago)
Author:
sandervl
Message:

CW: Ported Wine MCI code

File:
1 edited

Legend:

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

    r3993 r4748  
    1 /* $Id: initterm.cpp,v 1.10 2000-08-11 10:56:27 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.11 2000-12-03 22:18:17 sandervl Exp $ */
    22
    33/*
     
    66 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
    77 * Copyright 1998 Peter Fitzsimmons
     8 * Copyright 2000 Chris Wohlgemuth
    89 *
    910 *
     
    4243#include "dbglocal.h"
    4344
     45BOOL MULTIMEDIA_MciInit(void);
     46BOOL    MULTIMEDIA_CreateIData(HINSTANCE hinstDLL);
     47void MULTIMEDIA_DeleteIData(void);
     48
    4449extern "C" {
    4550void IRTMidiShutdown();  // IRTMidi shutdown routine
    4651void CDECL _ctordtorInit( void );
    4752void CDECL _ctordtorTerm( void );
     53
    4854
    4955 //Win32 resource table (produced by wrc)
     
    5662BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
    5763{
    58    switch (fdwReason)
    59    {
    60    case DLL_PROCESS_ATTACH:
     64  static BOOL                   bInitDone = FALSE;
     65 
     66  switch (fdwReason)
     67    {
     68    case DLL_PROCESS_ATTACH:
     69      if (!MULTIMEDIA_CreateIData(hinstDLL))
     70        return FALSE;
     71     
     72      if (!bInitDone) { /* to be done only once */
     73            if (!MULTIMEDIA_MciInit() /*|| !MMDRV_Init() */ ) {
     74          MULTIMEDIA_DeleteIData();
     75          return FALSE;
     76            }
     77        bInitDone = TRUE;       
     78      }
     79     
    6180        return TRUE;
    6281
     
    6685
    6786   case DLL_PROCESS_DETACH:
     87     MULTIMEDIA_DeleteIData();
    6888        auxOS2Close(); /* SvL: Close aux device if necessary */
    6989        IRTMidiShutdown;  /* JT: Shutdown RT Midi subsystem, if running. */
     
    101121         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    102122
    103         dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);
     123        dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);
    104124         if(dllHandle == 0)
    105                 return 0UL;
     125           return 0UL;/* Error */
    106126
    107127         break;
     
    123143//******************************************************************************
    124144//******************************************************************************
     145
     146
     147
Note: See TracChangeset for help on using the changeset viewer.