Author: dgorbachev
Date: Fri Aug 7 00:53:04 2009
New Revision: 42440
URL:
http://svn.reactos.org/svn/reactos?rev=42440&view=rev
Log:
Add GetLogicalProcessorInformation() and a stub for ReOpenFile() by Alwyn Tan's
request.
Modified:
trunk/reactos/dll/win32/kernel32/kernel32.pspec
trunk/reactos/dll/win32/kernel32/misc/stubs.c
trunk/reactos/dll/win32/kernel32/misc/sysinfo.c
Modified: trunk/reactos/dll/win32/kernel32/kernel32.pspec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.pspec [iso-8859-1] Fri Aug 7 00:53:04 2009
@@ -400,6 +400,7 @@
@ stdcall GetLogicalDriveStringsA(long ptr)
@ stdcall GetLogicalDriveStringsW(long ptr)
@ stdcall GetLogicalDrives()
+@ stdcall GetLogicalProcessorInformation(ptr ptr)
@ stdcall GetLongPathNameA (str long long)
@ stdcall GetLongPathNameW (wstr long long)
@ stdcall GetMailslotInfo(long ptr ptr ptr ptr)
@@ -710,6 +711,7 @@
@ stdcall QueueUserAPC(ptr long long)
@ stdcall QueueUserWorkItem(ptr ptr long)
@ stdcall RaiseException(long long long ptr)
+@ stub ReOpenFile ;@ stdcall ReOpenFile(ptr long long long)
@ stdcall ReadConsoleA(long ptr long ptr ptr)
@ stdcall ReadConsoleInputA(long ptr long ptr)
@ stdcall ReadConsoleInputExA(long ptr long ptr long)
Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Fri Aug 7 00:53:04 2009
@@ -994,15 +994,6 @@
BOOL
WINAPI
-GetLogicalProcessorInformation(OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,
- IN OUT PDWORD ReturnLength)
-{
- STUB;
- return FALSE;
-}
-
-BOOL
-WINAPI
GetNumaAvailableMemoryNode(IN UCHAR Node,
OUT PULONGLONG AvailableBytes)
{
Modified: trunk/reactos/dll/win32/kernel32/misc/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/sy…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/sysinfo.c [iso-8859-1] Fri Aug 7 00:53:04 2009
@@ -232,3 +232,39 @@
// GetNativeSystemInfo should return PROCESSOR_ARCHITECTURE_AMD64
GetSystemInfo(lpSystemInfo);
}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+GetLogicalProcessorInformation(OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,
+ IN OUT PDWORD ReturnLength)
+{
+ NTSTATUS Status;
+
+ if (!ReturnLength)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ Status = NtQuerySystemInformation(SystemLogicalProcessorInformation,
+ Buffer,
+ *ReturnLength,
+ ReturnLength);
+
+ if (!NT_SUCCESS(Status))
+ {
+ /*
+ * When NtQuerySystemInformation says STATUS_INFO_LENGTH_MISMATCH,
+ * return ERROR_INSUFFICIENT_BUFFER instead of ERROR_BAD_LENGTH.
+ */
+ SetLastErrorByStatus(Status == STATUS_INFO_LENGTH_MISMATCH
+ ? STATUS_BUFFER_TOO_SMALL
+ : Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}