- Timestamp:
- Apr 3, 2000, 9:53:26 AM (25 years ago)
- 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 davidrExp $ */1 /* $Id: initterm.cpp,v 1.2 2000-04-03 07:53:26 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #include <odin.h> 34 34 #include <win32type.h> 35 #include <winconst.h> 35 36 #include <odinlx.h> 36 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ … … 40 41 void CDECL _ctordtorInit( void ); 41 42 void CDECL _ctordtorTerm( void ); 43 44 //Win32 resource table (produced by wrc) 45 extern DWORD _Resource_PEResTab; 42 46 } 43 47 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 //****************************************************************************** 50 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 51 { 52 switch (fdwReason) 53 { 54 case DLL_PROCESS_ATTACH: 55 return TRUE; 51 56 57 case DLL_THREAD_ATTACH: 58 case DLL_THREAD_DETACH: 59 return TRUE; 52 60 61 case DLL_PROCESS_DETACH: 62 _ctordtorTerm(); 63 return TRUE; 64 } 65 return FALSE; 66 } 53 67 /****************************************************************************/ 54 68 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 82 96 /*******************************************************************/ 83 97 84 if(RegisterLxDll(hModule, 0, 0) == FALSE)98 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 85 99 return 0UL; 86 100 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(); 93 104 94 105 break; … … 105 116 return 1UL; 106 117 } 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.