ntdll: Add ReturnLength test for NtQuerySystemInformation with SystemProcessInformation.

This commit is contained in:
Akihiro Sagawa 2012-10-23 23:52:33 +09:00 committed by Alexandre Julliard
parent 8ab1fc5ff7
commit 3fc4e88473
1 changed files with 7 additions and 1 deletions

View File

@ -285,8 +285,14 @@ static void test_query_process(void)
ULONG SystemInformationLength = sizeof(SYSTEM_PROCESS_INFORMATION_PRIVATE);
SYSTEM_PROCESS_INFORMATION_PRIVATE *spi, *spi_buf = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength);
/* Only W2K3 returns the needed length, the rest returns 0, so we have to loop */
/* test ReturnLength */
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 */,
"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 */
for (;;)
{
status = pNtQuerySystemInformation(SystemProcessInformation, spi_buf, SystemInformationLength, &ReturnLength);