Changeset 4167 for trunk/src/kernel32/initterm.cpp
- Timestamp:
- Sep 2, 2000, 11:14:50 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initterm.cpp
r3993 r4167 1 /* $Id: initterm.cpp,v 1.4 4 2000-08-11 10:56:16 sandervlExp $ */1 /* $Id: initterm.cpp,v 1.45 2000-09-02 21:14:50 bird Exp $ */ 2 2 3 3 /* … … 51 51 #include "oslibdos.h" 52 52 #include <cpuhlp.h> 53 54 #define DBG_LOCALLOG DBG_initterm 53 #include <Win32k.h> 54 55 #define DBG_LOCALLOG DBG_initterm 55 56 #include "dbglocal.h" 57 56 58 57 59 /*-------------------------------------------------------------------*/ … … 107 109 { 108 110 case 0 : 109 { 110 ParseLogStatus(); 111 { 112 libWin32kInit(); 113 114 ParseLogStatus(); 111 115 112 116 loadNr = globLoadNr++; 113 117 114 115 116 118 strcpy(kernel32Path, OSLibGetDllName(hModule)); 119 char *endofpath = strrchr(kernel32Path, '\\'); 120 *(endofpath+1) = 0; 117 121 dprintf(("kernel32 init\n")); 118 122 _ctordtorInit(); … … 120 124 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 121 125 122 123 124 if (InitializeSharedHeap() == FALSE)125 return 0UL; 126 127 if (InitializeCodeHeap() == FALSE)126 OpenPrivateLogFiles(); 127 128 if (InitializeSharedHeap() == FALSE) 129 return 0UL; 130 131 if (InitializeCodeHeap() == FALSE) 128 132 return 0UL; 129 133 130 134 PROFILE_LoadOdinIni(); 131 135 dllHandle = RegisterLxDll(hModule, 0, (PVOID)&_Resource_PEResTab); 132 if (dllHandle == 0)133 return 0UL; 134 135 136 if (dllHandle == 0) 137 return 0UL; 138 139 //SvL: Kernel32 is a special case; pe.exe loads it, so increase 136 140 // the reference count here 137 Win32DllBase *module = Win32DllBase::findModule(dllHandle); 138 if(module) { 139 module->AddRef(); 140 module->DisableUnload(); 141 } 141 Win32DllBase *module = Win32DllBase::findModule(dllHandle); 142 if (module) 143 { 144 module->AddRef(); 145 module->DisableUnload(); 146 } 142 147 143 148 /*******************************************************************/ … … 156 161 flAllocMem = PAG_ANY; // high memory support. Let's use it! 157 162 ulMaxAddr = ulSysinfo * (1024*1024); 158 163 OSLibInitWSeBFileIO(); 159 164 } 160 165 else 161 166 flAllocMem = 0; // no high memory support 162 167 163 168 OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES); 164 169 165 170 //SvL: Do it here instead of during the exe object creation 166 171 //(std handles can be used in win32 dll initialization routines 167 172 HMInitialize(); /* store standard handles within HandleManager */ 168 InitializeTIB(TRUE); 173 InitializeTIB(TRUE); //MUST be done after HMInitialize! 169 174 InitDirectories(); 170 175 RegisterDevices(); 171 176 Win32DllBase::setDefaultRenaming(); 172 177 rc = DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &ulSysinfo, sizeof(ulSysinfo)); 173 if (rc != 0) 174 178 if (rc != 0) 179 ulSysinfo = 1; 175 180 176 181 InitSystemInfo(ulSysinfo); 177 182 //Set up environment as found in NT 178 183 InitEnvironment(ulSysinfo); 179 184 break; 180 } 185 } 186 181 187 case 1 : 182 if(dllHandle) { 183 UnregisterLxDll(dllHandle); 184 } 185 break; 188 if (dllHandle) 189 { 190 UnregisterLxDll(dllHandle); 191 } 192 break; 193 186 194 default : 187 195 return 0UL;
Note:
See TracChangeset
for help on using the changeset viewer.