Changeset 21916 for trunk/src/rpcrt4/initterm.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (2 props)
-
src/rpcrt4/initterm.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/src/rpcrt4/initterm.cpp
r6649 r21916 1 1 /* $Id: initterm.cpp,v 1.7 2001-09-05 13:37:51 bird Exp $ */ 2 2 /* 3 * DLL entry point3 * RPCRT4 DLL entry point 4 4 * 5 5 * Copyright 1998 Sander van Leeuwen 6 6 * Copyright 1998 Peter Fitzsimmons 7 7 * 8 *9 8 * Project Odin Software License can be found in LICENSE.TXT 10 *11 9 */ 12 10 13 /*-------------------------------------------------------------*/14 /* INITERM.C -- Source for a custom dynamic link library */15 /* initialization and termination (_DLL_InitTerm) */16 /* function. */17 /* */18 /* When called to perform initialization, this sample function */19 /* gets storage for an array of integers, and initializes its */20 /* elements with random integers. At termination time, it */21 /* frees the array. Substitute your own special processing. */22 /*-------------------------------------------------------------*/23 24 25 /* Include files */26 11 #define INCL_DOSMODULEMGR 27 12 #define INCL_DOSPROCESS … … 38 23 #include <initdll.h> 39 24 40 /****************************************************************************/ 41 /* _DLL_InitTerm is the function that gets called by the operating system */ 42 /* loader when it loads and frees this DLL for each process that accesses */ 43 /* this DLL. However, it only gets called the first time the DLL is loaded */ 44 /* and the last time it is freed for a particular process. The system */ 45 /* linkage convention MUST be used because the operating system loader is */ 46 /* calling this function. */ 47 /****************************************************************************/ 48 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 49 ulFlag) 25 // Win32 resource table (produced by wrc) 26 extern DWORD rpcrt4_PEResTab; 27 28 static HMODULE dllHandle = 0; 29 30 ULONG SYSTEM DLL_InitRpcRt4(ULONG hModule) 50 31 { 51 size_t i; 52 APIRET rc; 32 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 53 33 54 /*-------------------------------------------------------------------------*/ 55 /* If ulFlag is zero then the DLL is being loaded so initialization should */ 56 /* be performed. If ulFlag is 1 then the DLL is being freed so */ 57 /* termination should be performed. */ 58 /*-------------------------------------------------------------------------*/ 34 dllHandle = RegisterLxDll(hModule, NULL, (PVOID)&rpcrt4_PEResTab); 35 if (dllHandle == 0) 36 return -1; 59 37 60 switch (ulFlag) {61 case 0 :62 ctordtorInit();38 //SvL: Must be done here as the socket calls trash FS! 39 /* Init the Uuid subsystem */ 40 UuidInit(); 63 41 64 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 42 return 0; 43 } 65 44 66 return inittermRpcrt4(hModule, ulFlag); 45 void SYSTEM DLL_TermRpcRt4(ULONG hModule) 46 { 47 if (dllHandle) 48 UnregisterLxDll(dllHandle); 49 } 67 50 68 case 1 : 69 inittermRpcrt4(hModule, ulFlag); 70 ctordtorTerm(); 71 break; 51 ULONG SYSTEM DLL_Init(ULONG hModule) 52 { 53 if (DLL_InitDefault(hModule) == -1) 54 return -1; 55 return DLL_InitRpcRt4(hModule); 56 } 72 57 73 default : 74 return 0UL; 75 } 76 77 /***********************************************************/ 78 /* A non-zero value must be returned to indicate success. */ 79 /***********************************************************/ 80 return 1UL; 58 void SYSTEM DLL_Term(ULONG hModule) 59 { 60 DLL_TermRpcRt4(hModule); 61 DLL_TermDefault(hModule); 81 62 }
Note:
See TracChangeset
for help on using the changeset viewer.
