Module: wine Branch: master Commit: 1409b421d22e5c916e1fea7e9d04543eeebb8d8f URL: https://source.winehq.org/git/wine.git/?a=commit;h=1409b421d22e5c916e1fea7e9...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jul 23 17:47:39 2021 +0200
wow64: Add thunks for some general synchronization syscalls.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wow64/sync.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/wow64/syscall.h | 10 ++++- 2 files changed, 114 insertions(+), 1 deletion(-)
diff --git a/dlls/wow64/sync.c b/dlls/wow64/sync.c index 84fd2e8111a..c748668620a 100644 --- a/dlls/wow64/sync.c +++ b/dlls/wow64/sync.c @@ -282,6 +282,18 @@ NTSTATUS WINAPI wow64_NtDebugContinue( UINT *args ) }
+/********************************************************************** + * wow64_NtDelayExecution + */ +NTSTATUS WINAPI wow64_NtDelayExecution( UINT *args ) +{ + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtDelayExecution( alertable, timeout ); +} + + /********************************************************************** * wow64_NtOpenDirectoryObject */ @@ -556,6 +568,18 @@ NTSTATUS WINAPI wow64_NtQueryMutant( UINT *args ) }
+/********************************************************************** + * wow64_NtQueryPerformanceCounter + */ +NTSTATUS WINAPI wow64_NtQueryPerformanceCounter( UINT *args ) +{ + LARGE_INTEGER *counter = get_ptr( &args ); + LARGE_INTEGER *frequency = get_ptr( &args ); + + return NtQueryPerformanceCounter( counter, frequency ); +} + + /********************************************************************** * wow64_NtQuerySemaphore */ @@ -604,6 +628,19 @@ NTSTATUS WINAPI wow64_NtQueryTimer( UINT *args ) }
+/********************************************************************** + * wow64_NtQueryTimerResolution + */ +NTSTATUS WINAPI wow64_NtQueryTimerResolution( UINT *args ) +{ + ULONG *min_res = get_ptr( &args ); + ULONG *max_res = get_ptr( &args ); + ULONG *current_res = get_ptr( &args ); + + return NtQueryTimerResolution( min_res, max_res, current_res ); +} + + /********************************************************************** * wow64_NtReleaseKeyedEvent */ @@ -715,6 +752,33 @@ NTSTATUS WINAPI wow64_NtSetTimer( UINT *args ) }
+/********************************************************************** + * wow64_NtSetTimerResolution + */ +NTSTATUS WINAPI wow64_NtSetTimerResolution( UINT *args ) +{ + ULONG res = get_ulong( &args ); + BOOLEAN set = get_ulong( &args ); + ULONG *current_res = get_ptr( &args ); + + return NtSetTimerResolution( res, set, current_res ); +} + + +/********************************************************************** + * wow64_NtSignalAndWaitForSingleObject + */ +NTSTATUS WINAPI wow64_NtSignalAndWaitForSingleObject( UINT *args ) +{ + HANDLE signal = get_handle( &args ); + HANDLE wait = get_handle( &args ); + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtSignalAndWaitForSingleObject( signal, wait, alertable, timeout ); +} + + /********************************************************************** * wow64_NtTerminateJobObject */ @@ -813,3 +877,44 @@ NTSTATUS WINAPI wow64_NtWaitForKeyedEvent( UINT *args )
return NtWaitForKeyedEvent( handle, key, alertable, timeout ); } + + +/********************************************************************** + * wow64_NtWaitForMultipleObjects + */ +NTSTATUS WINAPI wow64_NtWaitForMultipleObjects( UINT *args ) +{ + DWORD count = get_ulong( &args ); + LONG *handles_ptr = get_ptr( &args ); + BOOLEAN wait_any = get_ulong( &args ); + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + HANDLE handles[MAXIMUM_WAIT_OBJECTS]; + DWORD i; + + for (i = 0; i < count && i < MAXIMUM_WAIT_OBJECTS; i++) handles[i] = LongToHandle( handles_ptr[i] ); + return NtWaitForMultipleObjects( count, handles, wait_any, alertable, timeout ); +} + + +/********************************************************************** + * wow64_NtWaitForSingleObject + */ +NTSTATUS WINAPI wow64_NtWaitForSingleObject( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + BOOLEAN alertable = get_ulong( &args ); + const LARGE_INTEGER *timeout = get_ptr( &args ); + + return NtWaitForSingleObject( handle, alertable, timeout ); +} + + +/********************************************************************** + * wow64_NtYieldExecution + */ +NTSTATUS WINAPI wow64_NtYieldExecution( UINT *args ) +{ + return NtYieldExecution(); +} diff --git a/dlls/wow64/syscall.h b/dlls/wow64/syscall.h index 60631a2d41c..91552953088 100644 --- a/dlls/wow64/syscall.h +++ b/dlls/wow64/syscall.h @@ -39,6 +39,7 @@ SYSCALL_ENTRY( NtCreateSymbolicLinkObject ) \ SYSCALL_ENTRY( NtCreateTimer ) \ SYSCALL_ENTRY( NtDebugContinue ) \ + SYSCALL_ENTRY( NtDelayExecution ) \ SYSCALL_ENTRY( NtDeleteAtom ) \ SYSCALL_ENTRY( NtFindAtom ) \ SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \ @@ -60,9 +61,11 @@ SYSCALL_ENTRY( NtQueryInstallUILanguage ) \ SYSCALL_ENTRY( NtQueryIoCompletion ) \ SYSCALL_ENTRY( NtQueryMutant ) \ + SYSCALL_ENTRY( NtQueryPerformanceCounter ) \ SYSCALL_ENTRY( NtQuerySemaphore ) \ SYSCALL_ENTRY( NtQuerySymbolicLinkObject ) \ SYSCALL_ENTRY( NtQueryTimer ) \ + SYSCALL_ENTRY( NtQueryTimerResolution ) \ SYSCALL_ENTRY( NtReleaseKeyedEvent ) \ SYSCALL_ENTRY( NtReleaseMutant ) \ SYSCALL_ENTRY( NtReleaseSemaphore ) \ @@ -73,8 +76,13 @@ SYSCALL_ENTRY( NtSetInformationDebugObject ) \ SYSCALL_ENTRY( NtSetIoCompletion ) \ SYSCALL_ENTRY( NtSetTimer ) \ + SYSCALL_ENTRY( NtSetTimerResolution ) \ + SYSCALL_ENTRY( NtSignalAndWaitForSingleObject ) \ SYSCALL_ENTRY( NtTerminateJobObject ) \ SYSCALL_ENTRY( NtWaitForDebugEvent ) \ - SYSCALL_ENTRY( NtWaitForKeyedEvent ) + SYSCALL_ENTRY( NtWaitForKeyedEvent ) \ + SYSCALL_ENTRY( NtWaitForMultipleObjects ) \ + SYSCALL_ENTRY( NtWaitForSingleObject ) \ + SYSCALL_ENTRY( NtYieldExecution )
#endif /* __WOW64_SYSCALL_H */