From ea43b87c004e7ecea2945f141a91112de3f5bcbd Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 26 Sep 2019 13:56:45 +0200 Subject: [PATCH] kernel32: Move NUMA-related functions to kernelbase. Signed-off-by: Alexandre Julliard --- .../api-ms-win-core-memory-l1-1-1.spec | 2 +- .../api-ms-win-core-memory-l1-1-2.spec | 4 +- dlls/kernel32/heap.c | 37 ---- dlls/kernel32/kernel32.spec | 24 +- dlls/kernel32/process.c | 89 -------- dlls/kernelbase/kernelbase.spec | 25 +-- dlls/kernelbase/memory.c | 209 ++++++++++++++++-- 7 files changed, 213 insertions(+), 177 deletions(-) diff --git a/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec b/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec index 3200be9a781..3d5dea93aa5 100644 --- a/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec +++ b/dlls/api-ms-win-core-memory-l1-1-1/api-ms-win-core-memory-l1-1-1.spec @@ -1,5 +1,5 @@ @ stub CreateFileMappingFromApp -@ stub CreateFileMappingNumaW +@ stdcall CreateFileMappingNumaW(long ptr long long long wstr long) kernel32.CreateFileMappingNumaW @ stdcall CreateFileMappingW(long ptr long long long wstr) kernel32.CreateFileMappingW @ stdcall CreateMemoryResourceNotification(long) kernel32.CreateMemoryResourceNotification @ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile diff --git a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec index 85fd48b062e..cb305f228ab 100644 --- a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec +++ b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec @@ -1,7 +1,7 @@ @ stdcall AllocateUserPhysicalPages(long ptr ptr) kernel32.AllocateUserPhysicalPages -@ stub AllocateUserPhysicalPagesNuma +@ stdcall AllocateUserPhysicalPagesNuma(long ptr ptr long) kernel32.AllocateUserPhysicalPagesNuma @ stub CreateFileMappingFromApp -@ stub CreateFileMappingNumaW +@ stdcall CreateFileMappingNumaW(long ptr long long long wstr long) kernel32.CreateFileMappingNumaW @ stdcall CreateFileMappingW(long ptr long long long wstr) kernel32.CreateFileMappingW @ stdcall CreateMemoryResourceNotification(long) kernel32.CreateMemoryResourceNotification @ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index 9360bf69e86..a465ce45d7b 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -911,40 +911,3 @@ BOOL WINAPI GetPhysicallyInstalledSystemMemory(ULONGLONG *total_memory) *total_memory = memstatus.ullTotalPhys / 1024; return TRUE; } - -BOOL WINAPI GetSystemFileCacheSize(PSIZE_T mincache, PSIZE_T maxcache, PDWORD flags) -{ - FIXME("stub: %p %p %p\n", mincache, maxcache, flags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -BOOL WINAPI SetSystemFileCacheSize(SIZE_T mincache, SIZE_T maxcache, DWORD flags) -{ - FIXME("stub: %ld %ld %d\n", mincache, maxcache, flags); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -BOOL WINAPI AllocateUserPhysicalPages(HANDLE process, ULONG_PTR *pages, ULONG_PTR *userarray) -{ - FIXME("stub: %p %p %p\n",process, pages, userarray); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -BOOL WINAPI FreeUserPhysicalPages(HANDLE process, ULONG_PTR *pages, ULONG_PTR *userarray) -{ - FIXME("stub: %p %p %p\n", process, pages, userarray); - *pages = 0; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -BOOL WINAPI MapUserPhysicalPages(PVOID addr, ULONG_PTR page_count, PULONG_PTR pages) -{ - FIXME("(%p, %lu, %p): stub\n", addr, page_count, pages); - *pages = 0; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 1c3e0f632e5..9b07e8917c3 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -150,11 +150,11 @@ @ stdcall AddVectoredContinueHandler(long ptr) ntdll.RtlAddVectoredContinueHandler @ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler # @ stub AdjustCalendarDate -# @ stub AllocateUserPhysicalPagesNuma @ stdcall AllocConsole() @ stub -i386 AllocLSCallback @ stdcall -i386 -private AllocSLCallback(ptr ptr) krnl386.exe16.AllocSLCallback -@ stdcall AllocateUserPhysicalPages(long ptr ptr) +@ stdcall -import AllocateUserPhysicalPages(long ptr ptr) +@ stdcall -import AllocateUserPhysicalPagesNuma(long ptr ptr long) @ stdcall ApplicationRecoveryFinished(long) @ stdcall ApplicationRecoveryInProgress(ptr) @ stdcall -import AreFileApisANSI() @@ -284,7 +284,7 @@ @ stdcall -import CreateFileA(str long long ptr long long long) @ stdcall CreateFileMappingA(long ptr long long long str) # @ stub CreateFileMappingNumaA -# @ stub CreateFileMappingNumaW +@ stdcall -import CreateFileMappingNumaW(long ptr long long long wstr long) @ stdcall -import CreateFileMappingW(long ptr long long long wstr) @ stdcall -import CreateFileW(wstr long long ptr long long long) @ stdcall CreateHardLinkA(str str ptr) @@ -533,7 +533,7 @@ @ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) ntdll.TpCallbackUnloadDllOnCompletion @ stdcall -import FreeResource(long) @ stdcall -i386 -private FreeSLCallback(long) krnl386.exe16.FreeSLCallback -@ stdcall FreeUserPhysicalPages(long ptr ptr) +@ stdcall -import FreeUserPhysicalPages(long ptr ptr) @ stub FreeVirtualBuffer @ stdcall -import GenerateConsoleCtrlEvent(long long) @ stdcall -i386 -private Get16DLLAddress(long str) krnl386.exe16.Get16DLLAddress @@ -709,8 +709,8 @@ @ stdcall GetLogicalDriveStringsA(long ptr) @ stdcall GetLogicalDriveStringsW(long ptr) @ stdcall GetLogicalDrives() -@ stdcall GetLogicalProcessorInformation(ptr ptr) -@ stdcall GetLogicalProcessorInformationEx(long ptr ptr) +@ stdcall -import GetLogicalProcessorInformation(ptr ptr) +@ stdcall -import GetLogicalProcessorInformationEx(long ptr ptr) @ stdcall -import GetLongPathNameA (str long long) # @ stub GetLongPathNameTransactedA # @ stub GetLongPathNameTransactedW @@ -743,15 +743,15 @@ # @ stub GetNumaAvailableMemory @ stdcall GetNumaAvailableMemoryNode(long ptr) @ stdcall GetNumaAvailableMemoryNodeEx(long ptr) -@ stdcall GetNumaHighestNodeNumber(ptr) +@ stdcall -import GetNumaHighestNodeNumber(ptr) # @ stub GetNumaNodeNumberFromHandle @ stdcall GetNumaNodeProcessorMask(long ptr) -@ stdcall GetNumaNodeProcessorMaskEx(long ptr) +@ stdcall -import GetNumaNodeProcessorMaskEx(long ptr) # @ stub GetNumaProcessorMap @ stdcall GetNumaProcessorNode(long ptr) @ stdcall GetNumaProcessorNodeEx(ptr ptr) @ stdcall GetNumaProximityNode(long ptr) -@ stdcall GetNumaProximityNodeEx(long ptr) +@ stdcall -import GetNumaProximityNodeEx(long ptr) @ stdcall GetNumberFormatA(long long str ptr ptr long) @ stdcall GetNumberFormatEx(wstr long wstr ptr ptr long) @ stdcall GetNumberFormatW(long long wstr ptr ptr long) @@ -817,7 +817,7 @@ @ stdcall GetStringTypeExA(long long str long ptr) @ stdcall GetStringTypeExW(long long wstr long ptr) @ stdcall GetStringTypeW(long wstr long ptr) -@ stdcall GetSystemFileCacheSize(ptr ptr ptr) +@ stdcall -import GetSystemFileCacheSize(ptr ptr ptr) @ stdcall -import GetSystemDefaultLCID() @ stdcall -import GetSystemDefaultLangID() @ stdcall -import GetSystemDefaultLocaleName(ptr long) @@ -1076,7 +1076,7 @@ @ stdcall -i386 -private MapLS(ptr) krnl386.exe16.MapLS @ stdcall -i386 -private MapSL(long) krnl386.exe16.MapSL @ stdcall -i386 -private MapSLFix(long) krnl386.exe16.MapSLFix -@ stdcall MapUserPhysicalPages(ptr long ptr) +@ stdcall -import MapUserPhysicalPages(ptr long ptr) # @ stub MapUserPhysicalPagesScatter @ stdcall -import MapViewOfFile(long long long long long) @ stdcall -import MapViewOfFileEx(long long long long long ptr) @@ -1438,7 +1438,7 @@ @ stdcall SetSearchPathMode(long) @ stdcall -import SetStdHandle(long long) @ stdcall -import SetStdHandleEx(long long ptr) -@ stdcall SetSystemFileCacheSize(long long long) +@ stdcall -import SetSystemFileCacheSize(long long long) @ stdcall SetSystemPowerState(long long) @ stdcall -import SetSystemTime(ptr) @ stdcall SetSystemTimeAdjustment(long long) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 11ebde62e1f..267bb9aebf2 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -3678,66 +3678,6 @@ HANDLE WINAPI KERNEL32_GetCurrentProcess(void) return (HANDLE)~(ULONG_PTR)0; } -/*********************************************************************** - * GetLogicalProcessorInformation (KERNEL32.@) - */ -BOOL WINAPI GetLogicalProcessorInformation(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer, PDWORD pBufLen) -{ - NTSTATUS status; - - TRACE("(%p,%p)\n", buffer, pBufLen); - - if(!pBufLen) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - status = NtQuerySystemInformation( SystemLogicalProcessorInformation, buffer, *pBufLen, pBufLen); - - if (status == STATUS_INFO_LENGTH_MISMATCH) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - return FALSE; - } - if (status != STATUS_SUCCESS) - { - SetLastError( RtlNtStatusToDosError( status ) ); - return FALSE; - } - return TRUE; -} - -/*********************************************************************** - * GetLogicalProcessorInformationEx (KERNEL32.@) - */ -BOOL WINAPI GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *buffer, DWORD *len) -{ - 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_INFO_LENGTH_MISMATCH) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - return FALSE; - } - if (status != STATUS_SUCCESS) - { - SetLastError( RtlNtStatusToDosError( status ) ); - return FALSE; - } - return TRUE; -} - /*********************************************************************** * CmdBatNotification (KERNEL32.@) * @@ -3834,16 +3774,6 @@ HRESULT WINAPI GetApplicationRestartSettings(HANDLE process, WCHAR *cmdline, DWO return E_NOTIMPL; } -/********************************************************************** - * GetNumaHighestNodeNumber (KERNEL32.@) - */ -BOOL WINAPI GetNumaHighestNodeNumber(PULONG highestnode) -{ - *highestnode = 0; - FIXME("(%p): semi-stub\n", highestnode); - return TRUE; -} - /********************************************************************** * GetNumaNodeProcessorMask (KERNEL32.@) */ @@ -3854,16 +3784,6 @@ BOOL WINAPI GetNumaNodeProcessorMask(UCHAR node, PULONGLONG mask) return FALSE; } -/********************************************************************** - * GetNumaNodeProcessorMaskEx (KERNEL32.@) - */ -BOOL WINAPI GetNumaNodeProcessorMaskEx(USHORT node, PGROUP_AFFINITY mask) -{ - FIXME("(%hu %p): stub\n", node, mask); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - /********************************************************************** * GetNumaAvailableMemoryNode (KERNEL32.@) */ @@ -3923,15 +3843,6 @@ BOOL WINAPI GetNumaProximityNode(ULONG proximity_id, PUCHAR node_number) return FALSE; } -/*********************************************************************** - * GetNumaProximityNodeEx (KERNEL32.@) - */ -BOOL WINAPI GetNumaProximityNodeEx(ULONG proximity_id, PUSHORT node_number) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - /********************************************************************** * GetProcessDEPPolicy (KERNEL32.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index fed2adc87d6..d4c878fb45e 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -32,8 +32,8 @@ @ stdcall AllocConsole() kernel32.AllocConsole @ stdcall AllocateAndInitializeSid(ptr long long long long long long long long long ptr) @ stdcall AllocateLocallyUniqueId(ptr) -@ stdcall AllocateUserPhysicalPages(long ptr ptr) kernel32.AllocateUserPhysicalPages -# @ stub AllocateUserPhysicalPagesNuma +@ stdcall AllocateUserPhysicalPages(long ptr ptr) +@ stdcall AllocateUserPhysicalPagesNuma(long ptr ptr long) # @ stub AppContainerDeriveSidFromMoniker # @ stub AppContainerFreeMemory # @ stub AppContainerLookupDisplayNameMrtReference @@ -188,7 +188,7 @@ @ stdcall CreateFile2(wstr long long long ptr) @ stdcall CreateFileA(str long long ptr long long long) # @ stub CreateFileMappingFromApp -@ stub CreateFileMappingNumaW +@ stdcall CreateFileMappingNumaW(long ptr long long long wstr long) @ stdcall CreateFileMappingW(long ptr long long long wstr) @ stdcall CreateFileW(wstr long long ptr long long long) @ stdcall CreateHardLinkA(str str ptr) kernel32.CreateHardLinkA @@ -399,7 +399,7 @@ @ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) ntdll.TpCallbackUnloadDllOnCompletion @ stdcall FreeResource(long) @ stdcall FreeSid(ptr) -@ stdcall FreeUserPhysicalPages(long ptr ptr) kernel32.FreeUserPhysicalPages +@ stdcall FreeUserPhysicalPages(long ptr ptr) @ stdcall GenerateConsoleCtrlEvent(long long) # @ stub GenerateGPNotificationInternal @ stdcall GetACP() kernel32.GetACP @@ -547,8 +547,8 @@ @ stdcall GetLocaleInfoW(long long ptr long) kernel32.GetLocaleInfoW @ stdcall GetLogicalDriveStringsW(long ptr) kernel32.GetLogicalDriveStringsW @ stdcall GetLogicalDrives() kernel32.GetLogicalDrives -@ stdcall GetLogicalProcessorInformation(ptr ptr) kernel32.GetLogicalProcessorInformation -@ stdcall GetLogicalProcessorInformationEx(long ptr ptr) kernel32.GetLogicalProcessorInformationEx +@ stdcall GetLogicalProcessorInformation(ptr ptr) +@ stdcall GetLogicalProcessorInformationEx(long ptr ptr) @ stdcall GetLongPathNameA(str long long) @ stdcall GetLongPathNameW(wstr long long) # @ stub GetMappedFileNameA @@ -574,10 +574,9 @@ @ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) @ stdcall GetNativeSystemInfo(ptr) kernel32.GetNativeSystemInfo # @ stub GetNextFgPolicyRefreshInfoInternal -@ stdcall GetNumaHighestNodeNumber(ptr) kernel32.GetNumaHighestNodeNumber -@ stdcall GetNumaNodeProcessorMaskEx(long ptr) kernel32.GetNumaNodeProcessorMaskEx -@ stdcall GetNumaProximityNode(long ptr) kernel32.GetNumaProximityNode -@ stdcall GetNumaProximityNodeEx(long ptr) kernel32.GetNumaProximityNodeEx +@ stdcall GetNumaHighestNodeNumber(ptr) +@ stdcall GetNumaNodeProcessorMaskEx(long ptr) +@ stdcall GetNumaProximityNodeEx(long ptr) @ stdcall GetNumberFormatEx(wstr long wstr ptr ptr long) kernel32.GetNumberFormatEx @ stdcall GetNumberFormatW(long long wstr ptr ptr long) kernel32.GetNumberFormatW @ stdcall GetNumberOfConsoleInputEvents(long ptr) @@ -687,7 +686,7 @@ @ stdcall GetSystemDefaultUILanguage() @ stdcall GetSystemDirectoryA(ptr long) @ stdcall GetSystemDirectoryW(ptr long) -@ stdcall GetSystemFileCacheSize(ptr ptr ptr) kernel32.GetSystemFileCacheSize +@ stdcall GetSystemFileCacheSize(ptr ptr ptr) @ stdcall GetSystemFirmwareTable(long long ptr long) kernel32.GetSystemFirmwareTable @ stdcall GetSystemInfo(ptr) kernel32.GetSystemInfo # @ stub GetSystemMetadataPath @@ -949,7 +948,7 @@ @ stdcall MakeSelfRelativeSD(ptr ptr ptr) @ stdcall MapGenericMask(ptr ptr) # @ stub MapPredefinedHandleInternal -@ stdcall MapUserPhysicalPages(ptr long ptr) kernel32.MapUserPhysicalPages +@ stdcall MapUserPhysicalPages(ptr long ptr) @ stdcall MapViewOfFile(long long long long long) @ stdcall MapViewOfFileEx(long long long long long ptr) @ stdcall MapViewOfFileExNuma(long long long long long ptr long) @@ -1475,7 +1474,7 @@ # @ stub SetStateVersion @ stdcall SetStdHandle(long long) @ stdcall SetStdHandleEx(long long ptr) -@ stdcall SetSystemFileCacheSize(long long long) kernel32.SetSystemFileCacheSize +@ stdcall SetSystemFileCacheSize(long long long) @ stdcall SetSystemTime(ptr) @ stdcall SetSystemTimeAdjustment(long long) kernel32.SetSystemTimeAdjustment @ stdcall SetThreadContext(long ptr) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index aee69d4d78a..dc28a1e397e 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -60,6 +60,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH FlushViewOfFile( const void *base, SIZE_T size ) } +/*********************************************************************** + * GetSystemFileCacheSize (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetSystemFileCacheSize( SIZE_T *mincache, SIZE_T *maxcache, DWORD *flags ) +{ + FIXME( "stub: %p %p %p\n", mincache, maxcache, flags ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + /*********************************************************************** * GetWriteWatch (kernelbase.@) */ @@ -118,18 +129,6 @@ LPVOID WINAPI DECLSPEC_HOTPATCH MapViewOfFileEx( HANDLE handle, DWORD access, DW } -/*********************************************************************** - * MapViewOfFileExNuma (kernelbase.@) - */ -LPVOID WINAPI DECLSPEC_HOTPATCH MapViewOfFileExNuma( HANDLE handle, DWORD access, DWORD offset_high, - DWORD offset_low, SIZE_T count, LPVOID addr, - DWORD numa_node ) -{ - FIXME( "Ignoring preferred numa_node\n" ); - return MapViewOfFileEx( handle, access, offset_high, offset_low, count, addr ); -} - - /*********************************************************************** * ReadProcessMemory (kernelbase.@) */ @@ -151,6 +150,17 @@ UINT WINAPI DECLSPEC_HOTPATCH ResetWriteWatch( void *base, SIZE_T size ) } +/*********************************************************************** + * SetSystemFileCacheSize (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH SetSystemFileCacheSize( SIZE_T mincache, SIZE_T maxcache, DWORD flags ) +{ + FIXME( "stub: %ld %ld %d\n", mincache, maxcache, flags ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + /*********************************************************************** * UnmapViewOfFile (kernelbase.@) */ @@ -191,17 +201,6 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocEx( HANDLE process, void *addr, SIZE } -/*********************************************************************** - * VirtualAllocExNuma (kernelbase.@) - */ -LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma( HANDLE process, void *addr, SIZE_T size, - DWORD type, DWORD protect, DWORD numa_node ) -{ - FIXME( "Ignoring preferred numa_node\n" ); - return VirtualAllocEx( process, addr, size, type, protect ); -} - - /*********************************************************************** * VirtualFree (kernelbase.@) */ @@ -788,3 +787,167 @@ BOOL WINAPI DECLSPEC_HOTPATCH QueryMemoryResourceNotification( HANDLE handle, BO SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } + + +/*********************************************************************** + * Physical memory functions + ***********************************************************************/ + + +/*********************************************************************** + * AllocateUserPhysicalPages (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH AllocateUserPhysicalPages( HANDLE process, ULONG_PTR *pages, + ULONG_PTR *userarray ) +{ + FIXME( "stub: %p %p %p\n", process, pages, userarray ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + +/*********************************************************************** + * FreeUserPhysicalPages (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH FreeUserPhysicalPages( HANDLE process, ULONG_PTR *pages, + ULONG_PTR *userarray ) +{ + FIXME( "stub: %p %p %p\n", process, pages, userarray ); + *pages = 0; + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + +/*********************************************************************** + * MapUserPhysicalPages (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH MapUserPhysicalPages( void *addr, ULONG_PTR page_count, ULONG_PTR *pages ) +{ + FIXME( "stub: %p %lu %p\n", addr, page_count, pages ); + *pages = 0; + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + +/*********************************************************************** + * NUMA functions + ***********************************************************************/ + + +/*********************************************************************** + * AllocateUserPhysicalPagesNuma (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH AllocateUserPhysicalPagesNuma( HANDLE process, ULONG_PTR *pages, + ULONG_PTR *userarray, DWORD node ) +{ + if (node) FIXME( "Ignoring preferred node %u\n", node ); + return AllocateUserPhysicalPages( process, pages, userarray ); +} + + +/*********************************************************************** + * CreateFileMappingNumaW (kernelbase.@) + */ +HANDLE WINAPI DECLSPEC_HOTPATCH CreateFileMappingNumaW( HANDLE file, LPSECURITY_ATTRIBUTES sa, + DWORD protect, DWORD size_high, DWORD size_low, + LPCWSTR name, DWORD node ) +{ + if (node) FIXME( "Ignoring preferred node %u\n", node ); + return CreateFileMappingW( file, sa, protect, size_high, size_low, name ); +} + + +/*********************************************************************** + * GetLogicalProcessorInformation (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetLogicalProcessorInformation( SYSTEM_LOGICAL_PROCESSOR_INFORMATION *buffer, + DWORD *len ) +{ + NTSTATUS status; + + if (!len) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + status = NtQuerySystemInformation( SystemLogicalProcessorInformation, buffer, *len, len ); + if (status == STATUS_INFO_LENGTH_MISMATCH) status = STATUS_BUFFER_TOO_SMALL; + return set_ntstatus( status ); +} + + +/*********************************************************************** + * GetLogicalProcessorInformationEx (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetLogicalProcessorInformationEx( LOGICAL_PROCESSOR_RELATIONSHIP relationship, + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *buffer, DWORD *len ) +{ + NTSTATUS status; + + if (!len) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &relationship, + sizeof(relationship), buffer, *len, len ); + if (status == STATUS_INFO_LENGTH_MISMATCH) status = STATUS_BUFFER_TOO_SMALL; + return set_ntstatus( status ); +} + + +/********************************************************************** + * GetNumaHighestNodeNumber (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetNumaHighestNodeNumber( ULONG *node ) +{ + FIXME( "semi-stub: %p\n", node ); + *node = 0; + return TRUE; +} + + +/********************************************************************** + * GetNumaNodeProcessorMaskEx (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetNumaNodeProcessorMaskEx( USHORT node, GROUP_AFFINITY *mask ) +{ + FIXME( "stub: %hu %p\n", node, mask ); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + +/*********************************************************************** + * GetNumaProximityNodeEx (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH GetNumaProximityNodeEx( ULONG proximity_id, USHORT *node ) +{ + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + + +/*********************************************************************** + * MapViewOfFileExNuma (kernelbase.@) + */ +LPVOID WINAPI DECLSPEC_HOTPATCH MapViewOfFileExNuma( HANDLE handle, DWORD access, DWORD offset_high, + DWORD offset_low, SIZE_T count, LPVOID addr, + DWORD node ) +{ + if (node) FIXME( "Ignoring preferred node %u\n", node ); + return MapViewOfFileEx( handle, access, offset_high, offset_low, count, addr ); +} + + +/*********************************************************************** + * VirtualAllocExNuma (kernelbase.@) + */ +LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma( HANDLE process, void *addr, SIZE_T size, + DWORD type, DWORD protect, DWORD node ) +{ + if (node) FIXME( "Ignoring preferred node %u\n", node ); + return VirtualAllocEx( process, addr, size, type, protect ); +}