Only exact buffer size gives STATUS_SUCCESS.
This commit is contained in:
parent
a4bb17c314
commit
7691aca10c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue