ntdll/tests: Pass properly aligned buffers.

This commit is contained in:
Ge van Geldorp 2009-08-24 21:26:25 +02:00 committed by Alexandre Julliard
parent d4ebffd24e
commit cf5e2938a9
1 changed files with 9 additions and 5 deletions

View File

@ -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 */
}