Commit fa2b7066 authored by Louis Lenders's avatar Louis Lenders Committed by Alexandre Julliard

ntdll: Set the IdleTime member from the SystemPerformanceInformation info class…

ntdll: Set the IdleTime member from the SystemPerformanceInformation info class in NtQuerySystemInformation.
parent 4229b1f3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment