Ignore:
Timestamp:
Feb 9, 2000, 2:44:32 PM (26 years ago)
Author:
sandervl
Message:

added version resources + removed/rewrote exitlist handlers

File:
1 edited

Legend:

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

    r2595 r2699  
    1 /* $Id: initterm.cpp,v 1.2 2000-02-01 19:41:55 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.3 2000-02-09 13:44:30 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       */
     
    4142void CDECL _ctordtorInit( void );
    4243void CDECL _ctordtorTerm( void );
     44
     45 //Win32 resource table (produced by wrc)
     46 extern DWORD _Resource_PEResTab;
    4347}
    4448
    45 /*-------------------------------------------------------------------*/
    46 /* A clean up routine registered with DosExitList must be used if    */
    47 /* runtime calls are required and the runtime is dynamically linked. */
    48 /* This will guarantee that this clean up routine is run before the  */
    49 /* library DLL is terminated.                                        */
    50 /*-------------------------------------------------------------------*/
    51 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        mod_init();
     57        return TRUE;
    5258
     59   case DLL_THREAD_ATTACH:
     60   case DLL_THREAD_DETACH:
     61        return TRUE;
    5362
     63   case DLL_PROCESS_DETACH:
     64        mod_cleanup();
     65        _ctordtorTerm();
     66        return TRUE;
     67   }
     68   return FALSE;
     69}
    5470/****************************************************************************/
    5571/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8399         /*******************************************************************/
    84100
    85          if(RegisterLxDll(hModule, 0, 0) == FALSE)
     101         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    86102                return 0UL;
    87103
    88          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    89          if(rc)
    90                 return 0UL;
    91 
    92          mod_init();
    93104         break;
    94105
     
    106117   return 1UL;
    107118}
    108 
    109 
    110 static void APIENTRY cleanup(ULONG ulReason)
    111 {
    112    mod_cleanup();
    113 
    114    _ctordtorTerm();
    115 
    116    DosExitList(EXLST_EXIT, cleanup);
    117 
    118    return ;
    119 }
Note: See TracChangeset for help on using the changeset viewer.