Changeset 4319
- Timestamp:
- Sep 25, 2000, 6:35:01 AM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/kernel32/KERNEL32.CPP ¶
r4174 r4319 1 /* $Id: KERNEL32.CPP,v 1.5 2 2000-09-03 18:04:55phaller Exp $ */1 /* $Id: KERNEL32.CPP,v 1.53 2000-09-25 04:35:01 phaller Exp $ */ 2 2 3 3 /* … … 36 36 #include "handlemanager.h" 37 37 #include "wprocess.h" 38 #include "oslibdos.h" 38 39 #include <versionos2.h> 39 40 … … 184 185 //****************************************************************************** 185 186 //****************************************************************************** 186 VOID WIN32API GlobalMemoryStatus( MEMORYSTATUS *arg1) 187 188 /* 189 * PH 2000/09/25 This is an experiment to overcome some problems 190 * with Open32's GMS variant. 191 */ 192 void _GlobalMemoryStatus(MEMORYSTATUS *lpMemStat) 193 { 194 ULONG sys[5]; 195 // Note: QSV_TOTPHYSMEM = 17, QSV_MAXSHMEM = 21 196 lpMemStat->dwLength = sizeof(MEMORYSTATUS); 197 198 if(!OSLibDosQuerySysInfo( 17, 21, (PVOID)sys, sizeof(sys))) 199 { 200 // Specified a number between 0 and 100 that gives a general idea of 201 // current memory utilization, in which 0 indicates no memory use and 202 // 100 indicates full memory use 203 204 //#define MB512 0x1c000000 205 //lpMemStat->dwMemoryLoad = (MB512-sys[20]) * 100 / MB512; 206 lpMemStat->dwMemoryLoad = (sys[1] * 100) / sys[0]; 207 208 // bytes of physical memory 209 lpMemStat->dwTotalPhys = sys[0]; 210 211 // free physical memory bytes 212 lpMemStat->dwAvailPhys = sys[0] - sys[1]; 213 214 // bytes of paging file 215 lpMemStat->dwTotalPageFile = sys[2] - sys[0]; 216 217 // free bytes of paging file 218 // @@@PH subtract swapper.dat size? 219 lpMemStat->dwAvailPageFile = lpMemStat->dwTotalPageFile; 220 221 // user bytes of address space 222 lpMemStat->dwTotalVirtual = max(sys[2], sys[3]); 223 lpMemStat->dwAvailVirtual = min(sys[2], sys[3]); 224 } 225 } 226 227 228 229 VOID WIN32API GlobalMemoryStatus(MEMORYSTATUS *arg1) 187 230 { 188 231 dprintf(("KERNEL32: GlobalMemoryStatus\n")); 189 O32_GlobalMemoryStatus(arg1); 232 //O32_GlobalMemoryStatus(arg1); 233 _GlobalMemoryStatus(arg1); 190 234 dprintf(("dwMemoryLoad %X\n", arg1->dwMemoryLoad)); 191 235 dprintf(("dwTotalPhys %X\n", arg1->dwTotalPhys)); -
TabularUnified trunk/src/kernel32/oslibdos.cpp ¶
r4285 r4319 1 /* $Id: oslibdos.cpp,v 1.4 3 2000-09-20 21:32:53 hughExp $ */1 /* $Id: oslibdos.cpp,v 1.44 2000-09-25 04:35:01 phaller Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 2039 2039 2040 2040 2041 ULONG OSLibDosQuerySysInfo(ULONG iStart, ULONG iLast, PVOID pBuf, ULONG cbBuf) 2042 { 2043 USHORT sel = RestoreOS2FS(); 2044 APIRET rc; 2045 2046 rc = DosQuerySysInfo(iStart, iLast, pBuf, cbBuf); 2047 2048 SetFS(sel); 2049 SetLastError(error2WinError(rc,ERROR_INVALID_HANDLE)); 2050 return rc; 2051 } -
TabularUnified trunk/src/kernel32/oslibdos.h ¶
r4285 r4319 1 /* $Id: oslibdos.h,v 1.2 3 2000-09-20 21:32:55 hughExp $ */1 /* $Id: oslibdos.h,v 1.24 2000-09-25 04:35:00 phaller Exp $ */ 2 2 3 3 /* … … 202 202 LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, 203 203 LPDWORD lpTotalNumberOfClusters); 204 205 ULONG OSLibDosQuerySysInfo(ULONG iStart, ULONG iLast, PVOID pBuf, ULONG cbBuf); 204 206 205 207 … … 282 284 283 285 ULONG OSLibDosQueryModuleName(ULONG hModule, int cchName, char *pszName); 284 285
Note:
See TracChangeset
for help on using the changeset viewer.