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@web.de --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/virtual.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 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..e859dd4dcb 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 + * hProcess [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 hProcess, LPVOID addr, SIZE_T size, + DWORD type, DWORD protect, DWORD numa_node) +{ + FIXME_(virtual)("Ignoring preferred numa_node\n"); + + return VirtualAllocEx(hProcess, addr, size, type, protect); +} +
/*********************************************************************** * VirtualFree (KERNEL32.@) -- 2.21.0
Follow up to https://bugs.winehq.org/show_bug.cgi?id=46927
Signed-off-by: Fabian Maurer dark.shadow4@web.de --- dlls/kernel32/file.c | 25 +++++++++++++++++++++++++ dlls/kernel32/kernel32.spec | 4 ++-- include/winbase.h | 6 ++++++ 3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 3214d724cb..3d18e48096 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -2349,6 +2349,31 @@ BOOL WINAPI FindNextFileA( HANDLE handle, WIN32_FIND_DATAA *data ) }
+/************************************************************************** + * FindFirstStreamW (KERNEL32.@) + */ +HANDLE WINAPI FindFirstStreamW(LPCWSTR lpFileName, STREAM_INFO_LEVELS infoLevel, + LPVOID lpFindStreamData, DWORD dwFlags) +{ + FIXME("(%s, %d, %p, %x): stub!\n", debugstr_w(lpFileName), infoLevel, lpFindStreamData, dwFlags); + + SetLastError(ERROR_HANDLE_EOF); + return INVALID_HANDLE_VALUE; +} + + +/************************************************************************** + * FindNextStreamW (KERNEL32.@) + */ +BOOL WINAPI FindNextStreamW(HANDLE hFindStream, LPVOID lpFindStreamData) +{ + FIXME("(%p, %p): stub!\n", hFindStream, lpFindStreamData); + + SetLastError(ERROR_HANDLE_EOF); + return FALSE; +} + + /************************************************************************** * GetFileAttributesW (KERNEL32.@) */ diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 1cf7b58a02..ff0be6cf47 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -488,7 +488,7 @@ # @ stub FindFirstFileTransactedW @ stdcall FindFirstFileW(wstr ptr) # @ stub FindFirstStreamTransactedW -# @ stub FindFirstStreamW +@ stub FindFirstStreamW(str long ptr long) @ stdcall FindFirstVolumeA(ptr long) @ stdcall FindFirstVolumeMountPointA(str ptr long) @ stdcall FindFirstVolumeMountPointW(wstr ptr long) @@ -497,7 +497,7 @@ @ stdcall FindNextFileA(long ptr) # @ stub FindNextFileNameW @ stdcall FindNextFileW(long ptr) -# @ stub FindNextStreamW +@ stdcall FindNextStreamW(long ptr) @ stdcall FindNextVolumeA(long ptr long) @ stub FindNextVolumeMountPointA @ stub FindNextVolumeMountPointW diff --git a/include/winbase.h b/include/winbase.h index 20c73af319..e5377d43f5 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1717,6 +1717,12 @@ typedef struct _UMS_SCHEDULER_STARTUP_INFO typedef enum _RTL_UMS_SCHEDULER_REASON UMS_SCHEDULER_REASON; typedef enum _RTL_UMS_THREAD_INFO_CLASS UMS_THREAD_INFO_CLASS, *PUMS_THREAD_INFO_CLASS;
+typedef enum _STREAM_INFO_LEVELS +{ + FindStreamInfoStandard, + FindStreamInfoMaxInfoLevel +} STREAM_INFO_LEVELS; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); -- 2.21.0
On 3/30/19 10:40 PM, Fabian Maurer wrote:
+/**************************************************************************
FindFirstStreamW (KERNEL32.@)
- */
+HANDLE WINAPI FindFirstStreamW(LPCWSTR lpFileName, STREAM_INFO_LEVELS infoLevel,
- LPVOID lpFindStreamData, DWORD dwFlags)
+{
- FIXME("(%s, %d, %p, %x): stub!\n", debugstr_w(lpFileName), infoLevel, lpFindStreamData, dwFlags);
- SetLastError(ERROR_HANDLE_EOF);
- return INVALID_HANDLE_VALUE;
+}
+/**************************************************************************
FindNextStreamW (KERNEL32.@)
- */
+BOOL WINAPI FindNextStreamW(HANDLE hFindStream, LPVOID lpFindStreamData) +{
- FIXME("(%p, %p): stub!\n", hFindStream, lpFindStreamData);
- SetLastError(ERROR_HANDLE_EOF);
- return FALSE;
+}
Please use better argument and type names.
Regarding error code, will it work if you set it to NOT_IMPLEMENTED?
@@ -488,7 +488,7 @@ # @ stub FindFirstFileTransactedW @ stdcall FindFirstFileW(wstr ptr) # @ stub FindFirstStreamTransactedW -# @ stub FindFirstStreamW +@ stub FindFirstStreamW(str long ptr long) @ stdcall FindFirstVolumeA(ptr long) @ stdcall FindFirstVolumeMountPointA(str ptr long)
Why 'stub'? Is it enough to have 'stub' entry for application to work? Also first argument type is wrong.
On Sonntag, 31. März 2019 08:36:17 CEST Nikolay Sivov wrote:
On 3/30/19 10:40 PM, Fabian Maurer wrote:
+/************************************************************************ ** + * FindFirstStreamW (KERNEL32.@)
- */
+HANDLE WINAPI FindFirstStreamW(LPCWSTR lpFileName, STREAM_INFO_LEVELS infoLevel, + LPVOID lpFindStreamData, DWORD dwFlags) +{
- FIXME("(%s, %d, %p, %x): stub!\n", debugstr_w(lpFileName), infoLevel,
lpFindStreamData, dwFlags); +
- SetLastError(ERROR_HANDLE_EOF);
- return INVALID_HANDLE_VALUE;
+}
+/************************************************************************ ** + * FindNextStreamW (KERNEL32.@)
- */
+BOOL WINAPI FindNextStreamW(HANDLE hFindStream, LPVOID lpFindStreamData) +{
- FIXME("(%p, %p): stub!\n", hFindStream, lpFindStreamData);
- SetLastError(ERROR_HANDLE_EOF);
- return FALSE;
+}
Please use better argument and type names.
I just used the official names from the header. Wine's code style is not consistent on that, what is preferred - windows naming convention or wine naming convention?
Regarding error code, will it work if you set it to NOT_IMPLEMENTED?
@@ -488,7 +488,7 @@
# @ stub FindFirstFileTransactedW @ stdcall FindFirstFileW(wstr ptr) # @ stub FindFirstStreamTransactedW
-# @ stub FindFirstStreamW +@ stub FindFirstStreamW(str long ptr long)
@ stdcall FindFirstVolumeA(ptr long) @ stdcall FindFirstVolumeMountPointA(str ptr long)
Why 'stub'? Is it enough to have 'stub' entry for application to work? Also first argument type is wrong.
I implemented it with ERROR_HANDLE_EOF because that should be the return value when the function succeeds, but there is no stream. Interesting enough, it works when it's a stub only. The function is never actually called.
So is just a spec-stub preferred, or should I add a method stub setting NOT_IMPLEMENTED, or my implementation that just assumes there are no streams?
On a side note, why was there a commented out stub?
Regards, Fabian Maurer