Commit 4bc7a3eb authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

ntdll/tests: Fix info tests on Win7.

parent 2245e2c1
......@@ -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 */
......
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