| 1 | #ifndef __INITDLL_H__ | 
|---|
| 2 | #define __INITDLL_H__ | 
|---|
| 3 |  | 
|---|
| 4 | #if (defined(__IBMCPP__) || defined(__IBMC__) || defined(__INNOTEK_LIBC__)) | 
|---|
| 5 |  | 
|---|
| 6 | #define DLLENTRYPOINT_CCONV SYSTEM | 
|---|
| 7 | #define DLLENTRYPOINT_NAME  _DLL_InitTerm | 
|---|
| 8 |  | 
|---|
| 9 | #ifdef __cplusplus | 
|---|
| 10 | extern "C" { | 
|---|
| 11 | #endif | 
|---|
| 12 |  | 
|---|
| 13 | #if (__IBMCPP__ == 300) || (__IBMC__ == 300) | 
|---|
| 14 | void _Optlink __ctordtorInit( void ); | 
|---|
| 15 | #define ctordtorInit()  __ctordtorInit() | 
|---|
| 16 |  | 
|---|
| 17 | void _Optlink __ctordtorTerm( void ); | 
|---|
| 18 | #define ctordtorTerm()  __ctordtorTerm() | 
|---|
| 19 |  | 
|---|
| 20 | #elif (__IBMCPP__ == 360) || (__IBMC__ == 360) || (__IBMC__ == 430) | 
|---|
| 21 | void _Optlink __ctordtorInit( int flag ); | 
|---|
| 22 | #define ctordtorInit()  __ctordtorInit(0) | 
|---|
| 23 |  | 
|---|
| 24 | void _Optlink __ctordtorTerm( int flag ); | 
|---|
| 25 | #define ctordtorTerm()  __ctordtorTerm(0) | 
|---|
| 26 |  | 
|---|
| 27 | #elif defined(__INNOTEK_LIBC__) | 
|---|
| 28 |  | 
|---|
| 29 | extern void __ctordtorInit(void); | 
|---|
| 30 | extern void __ctordtorTerm(void); | 
|---|
| 31 |  | 
|---|
| 32 | #else | 
|---|
| 33 | #error "Unknown compiler!" | 
|---|
| 34 | #endif | 
|---|
| 35 |  | 
|---|
| 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 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 | } | 
|---|
| 126 | #endif | 
|---|
| 127 |  | 
|---|
| 128 | #endif //__INITDLL_H__ | 
|---|