Changeset 2699 for trunk/src/opengl/initterm.cpp
- Timestamp:
- Feb 9, 2000, 2:44:32 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/initterm.cpp
r2595 r2699 1 /* $Id: initterm.cpp,v 1. 2 2000-02-01 19:41:55sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.3 2000-02-09 13:44:30 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 */ … … 41 42 void CDECL _ctordtorInit( void ); 42 43 void CDECL _ctordtorTerm( void ); 44 45 //Win32 resource table (produced by wrc) 46 extern DWORD _Resource_PEResTab; 43 47 } 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 mod_init(); 57 return TRUE; 52 58 59 case DLL_THREAD_ATTACH: 60 case DLL_THREAD_DETACH: 61 return TRUE; 53 62 63 case DLL_PROCESS_DETACH: 64 mod_cleanup(); 65 _ctordtorTerm(); 66 return TRUE; 67 } 68 return FALSE; 69 } 54 70 /****************************************************************************/ 55 71 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 83 99 /*******************************************************************/ 84 100 85 if(RegisterLxDll(hModule, 0, 0) == FALSE)101 if(RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab) == FALSE) 86 102 return 0UL; 87 103 88 rc = DosExitList(0x0000F000|EXLST_ADD, cleanup);89 if(rc)90 return 0UL;91 92 mod_init();93 104 break; 94 105 … … 106 117 return 1UL; 107 118 } 108 109 110 static void APIENTRY cleanup(ULONG ulReason)111 {112 mod_cleanup();113 114 _ctordtorTerm();115 116 DosExitList(EXLST_EXIT, cleanup);117 118 return ;119 }
Note:
See TracChangeset
for help on using the changeset viewer.