Commit bb4a31a8 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

ntdll: Calculate SystemProcessInformation's ReturnLength and return it.

parent 3fc4e884
......@@ -1739,9 +1739,8 @@ NTSTATUS WINAPI NtQuerySystemInformation(
/* spi->ti will be set later on */
len += procstructlen;
}
else ret = STATUS_INFO_LENGTH_MISMATCH;
len += procstructlen;
}
}
SERVER_END_REQ;
......@@ -1751,7 +1750,8 @@ NTSTATUS WINAPI NtQuerySystemInformation(
if (ret == STATUS_NO_MORE_FILES) ret = STATUS_SUCCESS;
break;
}
else /* Length is already checked for */
if (Length >= len)
{
int i, j;
......@@ -1799,6 +1799,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
}
}
if (ret == STATUS_SUCCESS && last) last->NextEntryOffset = 0;
if (len > Length) ret = STATUS_INFO_LENGTH_MISMATCH;
if (hSnap) NtClose(hSnap);
}
break;
......
......@@ -289,7 +289,7 @@ static void test_query_process(void)
ReturnLength = 0;
status = pNtQuerySystemInformation(SystemProcessInformation, NULL, 0, &ReturnLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_LENGTH_MISMATCH got %08x\n", status);
todo_wine ok( ReturnLength > 0 || broken(ReturnLength == 0) /* NT4, Win2K */,
ok( ReturnLength > 0 || broken(ReturnLength == 0) /* NT4, Win2K */,
"Expected a ReturnLength to show the needed length\n");
/* W2K3 and later returns the needed length, the rest returns 0, so we have to loop */
......
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