Changeset 10528 for trunk/src/kernel32/initkernel32.cpp
- Timestamp:
- Mar 16, 2004, 2:34:58 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initkernel32.cpp
r9878 r10528 1 /* $Id: initkernel32.cpp,v 1.2 6 2003-02-28 11:32:27sandervl Exp $1 /* $Id: initkernel32.cpp,v 1.27 2004-03-16 13:34:23 sandervl Exp $ 2 2 * 3 3 * KERNEL32 DLL entry point … … 59 59 #include <process.h> 60 60 #include <stats.h> 61 #include <heapshared.h> 61 62 62 63 #define DBG_LOCALLOG DBG_initterm … … 131 132 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 132 133 134 /* knut: check for high memory support */ 135 rc = DosQuerySysInfo(QSV_VIRTUALADDRESSLIMIT, QSV_VIRTUALADDRESSLIMIT, &ulSysinfo, sizeof(ulSysinfo)); 136 if (rc == 0 && ulSysinfo > 512) //VirtualAddresslimit is in MB 137 { 138 flAllocMem = PAG_ANY; // high memory support. Let's use it! 139 ulMaxAddr = ulSysinfo * (1024*1024); 140 } 141 else 142 flAllocMem = 0; // no high memory support 143 133 144 dprintf(("kernel32 init %s %s (%x) Win32k - %s", __DATE__, __TIME__, inittermKernel32, 134 145 libWin32kInstalled() ? "Installed" : "Not Installed")); … … 139 150 //(std handles can be used in win32 dll initialization routines 140 151 HMInitialize(); /* store standard handles within HandleManager */ 141 142 /* knut: check for high memory support */ 143 rc = DosQuerySysInfo(QSV_VIRTUALADDRESSLIMIT, QSV_VIRTUALADDRESSLIMIT, &ulSysinfo, sizeof(ulSysinfo)); 144 if (rc == 0 && ulSysinfo > 512) //VirtualAddresslimit is in MB 145 { 146 flAllocMem = PAG_ANY; // high memory support. Let's use it! 147 ulMaxAddr = ulSysinfo * (1024*1024); 152 153 // VP: Shared heap should be initialized before call to PROFILE_* 154 // because they use a critical section which in turn uses smalloc 155 // in debug build 156 if (InitializeSharedHeap() == FALSE) 157 return 0UL; 158 159 // VP: initialize profile internal data (critical section actually). 160 // This was done in PROFILE_LoadOdinIni but PROFILE_GetOdinIniInt 161 // is called earlier and this lead to a handle leak. 162 PROFILE_Initialize(); 163 164 if(flAllocMem == PAG_ANY) { 148 165 OSLibInitWSeBFileIO(); 149 166 if (PROFILE_GetOdinIniInt(ODINSYSTEM_SECTION, HIGHMEM_KEY, 1) == 0) { … … 152 169 } 153 170 } 154 else155 flAllocMem = 0; // no high memory support156 157 if (InitializeSharedHeap() == FALSE)158 return 0UL;159 171 160 172 if (InitializeCodeHeap() == FALSE) … … 178 190 179 191 OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES); 192 193 194 #ifdef DEBUG 195 { 196 LPSTR WIN32API GetEnvironmentStringsA(); 197 198 char *tmpenvnew = GetEnvironmentStringsA(); 199 dprintf(("Environment:")); 200 while(*tmpenvnew) { 201 dprintf(("%s", tmpenvnew)); 202 tmpenvnew += strlen(tmpenvnew)+1; 203 } 204 } 205 #endif 180 206 181 207 InitDirectories(); //Must be done before InitializeTIB (which loads NTDLL -> USER32)
Note:
See TracChangeset
for help on using the changeset viewer.