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/wing32/initterm.cpp

    r1647 r2650  
    1 /* $Id: initterm.cpp,v 1.1 1999-11-08 22:10:00 hugh Exp $ */
     1/* $Id: initterm.cpp,v 1.2 2000-02-05 02:13:34 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*/
    3738#include "wing32impl.h"
    38 #include "initterm.h"
    3939
    4040extern "C" {
    4141void CDECL _ctordtorInit( void );
    4242void CDECL _ctordtorTerm( void );
     43
     44 //Win32 resource table (produced by wrc)
     45 extern DWORD _Resource_PEResTab;
    4346}
     47//******************************************************************************
     48//******************************************************************************
     49BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     50{
     51   switch (fdwReason)
     52   {
     53   case DLL_PROCESS_ATTACH:
     54        return TRUE;
    4455
    45 char wing32Path[CCHMAXPATH] = "";
     56   case DLL_THREAD_ATTACH:
     57   case DLL_THREAD_DETACH:
     58        return TRUE;
    4659
    47 /*-------------------------------------------------------------------*/
    48 /* A clean up routine registered with DosExitList must be used if    */
    49 /* runtime calls are required and the runtime is dynamically linked. */
    50 /* This will guarantee that this clean up routine is run before the  */
    51 /* library DLL is terminated.                                        */
    52 /*-------------------------------------------------------------------*/
    53 static void APIENTRY cleanup(ULONG reason);
    54 
    55 
     60   case DLL_PROCESS_DETACH:
     61        _ctordtorTerm();
     62        return TRUE;
     63   }
     64   return FALSE;
     65}
    5666/****************************************************************************/
    5767/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8090        _ctordtorInit();
    8191
    82         DosQueryModuleName(hModule, CCHMAXPATH, wing32Path);
    83         char *endofpath = strrchr(wing32Path, '\\');
    84         if(endofpath)
    85           *(endofpath+1) = 0;
    86 
    8792        CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    88 
    89          /*******************************************************************/
    90          /* A DosExitList routine must be used to clean up if runtime calls */
    91          /* are required and the runtime is dynamically linked.             */
    92          /*******************************************************************/
    93 
    94         if(RegisterLxDll(hModule, 0, 0) == FALSE)
    95           return 0UL;
    9693
    9794        if(!InitWing32())
    9895          return 0UL;
    9996
    100         rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    101         if(rc)
     97        if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    10298          return 0UL;
    10399
     
    116112   return 1UL;
    117113}
    118 
    119 
    120 static void APIENTRY cleanup(ULONG ulReason)
    121 {
    122    _ctordtorTerm();
    123    DosExitList(EXLST_EXIT, cleanup);
    124    return ;
    125 }
Note: See TracChangeset for help on using the changeset viewer.