Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ntdll/ntdll.spec | 2 ++ dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/virtual.c | 9 +++++++++ dlls/wow64/syscall.h | 1 + dlls/wow64/virtual.c | 13 +++++++++++++ include/winternl.h | 1 + 6 files changed, 27 insertions(+)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index a7a39a0bce2..b1650ab4306 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -427,6 +427,7 @@ @ stdcall -syscall NtUnlockFile(long ptr ptr ptr ptr) @ stdcall -syscall NtUnlockVirtualMemory(long ptr ptr long) @ stdcall -syscall NtUnmapViewOfSection(long ptr) +@ stdcall -syscall NtUnmapViewOfSectionEx(long ptr long) # @ stub NtVdmControl # @ stub NtW32Call @ stdcall -syscall NtWaitForAlertByThreadId(ptr ptr) @@ -1454,6 +1455,7 @@ @ stdcall -private -syscall ZwUnlockFile(long ptr ptr ptr ptr) NtUnlockFile @ stdcall -private -syscall ZwUnlockVirtualMemory(long ptr ptr long) NtUnlockVirtualMemory @ stdcall -private -syscall ZwUnmapViewOfSection(long ptr) NtUnmapViewOfSection +@ stdcall -private -syscall ZwUnmapViewOfSectionEx(long ptr long) NtUnmapViewOfSectionEx # @ stub ZwVdmControl # @ stub ZwW32Call @ stdcall -private -syscall ZwWaitForAlertByThreadId(ptr ptr) NtWaitForAlertByThreadId diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index cad760a1445..7f85582adf3 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -336,6 +336,7 @@ static void * const syscalls[] = NtUnlockFile, NtUnlockVirtualMemory, NtUnmapViewOfSection, + NtUnmapViewOfSectionEx, NtWaitForAlertByThreadId, NtWaitForDebugEvent, NtWaitForKeyedEvent, diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 02478cceb06..6ecca9cb98a 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -4610,6 +4610,15 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr ) return status; }
+/*********************************************************************** + * NtUnmapViewOfSectionEx (NTDLL.@) + * ZwUnmapViewOfSectionEx (NTDLL.@) + */ +NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags ) +{ + if (flags) FIXME("Ignoring flags %#x.\n", flags); + return NtUnmapViewOfSection( process, addr ); +}
/****************************************************************************** * virtual_fill_image_information diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 3b364d909d7..bd107ce0ef5 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -237,6 +237,7 @@ SYSCALL_ENTRY( NtUnlockFile ) \ SYSCALL_ENTRY( NtUnlockVirtualMemory ) \ SYSCALL_ENTRY( NtUnmapViewOfSection ) \ + SYSCALL_ENTRY( NtUnmapViewOfSectionEx ) \ SYSCALL_ENTRY( NtWaitForAlertByThreadId ) \ SYSCALL_ENTRY( NtWaitForDebugEvent ) \ SYSCALL_ENTRY( NtWaitForKeyedEvent ) \ diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 61c84e5d7be..c21464857fa 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -525,6 +525,19 @@ NTSTATUS WINAPI wow64_NtUnmapViewOfSection( UINT *args ) }
+/********************************************************************** + * wow64_NtUnmapViewOfSectionEx + */ +NTSTATUS WINAPI wow64_NtUnmapViewOfSectionEx( UINT *args ) +{ + HANDLE process = get_handle( &args ); + void *addr = get_ptr( &args ); + ULONG flags = get_ulong( &args ); + + return NtUnmapViewOfSectionEx( process, addr, flags ); +} + + /********************************************************************** * wow64_NtWow64AllocateVirtualMemory64 */ diff --git a/include/winternl.h b/include/winternl.h index 1d358fc0b2d..84babcbb0e9 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4160,6 +4160,7 @@ NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE); NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG); NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID); +NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSectionEx(HANDLE,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID); NTSYSAPI NTSTATUS WINAPI NtWaitForAlertByThreadId(const void*,const LARGE_INTEGER*); NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/kernelbase/kernelbase.spec | 1 + dlls/kernelbase/memory.c | 9 +++++++++ include/winbase.h | 1 + 3 files changed, 11 insertions(+)
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 7095927c61e..854797ddeb0 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1653,6 +1653,7 @@ @ stdcall UnlockFile(long long long long long) @ stdcall UnlockFileEx(long long long long ptr) @ stdcall UnmapViewOfFile(ptr) +@ stdcall UnmapViewOfFile2(long ptr long) # @ stub UnmapViewOfFileEx # @ stub UnregisterBadMemoryNotification # @ stub UnregisterGPNotificationInternal diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 49bf71e0aa2..87c07887482 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -303,6 +303,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH UnmapViewOfFile( const void *addr ) }
+/*********************************************************************** + * UnmapViewOfFile2 (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH UnmapViewOfFile2( HANDLE process, void *addr, ULONG flags ) +{ + return set_ntstatus( NtUnmapViewOfSectionEx( process, addr, flags )); +} + + /*********************************************************************** * VirtualAlloc (kernelbase.@) */ diff --git a/include/winbase.h b/include/winbase.h index 55be6dbf62b..2b109af19df 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2741,6 +2741,7 @@ WINBASEAPI BOOL WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED #define UnlockResource(handle) ((handle), 0) #define UnlockSegment(handle) GlobalUnfix((HANDLE)(handle)) WINBASEAPI BOOL WINAPI UnmapViewOfFile(LPCVOID); +WINBASEAPI BOOL WINAPI UnmapViewOfFile2(HANDLE,PVOID,ULONG); WINBASEAPI BOOL WINAPI UmsThreadYield(void *); WINBASEAPI HRESULT WINAPI UnregisterApplicationRestart(void); WINBASEAPI BOOL WINAPI UnregisterWait(HANDLE);