Nikolay Sivov : kernel32: Forward GetLogicalProcessorInformationEx() to ntdll.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 5 12:18:33 CST 2016


Module: wine
Branch: master
Commit: ae1fe69e3952e13e8361a25058d24e2d2ed6f79c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ae1fe69e3952e13e8361a25058d24e2d2ed6f79c

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Jan  4 01:56:48 2016 +0300

kernel32: Forward GetLogicalProcessorInformationEx() to ntdll.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/process.c       | 23 +++++++++++++++++++----
 dlls/kernel32/tests/process.c |  8 +++++++-
 dlls/ntdll/tests/info.c       |  7 +++++++
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 89ae5c4..7795b47 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -3836,11 +3836,26 @@ BOOL WINAPI GetLogicalProcessorInformation(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION
 /***********************************************************************
  *           GetLogicalProcessorInformationEx   (KERNEL32.@)
  */
-BOOL WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX buffer, PDWORD pBufLen)
+BOOL WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *buffer, DWORD *len)
 {
-    FIXME("(%u,%p,%p): stub\n", relationship, buffer, pBufLen);
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return FALSE;
+    NTSTATUS status;
+
+    TRACE("(%u,%p,%p)\n", relationship, buffer, len);
+
+    if (!len)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+
+    status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship),
+        buffer, *len, len );
+    if (status != STATUS_SUCCESS)
+    {
+        SetLastError( RtlNtStatusToDosError( status ) );
+        return FALSE;
+    }
+    return TRUE;
 }
 
 /***********************************************************************
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index e50efed..df0f2ec 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -3121,9 +3121,15 @@ static void test_GetLogicalProcessorInformationEx(void)
     }
 
     ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, NULL);
-    ok(!ret, "got %d, error %d\n", ret, GetLastError());
+    ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
 
     len = 0;
+    ret = pGetLogicalProcessorInformationEx(RelationProcessorCore, NULL, &len);
+todo_wine {
+    ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError());
+    ok(len > 0, "got %u\n", len);
+}
+    len = 0;
     ret = pGetLogicalProcessorInformationEx(RelationAll, NULL, &len);
 todo_wine {
     ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d, error %d\n", ret, GetLastError());
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index ae907ed..252736e 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -719,6 +719,13 @@ static void test_query_logicalprocex(void)
         return;
 
     len = 0;
+    relationship = RelationProcessorCore;
+    status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len);
+todo_wine {
+    ok(status == STATUS_INFO_LENGTH_MISMATCH, "got 0x%08x\n", status);
+    ok(len > 0, "got %u\n", len);
+}
+    len = 0;
     relationship = RelationAll;
     status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), NULL, 0, &len);
 todo_wine {




More information about the wine-cvs mailing list