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

ntdll/tests: Pass properly aligned buffers.

parent d4ebffd2
......@@ -124,18 +124,22 @@ static void test_query_performance(void)
ULONG FullLength;
ULONG ReturnLength;
SYSTEM_PERFORMANCE_INFORMATION spi;
BYTE Buffer[sizeof(SYSTEM_PERFORMANCE_INFORMATION) + 2];
struct SPI_PLUS_EXTRA
{
SYSTEM_PERFORMANCE_INFORMATION spi;
BYTE extra[2];
} spi_plus_extra;
status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, 0, &FullLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, 0, &FullLength);
ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
status = pNtQuerySystemInformation(SystemPerformanceInformation, Buffer, sizeof(spi), &ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, 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, &Buffer, sizeof(Buffer), &ReturnLength);
status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi_plus_extra, sizeof(spi_plus_extra), &ReturnLength);
ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok( ReturnLength == min(FullLength, sizeof(Buffer)), "Inconsistent length %d\n", ReturnLength);
ok( ReturnLength == min(FullLength, sizeof(spi_plus_extra)), "Inconsistent length %d\n", ReturnLength);
/* Not return values yet, as struct members are unknown */
}
......
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