ntdll/tests: Fix info tests on Win7.

This commit is contained in:
Ge van Geldorp 2009-08-24 14:28:31 +02:00 committed by Alexandre Julliard
parent 2245e2c17e
commit 4bc7a3eb92
1 changed files with 10 additions and 6 deletions

View File

@ -121,19 +121,21 @@ static void test_query_cpu(void)
static void test_query_performance(void)
{
NTSTATUS status;
ULONG FullLength;
ULONG ReturnLength;
SYSTEM_PERFORMANCE_INFORMATION spi;
BYTE Buffer[sizeof(SYSTEM_PERFORMANCE_INFORMATION) + 2];
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, 0, &ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, 0, &FullLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, sizeof(spi), &ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, sizeof(spi), &ReturnLength);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok( sizeof(spi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, sizeof(spi) + 2, &ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &Buffer, sizeof(Buffer), &ReturnLength);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok( sizeof(spi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
ok( ReturnLength == min(FullLength, sizeof(Buffer)), "Inconsistent length %d\n", ReturnLength);
/* Not return values yet, as struct members are unknown */
}
@ -746,6 +748,7 @@ static void test_query_process_handlecount(void)
NTSTATUS status;
ULONG ReturnLength;
DWORD handlecount;
BYTE buffer[2 * sizeof(DWORD)];
HANDLE process;
status = pNtQueryInformationProcess(NULL, ProcessHandleCount, NULL, sizeof(handlecount), NULL);
@ -773,8 +776,9 @@ static void test_query_process_handlecount(void)
ok( sizeof(handlecount) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
CloseHandle(process);
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessHandleCount, &handlecount, sizeof(handlecount) * 2, &ReturnLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessHandleCount, buffer, sizeof(buffer), &ReturnLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH || status == STATUS_SUCCESS,
"Expected STATUS_INFO_LENGTH_MISMATCH or STATUS_SUCCESS, got %08x\n", status);
ok( sizeof(handlecount) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
/* Check if we have some return values */