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

Added version resource

File:
1 edited

Legend:

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

    r1502 r2650  
    1 /* $Id: initterm.cpp,v 1.11 1999-10-28 22:39:21 hugh Exp $ */
     1/* $Id: initterm.cpp,v 1.12 2000-02-05 01:55:52 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
    4447char ddrawPath[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   */
     
    7891         _ctordtorInit();
    7992
    80    DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath);
     93         DosQueryModuleName(hModule, CCHMAXPATH, ddrawPath);
    8194         char *endofpath = strrchr(ddrawPath, '\\');
    8295         if(endofpath) *(endofpath+1) = 0;
     
    8497         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    8598
    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;
     99         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
     100                return 0UL;
    97101
    98102         break;
    99103      }
    100104      case 1 :
    101   UnregisterLxDll(hModule);
     105        UnregisterLxDll(hModule);
    102106         break;
    103107      default  :
     
    110114   return 1UL;
    111115}
    112 
    113 
    114 static void APIENTRY cleanup(ULONG ulReason)
    115 {
    116    _ctordtorTerm();
    117    DosExitList(EXLST_EXIT, cleanup);
    118    return ;
    119 }
     116//******************************************************************************
     117//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.