[PATCH v2 1/2] kernel32: Partially implement VirtualAllocExNuma
Fabian Maurer
dark.shadow4 at web.de
Sun Mar 31 12:09:08 CDT 2019
Ignoring the preferred node should be good enough
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46927
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
---
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/virtual.c | 27 +++++++++++++++++++++++++++
include/winbase.h | 1 +
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index c8d52cec58..1cf7b58a02 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1559,7 +1559,7 @@
@ stdcall VerifyVersionInfoW(long long int64)
@ stdcall VirtualAlloc(ptr long long long)
@ stdcall VirtualAllocEx(long ptr long long long)
-# @ stub VirtualAllocExNuma
+@ stdcall VirtualAllocExNuma(long ptr long long long long)
@ stub VirtualBufferExceptionHandler
@ stdcall VirtualFree(ptr long long)
@ stdcall VirtualFreeEx(long ptr long long)
diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c
index 42da7f0d8c..35ca4c0876 100644
--- a/dlls/kernel32/virtual.c
+++ b/dlls/kernel32/virtual.c
@@ -46,6 +46,7 @@
WINE_DECLARE_DEBUG_CHANNEL(seh);
WINE_DECLARE_DEBUG_CHANNEL(file);
+WINE_DECLARE_DEBUG_CHANNEL(virtual);
/***********************************************************************
@@ -100,6 +101,32 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocEx( HANDLE hProcess, LPVOID addr, SI
return ret;
}
+/***********************************************************************
+ * VirtualAllocExNuma (KERNEL32.@)
+ *
+ * Seems to be just as VirtualAllocEx, but with a preferred NUMA node.
+ *
+ * PARAMS
+ * process [I] Handle to process to do mem operation.
+ * addr [I] Address of region to reserve or commit.
+ * size [I] Size of region.
+ * type [I] Type of allocation.
+ * protect [I] Type of access protection.
+ * numa_node[I] Preferred NUMA node.
+ *
+ *
+ * RETURNS
+ * Success: Base address of allocated region of pages.
+ * Failure: NULL.
+ */
+LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma(HANDLE process, void *addr, SIZE_T size,
+ DWORD type, DWORD protect, DWORD numa_node)
+{
+ FIXME_(virtual)("Ignoring preferred numa_node\n");
+
+ return VirtualAllocEx(process, addr, size, type, protect);
+}
+
/***********************************************************************
* VirtualFree (KERNEL32.@)
diff --git a/include/winbase.h b/include/winbase.h
index 20c73af319..49d0e7ed08 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2698,6 +2698,7 @@ WINBASEAPI BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDL
#define VerifyVersionInfo WINELIB_NAME_AW(VerifyVersionInfo)
WINBASEAPI LPVOID WINAPI VirtualAlloc(LPVOID,SIZE_T,DWORD,DWORD);
WINBASEAPI LPVOID WINAPI VirtualAllocEx(HANDLE,LPVOID,SIZE_T,DWORD,DWORD);
+WINBASEAPI LPVOID WINAPI VirtualAllocExNuma(HANDLE,void*,SIZE_T,DWORD,DWORD,DWORD);
WINBASEAPI BOOL WINAPI VirtualFree(LPVOID,SIZE_T,DWORD);
WINBASEAPI BOOL WINAPI VirtualFreeEx(HANDLE,LPVOID,SIZE_T,DWORD);
WINBASEAPI BOOL WINAPI VirtualLock(LPVOID,SIZE_T);
--
2.21.0
More information about the wine-devel
mailing list