wow64: Add thunks for the timer syscalls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d1171c7d10
commit
54901695dc
|
@ -29,6 +29,18 @@
|
|||
#include "wow64_private.h"
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtCancelTimer
|
||||
*/
|
||||
NTSTATUS WINAPI wow64_NtCancelTimer( UINT *args )
|
||||
{
|
||||
HANDLE handle = get_handle( &args );
|
||||
BOOLEAN *state = get_ptr( &args );
|
||||
|
||||
return NtCancelTimer( handle, state );
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtClearEvent
|
||||
*/
|
||||
|
@ -105,6 +117,27 @@ NTSTATUS WINAPI wow64_NtCreateSemaphore( UINT *args )
|
|||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtCreateTimer
|
||||
*/
|
||||
NTSTATUS WINAPI wow64_NtCreateTimer( UINT *args )
|
||||
{
|
||||
ULONG *handle_ptr = get_ptr( &args );
|
||||
ACCESS_MASK access = get_ulong( &args );
|
||||
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
|
||||
TIMER_TYPE type = get_ulong( &args );
|
||||
|
||||
struct object_attr64 attr;
|
||||
HANDLE handle = 0;
|
||||
NTSTATUS status;
|
||||
|
||||
*handle_ptr = 0;
|
||||
status = NtCreateTimer( &handle, access, objattr_32to64( &attr, attr32 ), type );
|
||||
put_handle( handle_ptr, handle );
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtOpenEvent
|
||||
*/
|
||||
|
@ -165,6 +198,26 @@ NTSTATUS WINAPI wow64_NtOpenSemaphore( UINT *args )
|
|||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtOpenTimer
|
||||
*/
|
||||
NTSTATUS WINAPI wow64_NtOpenTimer( 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 = NtOpenTimer( &handle, access, objattr_32to64( &attr, attr32 ));
|
||||
put_handle( handle_ptr, handle );
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtPulseEvent
|
||||
*/
|
||||
|
@ -222,6 +275,21 @@ NTSTATUS WINAPI wow64_NtQuerySemaphore( UINT *args )
|
|||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtQueryTimer
|
||||
*/
|
||||
NTSTATUS WINAPI wow64_NtQueryTimer( UINT *args )
|
||||
{
|
||||
HANDLE handle = get_handle( &args );
|
||||
TIMER_INFORMATION_CLASS class = get_ulong( &args );
|
||||
void *info = get_ptr( &args );
|
||||
ULONG len = get_ulong( &args );
|
||||
ULONG *retlen = get_ptr( &args );
|
||||
|
||||
return NtQueryTimer( handle, class, info, len, retlen );
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtReleaseMutant
|
||||
*/
|
||||
|
@ -269,3 +337,21 @@ NTSTATUS WINAPI wow64_NtSetEvent( UINT *args )
|
|||
|
||||
return NtSetEvent( handle, prev_state );
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* wow64_NtSetTimer
|
||||
*/
|
||||
NTSTATUS WINAPI wow64_NtSetTimer( UINT *args )
|
||||
{
|
||||
HANDLE handle = get_handle( &args );
|
||||
LARGE_INTEGER *when = get_ptr( &args );
|
||||
ULONG apc = get_ulong( &args );
|
||||
ULONG apc_param = get_ulong( &args );
|
||||
BOOLEAN resume = get_ulong( &args );
|
||||
ULONG period = get_ulong( &args );
|
||||
BOOLEAN *state = get_ptr( &args );
|
||||
|
||||
return NtSetTimer( handle, when, apc_32to64( apc ), apc_param_32to64( apc, apc_param ),
|
||||
resume, period, state );
|
||||
}
|
||||
|
|
|
@ -25,17 +25,20 @@
|
|||
SYSCALL_ENTRY( NtAddAtom ) \
|
||||
SYSCALL_ENTRY( NtAllocateLocallyUniqueId ) \
|
||||
SYSCALL_ENTRY( NtAllocateUuids ) \
|
||||
SYSCALL_ENTRY( NtCancelTimer ) \
|
||||
SYSCALL_ENTRY( NtClearEvent ) \
|
||||
SYSCALL_ENTRY( NtClose ) \
|
||||
SYSCALL_ENTRY( NtCreateEvent ) \
|
||||
SYSCALL_ENTRY( NtCreateMutant ) \
|
||||
SYSCALL_ENTRY( NtCreateSemaphore ) \
|
||||
SYSCALL_ENTRY( NtCreateTimer ) \
|
||||
SYSCALL_ENTRY( NtDeleteAtom ) \
|
||||
SYSCALL_ENTRY( NtFindAtom ) \
|
||||
SYSCALL_ENTRY( NtGetCurrentProcessorNumber ) \
|
||||
SYSCALL_ENTRY( NtOpenEvent ) \
|
||||
SYSCALL_ENTRY( NtOpenMutant ) \
|
||||
SYSCALL_ENTRY( NtOpenSemaphore ) \
|
||||
SYSCALL_ENTRY( NtOpenTimer ) \
|
||||
SYSCALL_ENTRY( NtPulseEvent ) \
|
||||
SYSCALL_ENTRY( NtQueryDefaultLocale ) \
|
||||
SYSCALL_ENTRY( NtQueryDefaultUILanguage ) \
|
||||
|
@ -44,11 +47,13 @@
|
|||
SYSCALL_ENTRY( NtQueryInstallUILanguage ) \
|
||||
SYSCALL_ENTRY( NtQueryMutant ) \
|
||||
SYSCALL_ENTRY( NtQuerySemaphore ) \
|
||||
SYSCALL_ENTRY( NtQueryTimer ) \
|
||||
SYSCALL_ENTRY( NtReleaseMutant ) \
|
||||
SYSCALL_ENTRY( NtReleaseSemaphore ) \
|
||||
SYSCALL_ENTRY( NtResetEvent ) \
|
||||
SYSCALL_ENTRY( NtSetDefaultLocale ) \
|
||||
SYSCALL_ENTRY( NtSetDefaultUILanguage ) \
|
||||
SYSCALL_ENTRY( NtSetEvent )
|
||||
SYSCALL_ENTRY( NtSetEvent ) \
|
||||
SYSCALL_ENTRY( NtSetTimer )
|
||||
|
||||
#endif /* __WOW64_SYSCALL_H */
|
||||
|
|
|
@ -63,6 +63,17 @@ static inline ULONG get_ulong( UINT **args ) { return *(*args)++; }
|
|||
static inline HANDLE get_handle( UINT **args ) { return LongToHandle( *(*args)++ ); }
|
||||
static inline void *get_ptr( UINT **args ) { return ULongToPtr( *(*args)++ ); }
|
||||
|
||||
static inline void *apc_32to64( ULONG func )
|
||||
{
|
||||
return func ? Wow64ApcRoutine : NULL;
|
||||
}
|
||||
|
||||
static inline void *apc_param_32to64( ULONG func, ULONG context )
|
||||
{
|
||||
if (!func) return ULongToPtr( context );
|
||||
return (void *)(ULONG_PTR)(((ULONG64)func << 32) | context);
|
||||
}
|
||||
|
||||
static inline UNICODE_STRING *unicode_str_32to64( UNICODE_STRING *str, const UNICODE_STRING32 *str32 )
|
||||
{
|
||||
if (!str32) return NULL;
|
||||
|
|
Loading…
Reference in New Issue