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