From 2b0931182b49d31db9987080cdcea872ca5c817b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 23 Jul 2021 16:48:03 +0200 Subject: [PATCH] wow64: Add thunks for the mutant syscalls. Signed-off-by: Alexandre Julliard --- dlls/wow64/sync.c | 68 ++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 4 +++ 2 files changed, 72 insertions(+) diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index d61eed0a22d..2ca7764c3cd 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -62,6 +62,27 @@ NTSTATUS WINAPI wow64_NtCreateEvent( UINT *args ) } +/********************************************************************** + * wow64_NtCreateMutant + */ +NTSTATUS WINAPI wow64_NtCreateMutant( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + BOOLEAN owned = get_ulong( &args ); + + struct object_attr64 attr; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtCreateMutant( &handle, access, objattr_32to64( &attr, attr32 ), owned ); + put_handle( handle_ptr, handle ); + return status; +} + + /********************************************************************** * wow64_NtOpenEvent */ @@ -82,6 +103,26 @@ NTSTATUS WINAPI wow64_NtOpenEvent( UINT *args ) } +/********************************************************************** + * wow64_NtOpenMutant + */ +NTSTATUS WINAPI wow64_NtOpenMutant( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + + struct object_attr64 attr; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtOpenMutant( &handle, access, objattr_32to64( &attr, attr32 )); + put_handle( handle_ptr, handle ); + return status; +} + + /********************************************************************** * wow64_NtPulseEvent */ @@ -109,6 +150,33 @@ NTSTATUS WINAPI wow64_NtQueryEvent( UINT *args ) } +/********************************************************************** + * wow64_NtQueryMutant + */ +NTSTATUS WINAPI wow64_NtQueryMutant( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + MUTANT_INFORMATION_CLASS class = get_ulong( &args ); + void *info = get_ptr( &args ); + ULONG len = get_ulong( &args ); + ULONG *retlen = get_ptr( &args ); + + return NtQueryMutant( handle, class, info, len, retlen ); +} + + +/********************************************************************** + * wow64_NtReleaseMutant + */ +NTSTATUS WINAPI wow64_NtReleaseMutant( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + LONG *prev_count = get_ptr( &args ); + + return NtReleaseMutant( handle, prev_count ); +} + + /********************************************************************** * wow64_NtResetEvent */ diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index df9da2261bb..8481db2a587 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -28,16 +28,20 @@ SYSCALL_ENTRY( NtClearEvent ) \ SYSCALL_ENTRY( NtClose ) \ SYSCALL_ENTRY( NtCreateEvent ) \ + SYSCALL_ENTRY( NtCreateMutant ) \ SYSCALL_ENTRY( NtDeleteAtom ) \ SYSCALL_ENTRY( NtFindAtom ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ SYSCALL_ENTRY( NtOpenEvent ) \ + SYSCALL_ENTRY( NtOpenMutant ) \ SYSCALL_ENTRY( NtPulseEvent ) \ SYSCALL_ENTRY( NtQueryDefaultLocale ) \ SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \ SYSCALL_ENTRY( NtQueryEvent ) \ SYSCALL_ENTRY( NtQueryInformationAtom ) \ SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ + SYSCALL_ENTRY( NtQueryMutant ) \ + SYSCALL_ENTRY( NtReleaseMutant ) \ SYSCALL_ENTRY( NtResetEvent ) \ SYSCALL_ENTRY( NtSetDefaultLocale ) \ SYSCALL_ENTRY( NtSetDefaultUILanguage ) \