Changeset 2650 for trunk/src/NTDLL
- Timestamp:
- Feb 5, 2000, 3:19:44 AM (26 years ago)
- Location:
- trunk/src/NTDLL
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/NTDLL/initterm.cpp
r2122 r2650 1 /* $Id: initterm.cpp,v 1. 8 1999-12-18 20:01:13sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.9 2000-02-05 02:05:00 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*/ … … 39 40 void CDECL _ctordtorInit( void ); 40 41 void CDECL _ctordtorTerm( void ); 42 43 //Win32 resource table (produced by wrc) 44 extern DWORD _Resource_PEResTab; 41 45 } 42 43 /*-------------------------------------------------------------------*/44 /* A clean up routine registered with DosExitList must be used if */45 /* runtime calls are required and the runtime is dynamically linked. */46 /* This will guarantee that this clean up routine is run before the */47 /* library DLL is terminated. */48 /*-------------------------------------------------------------------*/49 static void APIENTRY cleanup(ULONG reason);50 51 46 52 47 BOOL WINAPI NTDLL_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); 53 48 49 //****************************************************************************** 50 //****************************************************************************** 51 BOOL WINAPI LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 52 { 53 switch (fdwReason) 54 { 55 case DLL_PROCESS_ATTACH: 56 case DLL_THREAD_ATTACH: 57 case DLL_THREAD_DETACH: 58 return NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad); 59 60 case DLL_PROCESS_DETACH: 61 NTDLL_LibMain(hinstDLL, fdwReason, fImpLoad); 62 _ctordtorTerm(); 63 return TRUE; 64 } 65 return FALSE; 66 } 54 67 /****************************************************************************/ 55 68 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 78 91 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 79 92 80 /*******************************************************************/ 81 /* A DosExitList routine must be used to clean up if runtime calls */ 82 /* are required and the runtime is dynamically linked. */ 83 /*******************************************************************/ 84 85 if(RegisterLxDll(hModule, NTDLL_LibMain, 0) == FALSE) 93 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 86 94 return 0UL; 87 88 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);89 if(rc)90 return 0UL;91 95 92 96 break; … … 103 107 return 1UL; 104 108 } 105 106 107 static void APIENTRY cleanup(ULONG ulReason) 108 { 109 _ctordtorTerm(); 110 DosExitList(EXLST_EXIT, cleanup); 111 return ; 112 } 109 //****************************************************************************** 110 //****************************************************************************** -
trunk/src/NTDLL/makefile
r2583 r2650 1 # $Id: makefile,v 1.1 7 2000-01-31 22:31:25sandervl Exp $1 # $Id: makefile,v 1.18 2000-02-05 02:05:00 sandervl Exp $ 2 2 3 3 # … … 34 34 unknown.obj\ 35 35 arith64.obj\ 36 regfunc.obj 36 regfunc.obj resource.obj 37 37 38 38 … … 44 44 $(TARGET).dll: $(OBJS) $(TARGET).def 45 45 $(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) sbsstub.obj $(TARGET).def $(PDWIN32_LIB)\kernel32.lib $(PDWIN32_LIB)\user32.lib $(PDWIN32_LIB)/kernel32.lib $(PDWIN32_LIB)/crtdll.lib $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O) 46 # PMWINX.LIB LIBULS.LIB LIBCONV.LIB47 46 $(CP) $@ $(PDWIN32_BIN) 48 47 … … 54 53 $(IMPDEF) $** $@ 55 54 55 resource.asm: $(TARGET).rc 56 $(RC) $(RCFLAGS) -o resource.asm $(TARGET).rc 57 58 resource.obj: resource.asm 56 59 57 60 ntdll.obj: .\ntdll.cpp .\ntdll.h
Note:
See TracChangeset
for help on using the changeset viewer.