From 67920ea6dde99e3dafde7f27147dcd80550608c4 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 4 Sep 2012 13:39:35 +0200 Subject: [PATCH] ntdll/tests: Added basic NtQuerySystemInformation(SystemLogicalProcessorInformation) tests. --- dlls/ntdll/tests/info.c | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 4c23552ead..3dce90b824 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -576,6 +576,51 @@ static void test_query_regquota(void) ok( sizeof(srqi) == ReturnLength, "Inconsistent length %d\n", ReturnLength); } +static void test_query_logicalproc(void) +{ + NTSTATUS status; + ULONG len, i, proc_no; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION *slpi; + SYSTEM_INFO si; + + GetSystemInfo(&si); + + status = pNtQuerySystemInformation(SystemLogicalProcessorInformation, NULL, 0, &len); + if(status == STATUS_INVALID_INFO_CLASS) + { + win_skip("SystemLogicalProcessorInformation is not supported\n"); + return; + } + if(status == STATUS_NOT_IMPLEMENTED) + { + todo_wine ok(0, "SystemLogicalProcessorInformation is not implemented\n"); + return; + } + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status); + ok(len%sizeof(*slpi) == 0, "Incorrect length %d\n", len); + + slpi = HeapAlloc(GetProcessHeap(), 0, len); + status = pNtQuerySystemInformation(SystemLogicalProcessorInformation, slpi, len, &len); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); + + proc_no = 0; + for(i=0; i 0, "No processors were found\n"); + if(si.dwNumberOfProcessors <= 32) + ok(proc_no == si.dwNumberOfProcessors, "Incorrect number of logical processors: %d, expected %d\n", + proc_no, si.dwNumberOfProcessors); +} + static void test_query_process_basic(void) { NTSTATUS status; @@ -1513,6 +1558,10 @@ START_TEST(info) trace("Starting test_query_regquota()\n"); test_query_regquota(); + /* 0x49 SystemLogicalProcessorInformation */ + trace("Starting test_query_logicalproc()\n"); + test_query_logicalproc(); + /* NtQueryInformationProcess */ /* 0x0 ProcessBasicInformation */ -- 2.32.0.93.g670b81a890