Changeset 21733 for branches/gcc-kmk/include/initdll.h
- Timestamp:
- Oct 24, 2011, 7:58:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/include/initdll.h
r21728 r21733 1 /** @file 2 * 3 * INITDLL library interface. 4 * 5 * Project Odin Software License can be found in LICENSE.TXT 6 */ 7 1 8 #ifndef __INITDLL_H__ 2 9 #define __INITDLL_H__ 3 10 4 #if (defined(__IBMCPP__) || defined(__IBMC__) || defined(__INNOTEK_LIBC__)) 11 #include <odin.h> 12 13 /** 14 * Called to initialize resources of the DLL module when it is loaded. 15 * 16 * This callback function is implemented by modules that link to initldll.lib 17 * and want to override the default DLL initialization procedure called when the 18 * DLL is loaded by the system (according to the INIT/TERM policy specified in 19 * the LIBRARY statement in the .DEF file). See DLL_InitDefault() for more 20 * information about the default initialization procedure. 21 * 22 * On success, the returned value must be the DosExitList() order code (high 23 * byte of the low word) that defines the order in which DLL_Term() will be 24 * called WRT other uninitialization routines and exit list handlers. Returning 25 * 0 will cause DLL_Term() to be called first. Note that if several handlers 26 * use the same order code they are called in LIFO order. For DLLs, this means 27 * that DLL_Term() will be called in the order opposite to DLL_Init(). 28 * 29 * @param hModule DLL module handle. 30 * @return Exit list order on success or -1 to indicate a failure. 31 */ 32 ULONG SYSTEM DLL_Init(ULONG hModule); 33 34 /** 35 * Called to free resources of the DLL module when it is unloaded. 36 * 37 * This callback function is implemented by modules that link to initldll.lib 38 * and want to override the default DLL uninitialization procedure called when 39 * the DLL is unloaded by the system (according to the INIT/TERM policy 40 * specified in the LIBRARY statement in the .DEF file). See DLL_TermDefault() 41 * for more information about the default uninitialization procedure. 42 * 43 * @param hModule DLL module handle. 44 */ 45 void SYSTEM DLL_Term(ULONG hModule); 46 47 /** 48 * Default DLL initialization procedure. 49 * 50 * This procedure is called if your module does not implement the DLL_Init() 51 * callback function. It performs steps necessary to initializes the C/C++ 52 * runtime. 53 * 54 * You may call this procedure from your DLL_Init() implementation to perform 55 * the standard initialization steps described above. 56 * 57 * @param hModule DLL module handle. 58 * @return 0 on success or -1 to indicate a failure. 59 */ 60 ULONG SYSTEM DLL_InitDefault(ULONG hModule); 61 62 /** 63 * Default DLL uninitialization procedure. 64 * 65 * This procedure is called if your module does not implement the DLL_Term() 66 * callback function. It performs steps necessary to terminate the C/C++ 67 * runtime. 68 * 69 * You may call this procedure from your DLL_Uniit() implementation to perform 70 * the standard initialization steps described above. 71 * 72 * @param hModule DLL module handle. 73 */ 74 void SYSTEM DLL_TermDefault(ULONG hModule); 5 75 6 76 #ifdef __cplusplus … … 8 78 #endif 9 79 80 #if defined(__IBMCPP__) || defined(__IBMC__) 81 82 /** 83 * C run-time environment initialization function. 84 * Returns 0 to indicate success and -1 to indicate failure. 85 */ 86 int _Optlink _CRT_init(void); 87 88 /** 89 * C run-time environment termination function. 90 * It only needs to be called when the C run-time functions are statically 91 * linked. 92 */ 93 void _Optlink _CRT_term(void); 94 10 95 #if (__IBMCPP__ == 300) || (__IBMC__ == 300) 11 void _Optlink __ctordtorInit( void );12 #define ctordtorInit() __ctordtorInit()13 96 14 void _Optlink __ctordtor Term( void);15 #define ctordtorTerm() __ctordtorTerm() 97 void _Optlink __ctordtorInit(void); 98 void _Optlink __ctordtorTerm(void); 16 99 17 100 #elif (__IBMCPP__ == 360) || (__IBMC__ == 360) || (__IBMC__ == 430) 18 void _Optlink __ctordtorInit( int flag );19 #define ctordtorInit() __ctordtorInit(0)20 101 21 void _Optlink __ctordtor Term( int flag);22 #define ctordtorTerm() __ctordtorTerm(0)102 void _Optlink __ctordtorInit(int flag); 103 #define __ctordtorInit() __ctordtorInit(0) 23 104 24 #elif defined(__INNOTEK_LIBC__) 105 void _Optlink __ctordtorTerm(int flag); 106 #define __ctordtorTerm() __ctordtorTerm(0) 25 107 26 extern void __ctordtorInit(void); 27 extern void __ctordtorTerm(void); 108 #else 109 #error "Unknown VAC compiler version!" 110 #endif 28 111 29 #define ctordtorInit() __ctordtorInit() 30 #define ctordtorTerm() __ctordtorTerm() 112 #elif defined(__EMX__) 113 114 int _CRT_init(void); 115 void _CRT_term(void); 116 117 void __ctordtorInit(void); 118 void __ctordtorTerm(void); 119 120 #elif defined(__WATCOMC__) 121 122 #define _DLL_InitTerm LibMain 123 124 int _Optlink _CRT_init(void); 125 void _Optlink _CRT_term(void); 126 127 #define __ctordtorInit() 128 #define __ctordtorTerm() 129 130 //prevent Watcom from mucking with this name 131 extern DWORD _Resource_PEResTab; 132 #pragma aux _Resource_PEResTab "*"; 31 133 32 134 #else … … 34 136 #endif 35 137 36 #ifndef __INNOTEK_LIBC__ 37 38 /*-------------------------------------------------------------------*/ 39 /* _CRT_init is the C run-time environment initialization function. */ 40 /* It will return 0 to indicate success and -1 to indicate failure. */ 41 /*-------------------------------------------------------------------*/ 42 int _Optlink _CRT_init(void); 43 44 /*-------------------------------------------------------------------*/ 45 /* _CRT_term is the C run-time environment termination function. */ 46 /* It only needs to be called when the C run-time functions are */ 47 /* statically linked. */ 48 /*-------------------------------------------------------------------*/ 49 void _Optlink _CRT_term(void); 50 #endif // __INNOTEK_LIBC__ 51 52 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #elif defined(__WATCOMC__) 58 59 #define _DLL_InitTerm LibMain 60 61 #define ctordtorInit() 62 #define ctordtorTerm() 63 64 #ifdef __cplusplus 65 extern "C" { 66 //prevent Watcom from mucking with this name 67 extern DWORD _Resource_PEResTab; 68 #pragma aux _Resource_PEResTab "*"; 69 } 70 #endif 71 72 #endif /* IBM CPP Compiler */ 73 74 #ifdef __cplusplus 75 extern "C" { 76 #endif 77 78 typedef ULONG (APIENTRY *PFN_INITDLL)(ULONG hModule, ULONG ulFlag); 79 typedef void (APIENTRY *PFN_CLEANUPDLL)(ULONG ulReason); 80 81 ULONG APIENTRY inittermKernel32(ULONG hModule, ULONG ulFlag); 82 void APIENTRY cleanupKernel32(ULONG ulReason); 83 84 ULONG APIENTRY inittermUser32(ULONG hModule, ULONG ulFlag); 85 void APIENTRY cleanupUser32(ULONG ulReason); 86 ULONG APIENTRY inittermOdinCtrl(ULONG hModule, ULONG ulFlag); 87 88 //NOTE!!!!!!!!!!!!!!!!! 89 //if this list is extended, then update our custombuild code!!!! 90 //NOTE!!!!!!!!!!!!!!!!! 91 ULONG APIENTRY inittermWinmm(ULONG hModule, ULONG ulFlag); 92 ULONG APIENTRY inittermShell32(ULONG hModule, ULONG ulFlag); 93 ULONG APIENTRY inittermOle32(ULONG hModule, ULONG ulFlag); 94 ULONG APIENTRY inittermComdlg32(ULONG hModule, ULONG ulFlag); 95 ULONG APIENTRY inittermComctl32(ULONG hModule, ULONG ulFlag); 96 ULONG APIENTRY inittermGdi32(ULONG hModule, ULONG ulFlag); 97 ULONG APIENTRY inittermNTDLL(ULONG hModule, ULONG ulFlag); 98 ULONG APIENTRY inittermWsock32(ULONG hModule, ULONG ulFlag); 99 ULONG APIENTRY inittermWininet(ULONG hModule, ULONG ulFlag); 100 ULONG APIENTRY inittermRpcrt4(ULONG hModule, ULONG ulFlag); 101 ULONG APIENTRY inittermAvifil32(ULONG hModule, ULONG ulFlag); 102 ULONG APIENTRY inittermQuartz(ULONG hModule, ULONG ulFlag); 103 ULONG APIENTRY inittermRiched32(ULONG hModule, ULONG ulFlag); 104 ULONG APIENTRY inittermWnaspi32(ULONG hModule, ULONG ulFlag); 105 ULONG APIENTRY inittermUxTheme(ULONG hModule, ULONG ulFlag); 106 ULONG APIENTRY inittermDInput(ULONG hModule, ULONG ulFlag); 107 ULONG APIENTRY inittermDSound(ULONG hModule, ULONG ulFlag); 108 ULONG APIENTRY inittermWinSpool(ULONG hModule, ULONG ulFlag); 109 ULONG APIENTRY inittermDDraw(ULONG hModule, ULONG ulFlag); 110 ULONG APIENTRY inittermNTDLL(ULONG hModule, ULONG ulFlag); 111 ULONG APIENTRY inittermMSVCRT(ULONG hModule, ULONG ulFlag); 112 ULONG APIENTRY inittermImm32(ULONG hModule, ULONG ulFlag); 113 ULONG APIENTRY inittermCrypt32(ULONG hModule, ULONG ulFlag); 114 ULONG APIENTRY inittermOleacc(ULONG hModule, ULONG ulFlag); 115 ULONG APIENTRY inittermmscms(ULONG hModule, ULONG ulFlag); 116 ULONG APIENTRY inittermRsaenh(ULONG hModule, ULONG ulFlag); 117 ULONG APIENTRY inittermSecur32(ULONG hModule, ULONG ulFlag); 118 119 ULONG APIENTRY InitializeKernel32(); 120 138 BOOL APIENTRY InitializeKernel32(); 121 139 VOID APIENTRY ReportFatalDllInitError(PCSZ pszModName); 122 140 123 141 #ifdef __cplusplus 124 } 142 } // extern "C" 125 143 #endif 126 144
Note:
See TracChangeset
for help on using the changeset viewer.