[PATCH 2/4] ntdll: Implement NtGetCurrentProcessorNumber

Detlef Riekenberg wine.dev at web.de
Thu May 17 12:28:32 CDT 2012


This is ok for single core, but a stub for multi-core.

--
By by ... Detlef
---
 dlls/ntdll/ntdll.spec |    1 +
 dlls/ntdll/thread.c   |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index bd9d41e..cff7081 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -176,6 +176,7 @@
 @ stdcall NtFreeVirtualMemory(long ptr ptr long)
 @ stdcall NtFsControlFile(long long long long long long long long long long)
 @ stdcall NtGetContextThread(long ptr)
+@ stdcall NtGetCurrentProcessorNumber()
 # @ stub NtGetDevicePowerState
 @ stub NtGetPlugPlayEvent
 @ stdcall NtGetTickCount()
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index e328c5f..282e86a 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -1173,3 +1173,20 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
         return STATUS_NOT_IMPLEMENTED;
     }
 }
+
+/******************************************************************************
+ * NtGetCurrentProcessorNumber (NTDLL.@)
+ *
+ * Return the processor, on which the thread is running
+ * 
+ */
+ULONG WINAPI NtGetCurrentProcessorNumber(void)
+{
+
+    if (NtCurrentTeb()->Peb->NumberOfProcessors > 1) {
+        FIXME("need multicore support (%d processors)\n", NtCurrentTeb()->Peb->NumberOfProcessors);
+    }
+
+    /* fallback to the first processor */
+    return 0;
+}
-- 
1.7.5.4




More information about the wine-patches mailing list