wow64: Add thunks for the write watch syscalls.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-07-27 11:24:33 +02:00
parent 458b859ddf
commit e57d500308
2 changed files with 47 additions and 0 deletions

View File

@ -64,6 +64,7 @@
SYSCALL_ENTRY( NtFreeVirtualMemory ) \ SYSCALL_ENTRY( NtFreeVirtualMemory ) \
SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \
SYSCALL_ENTRY( NtGetNlsSectionPtr ) \ SYSCALL_ENTRY( NtGetNlsSectionPtr ) \
SYSCALL_ENTRY( NtGetWriteWatch ) \
SYSCALL_ENTRY( NtListenPort ) \ SYSCALL_ENTRY( NtListenPort ) \
SYSCALL_ENTRY( NtLoadKey ) \ SYSCALL_ENTRY( NtLoadKey ) \
SYSCALL_ENTRY( NtLoadKey2 ) \ SYSCALL_ENTRY( NtLoadKey2 ) \
@ -113,6 +114,7 @@
SYSCALL_ENTRY( NtReplyWaitReceivePort ) \ SYSCALL_ENTRY( NtReplyWaitReceivePort ) \
SYSCALL_ENTRY( NtRequestWaitReplyPort ) \ SYSCALL_ENTRY( NtRequestWaitReplyPort ) \
SYSCALL_ENTRY( NtResetEvent ) \ SYSCALL_ENTRY( NtResetEvent ) \
SYSCALL_ENTRY( NtResetWriteWatch ) \
SYSCALL_ENTRY( NtRestoreKey ) \ SYSCALL_ENTRY( NtRestoreKey ) \
SYSCALL_ENTRY( NtSaveKey ) \ SYSCALL_ENTRY( NtSaveKey ) \
SYSCALL_ENTRY( NtSecureConnectPort ) \ SYSCALL_ENTRY( NtSecureConnectPort ) \

View File

@ -177,6 +177,38 @@ NTSTATUS WINAPI wow64_NtGetNlsSectionPtr( UINT *args )
} }
/**********************************************************************
* wow64_NtGetWriteWatch
*/
NTSTATUS WINAPI wow64_NtGetWriteWatch( UINT *args )
{
HANDLE handle = get_handle( &args );
ULONG flags = get_ulong( &args );
void *base = get_ptr( &args );
SIZE_T size = get_ulong( &args );
ULONG *addr_ptr = get_ptr( &args );
ULONG *count_ptr = get_ptr( &args );
ULONG *granularity = get_ptr( &args );
ULONG_PTR i, count = *count_ptr;
void **addresses;
NTSTATUS status;
if (!count || !size) return STATUS_INVALID_PARAMETER;
if (flags & ~WRITE_WATCH_FLAG_RESET) return STATUS_INVALID_PARAMETER;
if (!addr_ptr) return STATUS_ACCESS_VIOLATION;
addresses = RtlAllocateHeap( GetProcessHeap(), 0, count * sizeof(*addresses) );
if (!(status = NtGetWriteWatch( handle, flags, base, size, addresses, &count, granularity )))
{
for (i = 0; i < count; i++) addr_ptr[i] = PtrToUlong( addresses[i] );
*count_ptr = count;
}
RtlFreeHeap( GetProcessHeap(), 0, addresses );
return status;
}
/********************************************************************** /**********************************************************************
* wow64_NtLockVirtualMemory * wow64_NtLockVirtualMemory
*/ */
@ -279,6 +311,19 @@ NTSTATUS WINAPI wow64_NtReadVirtualMemory( UINT *args )
} }
/**********************************************************************
* wow64_NtResetWriteWatch
*/
NTSTATUS WINAPI wow64_NtResetWriteWatch( UINT *args )
{
HANDLE process = get_handle( &args );
void *base = get_ptr( &args );
SIZE_T size = get_ulong( &args );
return NtResetWriteWatch( process, base, size );
}
/********************************************************************** /**********************************************************************
* wow64_NtUnlockVirtualMemory * wow64_NtUnlockVirtualMemory
*/ */