[RTL][NTDLL] Implement processor related NT6+ functions

Implements RtlGetCurrentProcessorNumberEx, RtlIsProcessorFeaturePresent
This commit is contained in:
Timo Kreuzer
2026-07-01 21:45:34 +00:00
parent dbb4d36927
commit ed51a5d1e2
6 changed files with 52 additions and 9 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ set_module_type(ntdll win32dll ENTRYPOINT 0)
set_subsystem(ntdll console)
################# END HACK #################
target_link_libraries(ntdll ntdll_vista_static etwtrace csrlib rtl rtl_um rtl_vista ntdllsys libcntpr setjmp uuid ${PSEH_LIB})
target_link_libraries(ntdll ntdll_vista_static etwtrace csrlib rtl rtl_um rtl_vista ntdllsys ntdllsys_nt6 libcntpr setjmp uuid ${PSEH_LIB})
if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600)
target_link_libraries(ntdll cryptlib ntdllsys_nt6)
endif()
+2
View File
@@ -879,6 +879,7 @@
@ stdcall RtlGetCurrentDirectory_U(long ptr)
@ stdcall RtlGetCurrentPeb()
@ stdcall RtlGetCurrentProcessorNumber() ; 5.2 SP1 and higher
@ stdcall -version=0x601+ RtlGetCurrentProcessorNumberEx(ptr)
@ stdcall -stub -version=0x600+ RtlGetCurrentTransaction()
@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr)
@ stdcall RtlGetElementGenericTable(ptr long)
@@ -999,6 +1000,7 @@
@ stdcall RtlIsGenericTableEmptyAvl(ptr)
@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr)
@ stdcall -stub -version=0x600+ RtlIsNormalizedString(long ptr long ptr)
@ stdcall -version=0xA00+ RtlIsProcessorFeaturePresent(long)
@ stdcall RtlIsTextUnicode(ptr long ptr)
@ stdcall RtlIsThreadWithinLoaderCallout()
@ stdcall RtlIsValidHandle(ptr ptr)
+2
View File
@@ -25,8 +25,10 @@
@ stdcall RtlLcidToLocaleName(long ptr long long)
@ stdcall RtlLocaleNameToLcid(wstr ptr long)
@ stdcall RtlCompareUnicodeStrings(wstr long wstr long long)
@ stdcall RtlGetCurrentProcessorNumberEx(ptr)
@ stdcall -arch=i386 RtlInterlockedPushListSListEx(ptr ptr ptr long)
@ stdcall -arch=!i386 RtlInterlockedPushListSListEx(ptr ptr ptr long) ntdll.RtlInterlockedPushListSList
@ stdcall RtlIsProcessorFeaturePresent(long)
@ stdcall RtlUnicodeToUTF8N(ptr long ptr wstr long)
@ stdcall RtlUTF8ToUnicodeN(ptr long ptr str long)
+2
View File
@@ -70,6 +70,7 @@ list(APPEND SOURCE
prefix.c
priv.c
process.c
processor.c
propvar.c
random.c
rangelist.c
@@ -138,6 +139,7 @@ list(APPEND SOURCE_VISTA
${RTL_WINE_SOURCE_VISTA}
condvar.c
locale.c
processor.c
runonce.c
slist.c
srw.c
-8
View File
@@ -486,14 +486,6 @@ RtlSetProcessIsCritical(IN BOOLEAN NewValue,
sizeof(ULONG));
}
ULONG
NTAPI
RtlGetCurrentProcessorNumber(VOID)
{
/* Forward to kernel */
return NtGetCurrentProcessorNumber();
}
_IRQL_requires_max_(APC_LEVEL)
ULONG
NTAPI
+45
View File
@@ -0,0 +1,45 @@
/*
* PROJECT: ReactOS runtime library (RTL)
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: Implementation of processor related routines
* COPYRIGHT: Copyright 2026 Timo Kreuzer <[email protected]>
*/
/* INCLUDES *****************************************************************/
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
BOOLEAN
NTAPI
RtlIsProcessorFeaturePresent(
_In_ ULONG ProcessorFeature)
{
if (ProcessorFeature >= RTL_NUMBER_OF(SharedUserData->ProcessorFeatures))
{
return FALSE;
}
return SharedUserData->ProcessorFeatures[ProcessorFeature] != 0;
}
ULONG
NTAPI
RtlGetCurrentProcessorNumber(
VOID)
{
return NtGetCurrentProcessorNumber();
}
VOID
NTAPI
RtlGetCurrentProcessorNumberEx(
_Out_ PPROCESSOR_NUMBER ProcessorNumber)
{
NtGetCurrentProcessorNumberEx(ProcessorNumber);
}