Commit 7691aca1 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

Only exact buffer size gives STATUS_SUCCESS.

parent a4bb17c3
......@@ -605,7 +605,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
sbi.bKeNumberProcessors = 1; /* FIXME */
len = sizeof(sbi);
if ( Length >= len)
if ( Length == len)
{
if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION;
else memcpy( SystemInformation, &sbi, len);
......
......@@ -78,6 +78,11 @@ static void test_query_basic()
status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08lx\n", status);
/* Check a too large buffer size */
trace("Check a too large buffer size\n");
status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi) * 2, &ReturnLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08lx\n", status);
/* Finally some correct calls */
trace("Check with correct parameters\n");
status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength);
......
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