From fb5eae4a70bca9f37afbe0e15b61ddf3e56fc815 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 23 Jul 2021 17:04:11 +0200 Subject: [PATCH] wow64: Add thunks for the keyed event syscalls. Signed-off-by: Alexandre Julliard --- dlls/wow64/sync.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 6 +++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index c6c5e1d374d..596e90bc71d 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -74,6 +74,27 @@ NTSTATUS WINAPI wow64_NtCreateEvent( UINT *args ) } +/********************************************************************** + * wow64_NtCreateKeyedEvent + */ +NTSTATUS WINAPI wow64_NtCreateKeyedEvent( UINT *args ) +{ + ULONG *handle_ptr = get_ptr( &args ); + ACCESS_MASK access = get_ulong( &args ); + OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args ); + ULONG flags = get_ulong( &args ); + + struct object_attr64 attr; + HANDLE handle = 0; + NTSTATUS status; + + *handle_ptr = 0; + status = NtCreateKeyedEvent( &handle, access, objattr_32to64( &attr, attr32 ), flags ); + put_handle( handle_ptr, handle ); + return status; +} + + /********************************************************************** * wow64_NtCreateMutant */ @@ -158,6 +179,26 @@ NTSTATUS WINAPI wow64_NtOpenEvent( UINT *args ) } +/********************************************************************** + * wow64_NtOpenKeyedEvent + */ +NTSTATUS WINAPI wow64_NtOpenKeyedEvent( 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 = NtOpenKeyedEvent( &handle, access, objattr_32to64( &attr, attr32 )); + put_handle( handle_ptr, handle ); + return status; +} + + /********************************************************************** * wow64_NtOpenMutant */ @@ -290,6 +331,20 @@ NTSTATUS WINAPI wow64_NtQueryTimer( UINT *args ) } +/********************************************************************** + * wow64_NtReleaseKeyedEvent + */ +NTSTATUS WINAPI wow64_NtReleaseKeyedEvent( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + void *key = get_ptr( &args ); + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtReleaseKeyedEvent( handle, key, alertable, timeout ); +} + + /********************************************************************** * wow64_NtReleaseMutant */ @@ -355,3 +410,17 @@ NTSTATUS WINAPI wow64_NtSetTimer( UINT *args ) return NtSetTimer( handle, when, apc_32to64( apc ), apc_param_32to64( apc, apc_param ), resume, period, state ); } + + +/********************************************************************** + * wow64_NtWaitForKeyedEvent + */ +NTSTATUS WINAPI wow64_NtWaitForKeyedEvent( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + const void *key = get_ptr( &args ); + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtWaitForKeyedEvent( handle, key, alertable, timeout ); +} diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index f348ecfe1d9..db2b386fe24 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -29,6 +29,7 @@ SYSCALL_ENTRY( NtClearEvent ) \ SYSCALL_ENTRY( NtClose ) \ SYSCALL_ENTRY( NtCreateEvent ) \ + SYSCALL_ENTRY( NtCreateKeyedEvent ) \ SYSCALL_ENTRY( NtCreateMutant ) \ SYSCALL_ENTRY( NtCreateSemaphore ) \ SYSCALL_ENTRY( NtCreateTimer ) \ @@ -36,6 +37,7 @@ SYSCALL_ENTRY( NtFindAtom ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ SYSCALL_ENTRY( NtOpenEvent ) \ + SYSCALL_ENTRY( NtOpenKeyedEvent ) \ SYSCALL_ENTRY( NtOpenMutant ) \ SYSCALL_ENTRY( NtOpenSemaphore ) \ SYSCALL_ENTRY( NtOpenTimer ) \ @@ -48,12 +50,14 @@ SYSCALL_ENTRY( NtQueryMutant ) \ SYSCALL_ENTRY( NtQuerySemaphore ) \ SYSCALL_ENTRY( NtQueryTimer ) \ + SYSCALL_ENTRY( NtReleaseKeyedEvent ) \ SYSCALL_ENTRY( NtReleaseMutant ) \ SYSCALL_ENTRY( NtReleaseSemaphore ) \ SYSCALL_ENTRY( NtResetEvent ) \ SYSCALL_ENTRY( NtSetDefaultLocale ) \ SYSCALL_ENTRY( NtSetDefaultUILanguage ) \ SYSCALL_ENTRY( NtSetEvent ) \ - SYSCALL_ENTRY( NtSetTimer ) + SYSCALL_ENTRY( NtSetTimer ) \ + SYSCALL_ENTRY( NtWaitForKeyedEvent ) #endif /* __WOW64_SYSCALL_H */