kernel32: Fix overflow on 32-bits systems.
This commit is contained in:
parent
d177a97d28
commit
81a6be568e
|
@ -1204,17 +1204,17 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
|
|||
|
||||
/* new style /proc/meminfo ... */
|
||||
if (sscanf(buffer, "MemTotal: %lu", &total))
|
||||
lpmemex->ullTotalPhys = total*1024;
|
||||
lpmemex->ullTotalPhys = (ULONG64)total*1024;
|
||||
if (sscanf(buffer, "MemFree: %lu", &free))
|
||||
lpmemex->ullAvailPhys = free*1024;
|
||||
lpmemex->ullAvailPhys = (ULONG64)free*1024;
|
||||
if (sscanf(buffer, "SwapTotal: %lu", &total))
|
||||
lpmemex->ullTotalPageFile = total*1024;
|
||||
lpmemex->ullTotalPageFile = (ULONG64)total*1024;
|
||||
if (sscanf(buffer, "SwapFree: %lu", &free))
|
||||
lpmemex->ullAvailPageFile = free*1024;
|
||||
lpmemex->ullAvailPageFile = (ULONG64)free*1024;
|
||||
if (sscanf(buffer, "Buffers: %lu", &buffers))
|
||||
lpmemex->ullAvailPhys += buffers*1024;
|
||||
lpmemex->ullAvailPhys += (ULONG64)buffers*1024;
|
||||
if (sscanf(buffer, "Cached: %lu", &cached))
|
||||
lpmemex->ullAvailPhys += cached*1024;
|
||||
lpmemex->ullAvailPhys += (ULONG64)cached*1024;
|
||||
}
|
||||
fclose( f );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue