Changeset 21649 for trunk/src/kernel32
- Timestamp:
- Jun 23, 2011, 2:02:58 PM (14 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initkernel32.cpp
r21626 r21649 112 112 /*-------------------------------------------------------------------------*/ 113 113 114 if(fInit == TRUE && ulFlag == 0) {115 return 1; //already initialized116 }117 fInit = TRUE;118 119 114 switch (ulFlag) 120 115 { 121 case 0 116 case 0: 122 117 { 118 if (fInit) 119 return 1; // already initialized 120 123 121 // This always must be the first thing to do. 124 122 RasInitialize (hModule); … … 257 255 RasEntry (RAS_EVENT_Kernel32InitComplete, &dllHandle, sizeof (dllHandle)); 258 256 257 fInit = TRUE; 258 259 259 break; 260 260 } 261 261 262 case 1 262 case 1: 263 263 if (dllHandle) 264 264 { … … 267 267 break; 268 268 269 default 270 return 0 UL;269 default: 270 return 0; 271 271 } 272 272 … … 280 280 void APIENTRY cleanupKernel32(ULONG ulReason) 281 281 { 282 dprintf(("kernel32 exit %d\n", ulReason)); 282 if (!fInit) 283 { 284 // The initialization sequence was not complete; attempting to 285 // uninitialize some things may crash (yeah, dirty code that doesn't 286 // analyze its own state) 287 return; 288 } 289 290 dprintf(("kernel32 exit %d", ulReason)); 283 291 284 292 TEB *teb = GetThreadTEB(); -
trunk/src/kernel32/initterm.cpp
r21426 r21649 95 95 /*-------------------------------------------------------------------------*/ 96 96 97 if(fInit == TRUE && ulFlag == 0) {98 return 1; //already initialized99 }100 101 97 switch (ulFlag) 102 98 { 103 case 0 99 case 0: 104 100 { 101 if (fInit) 102 return 1; // already initialized 103 105 104 ctordtorInit(); 106 105 … … 112 111 rc = DosExitList(EXITLIST_KERNEL32|EXLST_ADD, cleanup); 113 112 if (rc) 114 return 0 UL;113 return 0; 115 114 116 rc = DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, version, sizeof(version)); 117 if(rc == 0){ 118 if(version[0] >= 20 && version[1] <= 30) { 115 rc = DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, 116 version, sizeof(version)); 117 if (rc == 0) 118 if(version[0] >= 20 && version[1] <= 30) 119 119 fVersionWarp3 = TRUE; 120 }121 }122 120 123 121 rc = inittermKernel32(hModule, ulFlag); … … 125 123 } 126 124 127 case 1 125 case 1: 128 126 rc = inittermKernel32(hModule, ulFlag); 129 127 break; 130 128 131 default 132 return 0 UL;129 default: 130 return 0; 133 131 } 134 132 … … 156 154 HMODULE hModule; 157 155 158 if (!fInit) {156 if (!fInit) 159 157 loadNr = globLoadNr++; 160 } 161 DosQueryModuleHandleStrict("WGSS50", &hModule); 162 _O32__DLL_InitTerm(hModule, 0); 163 DosQueryModuleHandleStrict("KERNEL32", &hModule); 164 return DLLENTRYPOINT_NAME(hModule, 0); 158 159 if (DosQueryModuleHandleStrict("WGSS50", &hModule) == NO_ERROR) 160 if (_O32__DLL_InitTerm(hModule, 0) != 0) 161 if (DosQueryModuleHandleStrict("KERNEL32", &hModule) == NO_ERROR) 162 return DLLENTRYPOINT_NAME(hModule, 0); 163 164 return 0; // failure 165 165 } 166 166 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.