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

    r2518 r2650  
    1 /* $Id: initterm.cpp,v 1.5 2000-01-26 11:26:04 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.6 2000-02-05 02:07:03 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*/
     
    3940void CDECL _ctordtorInit( void );
    4041void CDECL _ctordtorTerm( void );
     42
     43 //Win32 resource table (produced by wrc)
     44 extern DWORD _Resource_PEResTab;
    4145}
    4246
     
    5155void Hash_Initialise(void);
    5256
    53 /*-------------------------------------------------------------------*/
    54 /* A clean up routine registered with DosExitList must be used if    */
    55 /* runtime calls are required and the runtime is dynamically linked. */
    56 /* This will guarantee that this clean up routine is run before the  */
    57 /* library DLL is terminated.                                        */
    58 /*-------------------------------------------------------------------*/
    59 static void APIENTRY cleanup(ULONG reason);
     57//******************************************************************************
     58//******************************************************************************
     59BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     60{
     61   switch (fdwReason)
     62   {
     63   case DLL_PROCESS_ATTACH:
     64        return TRUE;
    6065
     66   case DLL_THREAD_ATTACH:
     67   case DLL_THREAD_DETACH:
     68        return TRUE;
    6169
     70   case DLL_PROCESS_DETACH:
     71        _ctordtorTerm();
     72        ClosePrivateLogFiles();
     73        return TRUE;
     74   }
     75   return FALSE;
     76}
    6277/****************************************************************************/
    6378/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    93108         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    94109
    95          /*******************************************************************/
    96          /* A DosExitList routine must be used to clean up if runtime calls */
    97          /* are required and the runtime is dynamically linked.             */
    98          /*******************************************************************/
    99 
    100          if(RegisterLxDll(hModule, 0, 0) == FALSE)
     110         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    101111                return 0UL;
    102 
    103          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    104          if(rc)
    105                 return 0UL;
    106112
    107113#ifdef DEFAULT_LOGGING_OFF
     
    112118                OpenPrivateLogFiles();
    113119         }
    114 
    115120         Hash_Initialise();
    116 
    117121
    118122         break;
     
    130134   return 1UL;
    131135}
    132 
    133 
    134 static void APIENTRY cleanup(ULONG ulReason)
    135 {
    136    _ctordtorTerm();
    137    ClosePrivateLogFiles();
    138    DosExitList(EXLST_EXIT, cleanup);
    139    return ;
    140 }
     136//******************************************************************************
     137//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.