Changeset 2650 for trunk/src/dsound


Ignore:
Timestamp:
Feb 5, 2000, 3:19:44 AM (26 years ago)
Author:
sandervl
Message:

Added version resource

Location:
trunk/src/dsound
Files:
1 added
2 edited

Legend:

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

    r1744 r2650  
    1 /* $Id: initterm.cpp,v 1.8 1999-11-14 22:12:15 hugh Exp $ */
     1/* $Id: initterm.cpp,v 1.9 2000-02-05 01:58:50 sandervl Exp $ */
    22
    33/*
     
    3333#include <odin.h>
    3434#include <win32type.h>
     35#include <winconst.h>
    3536#include <odinlx.h>
    3637#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
    37 #include "initterm.h"
    3838
    3939extern "C" {
    4040void CDECL _ctordtorInit( void );
    4141void CDECL _ctordtorTerm( void );
     42
     43 //Win32 resource table (produced by wrc)
     44 extern DWORD _Resource_PEResTab;
    4245}
    4346
    44 char  dsoundPath[CCHMAXPATH] = "";
     47char dsoundPath[CCHMAXPATH] = "";
    4548
    46 /*-------------------------------------------------------------------*/
    47 /* A clean up routine registered with DosExitList must be used if    */
    48 /* runtime calls are required and the runtime is dynamically linked. */
    49 /* This will guarantee that this clean up routine is run before the  */
    50 /* library DLL is terminated.                                        */
    51 /*-------------------------------------------------------------------*/
    52 static void APIENTRY cleanup(ULONG reason);
     49//******************************************************************************
     50//******************************************************************************
     51BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     52{
     53   switch (fdwReason)
     54   {
     55   case DLL_PROCESS_ATTACH:
     56        return TRUE;
    5357
     58   case DLL_THREAD_ATTACH:
     59   case DLL_THREAD_DETACH:
     60        return TRUE;
    5461
     62   case DLL_PROCESS_DETACH:
     63        _ctordtorTerm();
     64        return TRUE;
     65   }
     66   return FALSE;
     67}
    5568/****************************************************************************/
    5669/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    7689      case 0 :
    7790      {
    78          _ctordtorInit();
    79 
    80    DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath);
     91         DosQueryModuleName(hModule, CCHMAXPATH, dsoundPath);
    8192         char *endofpath = strrchr(dsoundPath, '\\');
    8293         if(endofpath) *(endofpath+1) = 0;
     94         _ctordtorInit();
    8395
    8496         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    8597
    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    if(RegisterLxDll(hModule, 0, 0) == FALSE)
    92     return 0UL;
    93 
    94          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    95          if(rc)
    96                 return 0UL;
     98         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
     99                return 0UL;
    97100
    98101         break;
    99102      }
    100103      case 1 :
    101   UnregisterLxDll(hModule);
     104        UnregisterLxDll(hModule);
    102105         break;
    103106      default  :
     
    110113   return 1UL;
    111114}
    112 
    113 
    114 static void APIENTRY cleanup(ULONG ulReason)
    115 {
    116    _ctordtorTerm();
    117    DosExitList(EXLST_EXIT, cleanup);
    118    return ;
    119 }
     115//******************************************************************************
     116//******************************************************************************
  • trunk/src/dsound/makefile

    r2637 r2650  
    1 # $Id: makefile,v 1.13 2000-02-04 19:29:17 hugh Exp $
     1# $Id: makefile,v 1.14 2000-02-05 01:58:50 sandervl Exp $
    22
    33#
     
    1414
    1515!include $(PDWIN32_INCLUDE)/pdwin32.mk
    16 ASFLAGS = -Sc -Sv:ALP
     16
    1717
    1818CFLAGS = $(CFLAGS) -I$(PDWIN32_INCLUDE)
     
    2222TARGET = dsound
    2323
    24 OBJS =  dsound.obj os2dsound.obj initterm.obj os2sndbuffer.obj os2helper.obj asmutil.obj
    25 #OBJS =  dsound.obj initterm.obj
     24OBJS =  dsound.obj os2dsound.obj initterm.obj os2sndbuffer.obj os2helper.obj resource.obj
    2625
    2726all: $(TARGET).dll $(TARGET).lib
     
    3029$(TARGET).dll: $(OBJS) $(TARGET).def
    3130        $(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) $(TARGET).def \
    32               pmwinx.lib  $(PDWIN32_LIB)/kernel32.lib \
     31              pmwinx.lib $(PDWIN32_LIB)/kernel32.lib \
    3332              $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O)
    3433        $(CP) $@ $(PDWIN32_BIN)
    3534
    3635
    37 $(TARGET).lib: $(TARGET)exp.def
    38         $(IMPLIB) $(IMPLIBFLAGS) $@ $(TARGET)exp.def
     36$(TARGET).lib: $(TARGET).def
     37        $(IMPLIB) $(IMPLIBFLAGS) $@ $**
    3938        $(CP) $@ $(PDWIN32_LIB)
    4039
    41 $(TARGET)exp.def: $(TARGET).def
    42         $(IMPDEF) $** $@
     40resource.asm: $(TARGET).rc
     41    $(RC) $(RCFLAGS) -o resource.asm $(TARGET).rc
     42
     43resource.obj: resource.asm
    4344
    4445
     
    6061    $(PDWIN32_INCLUDE)/os2wrap.h
    6162
    62 asmutil.obj: asmutil.asm
    63 
    6463initterm.obj: initterm.cpp initterm.h
    6564
Note: See TracChangeset for help on using the changeset viewer.