ntdll: Set the IdleTime member from the SystemPerformanceInformation info class in NtQuerySystemInformation.

This commit is contained in:
Louis Lenders 2010-11-19 18:57:08 +01:00 committed by Alexandre Julliard
parent 4229b1f3b6
commit fa2b7066e5
1 changed files with 16 additions and 0 deletions

View File

@ -1370,12 +1370,28 @@ NTSTATUS WINAPI NtQuerySystemInformation(
{
SYSTEM_PERFORMANCE_INFORMATION spi;
static BOOL fixme_written = FALSE;
FILE *fp;
memset(&spi, 0 , sizeof(spi));
len = sizeof(spi);
spi.Reserved3 = 0x7fffffff; /* Available paged pool memory? */
if ((fp = fopen("/proc/uptime", "r")))
{
double uptime, idle_time;
fscanf(fp, "%lf %lf", &uptime, &idle_time);
fclose(fp);
spi.IdleTime.QuadPart = 10000000 * idle_time;
}
else
{
static ULONGLONG idle;
/* many programs expect IdleTime to change so fake change */
spi.IdleTime.QuadPart = ++idle;
}
if (Length >= len)
{
if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION;