Changeset 3313 for trunk/src


Ignore:
Timestamp:
Apr 3, 2000, 9:53:26 AM (25 years ago)
Author:
sandervl
Message:

added makefile, fixed initterm (no exitlist)

Location:
trunk/src/rpcrt4
Files:
1 added
1 edited

Legend:

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

    r3307 r3313  
    1 /* $Id: initterm.cpp,v 1.1 2000-04-02 22:02:55 davidr Exp $ */
     1/* $Id: initterm.cpp,v 1.2 2000-04-03 07:53:26 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*/
     
    4041void CDECL _ctordtorInit( void );
    4142void CDECL _ctordtorTerm( void );
     43
     44 //Win32 resource table (produced by wrc)
     45 extern DWORD _Resource_PEResTab;
    4246}
    4347
    44 /*-------------------------------------------------------------------*/
    45 /* A clean up routine registered with DosExitList must be used if    */
    46 /* runtime calls are required and the runtime is dynamically linked. */
    47 /* This will guarantee that this clean up routine is run before the  */
    48 /* library DLL is terminated.                                        */
    49 /*-------------------------------------------------------------------*/
    50 static void APIENTRY cleanup(ULONG reason);
     48//******************************************************************************
     49//******************************************************************************
     50BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
     51{
     52   switch (fdwReason)
     53   {
     54   case DLL_PROCESS_ATTACH:
     55        return TRUE;
    5156
     57   case DLL_THREAD_ATTACH:
     58   case DLL_THREAD_DETACH:
     59        return TRUE;
    5260
     61   case DLL_PROCESS_DETACH:
     62        _ctordtorTerm();
     63        return TRUE;
     64   }
     65   return FALSE;
     66}
    5367/****************************************************************************/
    5468/* _DLL_InitTerm is the function that gets called by the operating system   */
     
    8296         /*******************************************************************/
    8397
    84          if(RegisterLxDll(hModule, 0, 0) == FALSE)
     98         if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE)
    8599                return 0UL;
    86100
    87          rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);
    88          if(rc)
    89                 return 0UL;
    90 
    91          /* Init the Uuid subsystem */
    92          UuidInit();
     101         //SvL: Must be done here as the socket calls trash FS!
     102         /* Init the Uuid subsystem */
     103         UuidInit();
    93104
    94105         break;
     
    105116   return 1UL;
    106117}
    107 
    108 
    109 static void APIENTRY cleanup(ULONG ulReason)
    110 {
    111    _ctordtorTerm();
    112    DosExitList(EXLST_EXIT, cleanup);
    113    return ;
    114 }
Note: See TracChangeset for help on using the changeset viewer.