Changeset 2650 for trunk/src/imagehlp
- Timestamp:
- Feb 5, 2000, 3:19:44 AM (26 years ago)
- Location:
- trunk/src/imagehlp
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/imagehlp/initterm.cpp
r951 r2650 1 /* $Id: initterm.cpp,v 1. 2 1999-09-15 23:26:07sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.3 2000-02-05 02:00:05 sandervl Exp $ */ 2 2 3 3 /* … … 34 34 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 35 35 #include <win32type.h> 36 #include <winconst.h> 36 37 #include <odinlx.h> 37 38 … … 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 46 43 47 BOOL WINAPI IMAGEHLP_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); 44 48 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 //****************************************************************************** 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 IMAGEHLP_LibMain(hinstDLL, fdwReason, fImpLoad); 52 59 53 60 case DLL_PROCESS_DETACH: 61 IMAGEHLP_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 */ … … 83 96 /*******************************************************************/ 84 97 85 if(RegisterLxDll(hModule, IMAGEHLP_LibMain, 0) == FALSE)98 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 86 99 return 0UL; 87 88 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);89 if(rc)90 return 0UL;91 100 92 101 break; … … 104 113 return 1UL; 105 114 } 106 107 108 static void APIENTRY cleanup(ULONG ulReason) 109 { 110 _ctordtorTerm(); 111 DosExitList(EXLST_EXIT, cleanup); 112 return ; 113 } 115 //****************************************************************************** 116 //****************************************************************************** -
trunk/src/imagehlp/makefile
r2526 r2650 1 # $Id: makefile,v 1. 5 2000-01-26 23:19:56sandervl Exp $1 # $Id: makefile,v 1.6 2000-02-05 02:00:05 sandervl Exp $ 2 2 3 3 # … … 22 22 TARGET = imagehlp 23 23 24 OBJS = imagehlp.obj internal.obj initterm.obj 24 OBJS = imagehlp.obj internal.obj initterm.obj resource.obj 25 25 26 26 all: $(TARGET).dll $(TARGET).lib … … 29 29 $(TARGET).dll: $(OBJS) $(TARGET).def 30 30 $(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) $(TARGET).def \ 31 $(PDWIN32_LIB)/ pmwinx.lib $(PDWIN32_LIB)/kernel32.lib \31 $(PDWIN32_LIB)/kernel32.lib \ 32 32 $(PDWIN32_LIB)/odincrt.lib OS2386.LIB $(RTLLIB_O) 33 33 $(CP) $@ $(PDWIN32_BIN) … … 41 41 $(IMPDEF) $** $@ 42 42 43 resource.asm: $(TARGET).rc 44 $(RC) $(RCFLAGS) -o resource.asm $(TARGET).rc 45 46 resource.obj: resource.asm 43 47 44 48 initterm.obj: initterm.cpp
Note:
See TracChangeset
for help on using the changeset viewer.