ntdll: Use syscall thunks for timer functions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-16 10:29:25 +02:00
parent 66e6d87ab8
commit aa08e15415
4 changed files with 11 additions and 74 deletions

View File

@ -147,7 +147,7 @@
# @ stub NtCancelDeviceWakeupRequest # @ stub NtCancelDeviceWakeupRequest
@ stdcall NtCancelIoFile(long ptr) @ stdcall NtCancelIoFile(long ptr)
@ stdcall NtCancelIoFileEx(long ptr ptr) @ stdcall NtCancelIoFileEx(long ptr ptr)
@ stdcall NtCancelTimer(long ptr) @ stdcall -syscall NtCancelTimer(long ptr)
@ stdcall -syscall NtClearEvent(long) @ stdcall -syscall NtClearEvent(long)
@ stdcall NtClearPowerRequest(long long) @ stdcall NtClearPowerRequest(long long)
@ stdcall NtClose(long) @ stdcall NtClose(long)
@ -184,7 +184,7 @@
@ stdcall NtCreateSymbolicLinkObject(ptr long ptr ptr) @ stdcall NtCreateSymbolicLinkObject(ptr long ptr ptr)
@ stub NtCreateThread @ stub NtCreateThread
@ stdcall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr) @ stdcall NtCreateThreadEx(ptr long ptr long ptr ptr long long long long ptr)
@ stdcall NtCreateTimer(ptr long ptr long) @ stdcall -syscall NtCreateTimer(ptr long ptr long)
@ stub NtCreateToken @ stub NtCreateToken
@ stdcall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr) @ stdcall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr)
# @ stub NtCreateWaitablePort # @ stub NtCreateWaitablePort
@ -272,7 +272,7 @@
@ stdcall NtOpenThread(ptr long ptr ptr) @ stdcall NtOpenThread(ptr long ptr ptr)
@ stdcall NtOpenThreadToken(long long long ptr) @ stdcall NtOpenThreadToken(long long long ptr)
@ stdcall NtOpenThreadTokenEx(long long long long ptr) @ stdcall NtOpenThreadTokenEx(long long long long ptr)
@ stdcall NtOpenTimer(ptr long ptr) @ stdcall -syscall NtOpenTimer(ptr long ptr)
@ stub NtPlugPlayControl @ stub NtPlugPlayControl
@ stdcall NtPowerInformation(long ptr long ptr long) @ stdcall NtPowerInformation(long ptr long ptr long)
@ stdcall NtPrivilegeCheck(ptr ptr ptr) @ stdcall NtPrivilegeCheck(ptr ptr ptr)
@ -319,7 +319,7 @@
@ stdcall NtQuerySystemInformation(long ptr long ptr) @ stdcall NtQuerySystemInformation(long ptr long ptr)
@ stdcall NtQuerySystemInformationEx(long ptr long ptr long ptr) @ stdcall NtQuerySystemInformationEx(long ptr long ptr long ptr)
@ stdcall NtQuerySystemTime(ptr) @ stdcall NtQuerySystemTime(ptr)
@ stdcall NtQueryTimer(ptr long ptr long ptr) @ stdcall -syscall NtQueryTimer(ptr long ptr long ptr)
@ stdcall NtQueryTimerResolution(ptr ptr ptr) @ stdcall NtQueryTimerResolution(ptr ptr ptr)
@ stdcall NtQueryValueKey(long ptr long ptr long ptr) @ stdcall NtQueryValueKey(long ptr long ptr long ptr)
@ stdcall NtQueryVirtualMemory(long ptr long ptr long ptr) @ stdcall NtQueryVirtualMemory(long ptr long ptr long ptr)
@ -395,7 +395,7 @@
@ stub NtSetSystemPowerState @ stub NtSetSystemPowerState
@ stdcall NtSetSystemTime(ptr ptr) @ stdcall NtSetSystemTime(ptr ptr)
@ stdcall NtSetThreadExecutionState(long ptr) @ stdcall NtSetThreadExecutionState(long ptr)
@ stdcall NtSetTimer(long ptr ptr ptr long long ptr) @ stdcall -syscall NtSetTimer(long ptr ptr ptr long long ptr)
@ stdcall NtSetTimerResolution(long long ptr) @ stdcall NtSetTimerResolution(long long ptr)
# @ stub NtSetUuidSeed # @ stub NtSetUuidSeed
@ stdcall NtSetValueKey(long ptr long long ptr long) @ stdcall NtSetValueKey(long ptr long long ptr long)
@ -1136,7 +1136,7 @@
# @ stub ZwCancelDeviceWakeupRequest # @ stub ZwCancelDeviceWakeupRequest
@ stdcall -private ZwCancelIoFile(long ptr) NtCancelIoFile @ stdcall -private ZwCancelIoFile(long ptr) NtCancelIoFile
@ stdcall -private ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx @ stdcall -private ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx
@ stdcall -private ZwCancelTimer(long ptr) NtCancelTimer @ stdcall -private -syscall ZwCancelTimer(long ptr) NtCancelTimer
@ stdcall -private -syscall ZwClearEvent(long) NtClearEvent @ stdcall -private -syscall ZwClearEvent(long) NtClearEvent
@ stdcall -private ZwClearPowerRequest(long long) NtClearPowerRequest @ stdcall -private ZwClearPowerRequest(long long) NtClearPowerRequest
@ stdcall -private ZwClose(long) NtClose @ stdcall -private ZwClose(long) NtClose
@ -1171,7 +1171,7 @@
@ stdcall -private -syscall ZwCreateSemaphore(ptr long ptr long long) NtCreateSemaphore @ stdcall -private -syscall ZwCreateSemaphore(ptr long ptr long long) NtCreateSemaphore
@ stdcall -private ZwCreateSymbolicLinkObject(ptr long ptr ptr) NtCreateSymbolicLinkObject @ stdcall -private ZwCreateSymbolicLinkObject(ptr long ptr ptr) NtCreateSymbolicLinkObject
@ stub ZwCreateThread @ stub ZwCreateThread
@ stdcall -private ZwCreateTimer(ptr long ptr long) NtCreateTimer @ stdcall -private -syscall ZwCreateTimer(ptr long ptr long) NtCreateTimer
@ stub ZwCreateToken @ stub ZwCreateToken
# @ stub ZwCreateWaitablePort # @ stub ZwCreateWaitablePort
# @ stub ZwDebugActiveProcess # @ stub ZwDebugActiveProcess
@ -1256,7 +1256,7 @@
@ stdcall -private ZwOpenThread(ptr long ptr ptr) NtOpenThread @ stdcall -private ZwOpenThread(ptr long ptr ptr) NtOpenThread
@ stdcall -private ZwOpenThreadToken(long long long ptr) NtOpenThreadToken @ stdcall -private ZwOpenThreadToken(long long long ptr) NtOpenThreadToken
@ stdcall -private ZwOpenThreadTokenEx(long long long long ptr) NtOpenThreadTokenEx @ stdcall -private ZwOpenThreadTokenEx(long long long long ptr) NtOpenThreadTokenEx
@ stdcall -private ZwOpenTimer(ptr long ptr) NtOpenTimer @ stdcall -private -syscall ZwOpenTimer(ptr long ptr) NtOpenTimer
@ stub ZwPlugPlayControl @ stub ZwPlugPlayControl
@ stdcall -private ZwPowerInformation(long ptr long ptr long) NtPowerInformation @ stdcall -private ZwPowerInformation(long ptr long ptr long) NtPowerInformation
@ stdcall -private ZwPrivilegeCheck(ptr ptr ptr) NtPrivilegeCheck @ stdcall -private ZwPrivilegeCheck(ptr ptr ptr) NtPrivilegeCheck
@ -1303,7 +1303,7 @@
@ stdcall -private ZwQuerySystemInformation(long ptr long ptr) NtQuerySystemInformation @ stdcall -private ZwQuerySystemInformation(long ptr long ptr) NtQuerySystemInformation
@ stdcall -private ZwQuerySystemInformationEx(long ptr long ptr long ptr) NtQuerySystemInformationEx @ stdcall -private ZwQuerySystemInformationEx(long ptr long ptr long ptr) NtQuerySystemInformationEx
@ stdcall -private ZwQuerySystemTime(ptr) NtQuerySystemTime @ stdcall -private ZwQuerySystemTime(ptr) NtQuerySystemTime
@ stdcall -private ZwQueryTimer(ptr long ptr long ptr) NtQueryTimer @ stdcall -private -syscall ZwQueryTimer(ptr long ptr long ptr) NtQueryTimer
@ stdcall -private ZwQueryTimerResolution(ptr ptr ptr) NtQueryTimerResolution @ stdcall -private ZwQueryTimerResolution(ptr ptr ptr) NtQueryTimerResolution
@ stdcall -private ZwQueryValueKey(long ptr long ptr long ptr) NtQueryValueKey @ stdcall -private ZwQueryValueKey(long ptr long ptr long ptr) NtQueryValueKey
@ stdcall -private ZwQueryVirtualMemory(long ptr long ptr long ptr) NtQueryVirtualMemory @ stdcall -private ZwQueryVirtualMemory(long ptr long ptr long ptr) NtQueryVirtualMemory
@ -1379,7 +1379,7 @@
@ stub ZwSetSystemPowerState @ stub ZwSetSystemPowerState
@ stdcall -private ZwSetSystemTime(ptr ptr) NtSetSystemTime @ stdcall -private ZwSetSystemTime(ptr ptr) NtSetSystemTime
@ stdcall ZwSetThreadExecutionState(long ptr) NtSetThreadExecutionState @ stdcall ZwSetThreadExecutionState(long ptr) NtSetThreadExecutionState
@ stdcall -private ZwSetTimer(long ptr ptr ptr long long ptr) NtSetTimer @ stdcall -private -syscall ZwSetTimer(long ptr ptr ptr long long ptr) NtSetTimer
@ stdcall -private ZwSetTimerResolution(long long ptr) NtSetTimerResolution @ stdcall -private ZwSetTimerResolution(long long ptr) NtSetTimerResolution
# @ stub ZwSetUuidSeed # @ stub ZwSetUuidSeed
@ stdcall -private ZwSetValueKey(long ptr long long ptr long) NtSetValueKey @ stdcall -private ZwSetValueKey(long ptr long long ptr long) NtSetValueKey

View File

@ -139,54 +139,6 @@ NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr )
* Timers * Timers
*/ */
/**************************************************************************
* NtCreateTimer [NTDLL.@]
* ZwCreateTimer [NTDLL.@]
*/
NTSTATUS WINAPI NtCreateTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr,
TIMER_TYPE type )
{
return unix_funcs->NtCreateTimer( handle, access, attr, type );
}
/**************************************************************************
* NtOpenTimer [NTDLL.@]
* ZwOpenTimer [NTDLL.@]
*/
NTSTATUS WINAPI NtOpenTimer( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
{
return unix_funcs->NtOpenTimer( handle, access, attr );
}
/**************************************************************************
* NtSetTimer [NTDLL.@]
* ZwSetTimer [NTDLL.@]
*/
NTSTATUS WINAPI NtSetTimer( HANDLE handle, const LARGE_INTEGER *when, PTIMER_APC_ROUTINE callback,
void *arg, BOOLEAN resume, ULONG period, BOOLEAN *state )
{
return unix_funcs->NtSetTimer( handle, when, callback, arg, resume, period, state );
}
/**************************************************************************
* NtCancelTimer [NTDLL.@]
* ZwCancelTimer [NTDLL.@]
*/
NTSTATUS WINAPI NtCancelTimer( HANDLE handle, BOOLEAN *state )
{
return unix_funcs->NtCancelTimer( handle, state );
}
/******************************************************************************
* NtQueryTimer (NTDLL.@)
*/
NTSTATUS WINAPI NtQueryTimer( HANDLE handle, TIMER_INFORMATION_CLASS class,
void *info, ULONG len, ULONG *ret_len )
{
return unix_funcs->NtQueryTimer( handle, class, info, len, ret_len );
}
/****************************************************************************** /******************************************************************************
* NtQueryTimerResolution [NTDLL.@] * NtQueryTimerResolution [NTDLL.@]
*/ */

View File

@ -1362,7 +1362,6 @@ static struct unix_funcs unix_funcs =
NtAlertThread, NtAlertThread,
NtAllocateVirtualMemory, NtAllocateVirtualMemory,
NtAreMappedFilesTheSame, NtAreMappedFilesTheSame,
NtCancelTimer,
NtClose, NtClose,
NtContinue, NtContinue,
NtCreateIoCompletion, NtCreateIoCompletion,
@ -1371,7 +1370,6 @@ static struct unix_funcs unix_funcs =
NtCreateNamedPipeFile, NtCreateNamedPipeFile,
NtCreateSection, NtCreateSection,
NtCreateThreadEx, NtCreateThreadEx,
NtCreateTimer,
NtCreateUserProcess, NtCreateUserProcess,
NtCurrentTeb, NtCurrentTeb,
NtDelayExecution, NtDelayExecution,
@ -1395,7 +1393,6 @@ static struct unix_funcs unix_funcs =
NtOpenProcess, NtOpenProcess,
NtOpenSection, NtOpenSection,
NtOpenThread, NtOpenThread,
NtOpenTimer,
NtPowerInformation, NtPowerInformation,
NtProtectVirtualMemory, NtProtectVirtualMemory,
NtQueryAttributesFile, NtQueryAttributesFile,
@ -1411,7 +1408,6 @@ static struct unix_funcs unix_funcs =
NtQuerySystemInformation, NtQuerySystemInformation,
NtQuerySystemInformationEx, NtQuerySystemInformationEx,
NtQuerySystemTime, NtQuerySystemTime,
NtQueryTimer,
NtQueryVirtualMemory, NtQueryVirtualMemory,
NtQueryVolumeInformationFile, NtQueryVolumeInformationFile,
NtQueueApcThread, NtQueueApcThread,
@ -1433,7 +1429,6 @@ static struct unix_funcs unix_funcs =
NtSetIoCompletion, NtSetIoCompletion,
NtSetLdtEntries, NtSetLdtEntries,
NtSetSystemTime, NtSetSystemTime,
NtSetTimer,
NtSetVolumeInformationFile, NtSetVolumeInformationFile,
NtSignalAndWaitForSingleObject, NtSignalAndWaitForSingleObject,
NtSuspendProcess, NtSuspendProcess,

View File

@ -28,7 +28,7 @@ struct msghdr;
struct _DISPATCHER_CONTEXT; struct _DISPATCHER_CONTEXT;
/* increment this when you change the function table */ /* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 78 #define NTDLL_UNIXLIB_VERSION 79
struct unix_funcs struct unix_funcs
{ {
@ -38,7 +38,6 @@ struct unix_funcs
NTSTATUS (WINAPI *NtAllocateVirtualMemory)( HANDLE process, PVOID *ret, ULONG_PTR zero_bits, NTSTATUS (WINAPI *NtAllocateVirtualMemory)( HANDLE process, PVOID *ret, ULONG_PTR zero_bits,
SIZE_T *size_ptr, ULONG type, ULONG protect ); SIZE_T *size_ptr, ULONG type, ULONG protect );
NTSTATUS (WINAPI *NtAreMappedFilesTheSame)(PVOID addr1, PVOID addr2); NTSTATUS (WINAPI *NtAreMappedFilesTheSame)(PVOID addr1, PVOID addr2);
NTSTATUS (WINAPI *NtCancelTimer)( HANDLE handle, BOOLEAN *state );
NTSTATUS (WINAPI *NtClose)( HANDLE handle ); NTSTATUS (WINAPI *NtClose)( HANDLE handle );
NTSTATUS (WINAPI *NtContinue)( CONTEXT *context, BOOLEAN alertable ); NTSTATUS (WINAPI *NtContinue)( CONTEXT *context, BOOLEAN alertable );
NTSTATUS (WINAPI *NtCreateIoCompletion)( HANDLE *handle, ACCESS_MASK access, NTSTATUS (WINAPI *NtCreateIoCompletion)( HANDLE *handle, ACCESS_MASK access,
@ -61,8 +60,6 @@ struct unix_funcs
HANDLE process, PRTL_THREAD_START_ROUTINE start, void *param, HANDLE process, PRTL_THREAD_START_ROUTINE start, void *param,
ULONG flags, SIZE_T zero_bits, SIZE_T stack_commit, ULONG flags, SIZE_T zero_bits, SIZE_T stack_commit,
SIZE_T stack_reserve, PS_ATTRIBUTE_LIST *attr_list ); SIZE_T stack_reserve, PS_ATTRIBUTE_LIST *attr_list );
NTSTATUS (WINAPI *NtCreateTimer)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr, TIMER_TYPE type );
NTSTATUS (WINAPI *NtCreateUserProcess)( HANDLE *process_handle_ptr, HANDLE *thread_handle_ptr, NTSTATUS (WINAPI *NtCreateUserProcess)( HANDLE *process_handle_ptr, HANDLE *thread_handle_ptr,
ACCESS_MASK process_access, ACCESS_MASK thread_access, ACCESS_MASK process_access, ACCESS_MASK thread_access,
OBJECT_ATTRIBUTES *process_attr, OBJECT_ATTRIBUTES *thread_attr, OBJECT_ATTRIBUTES *process_attr, OBJECT_ATTRIBUTES *thread_attr,
@ -112,8 +109,6 @@ struct unix_funcs
NTSTATUS (WINAPI *NtOpenSection)( HANDLE *handle, ACCESS_MASK access, NTSTATUS (WINAPI *NtOpenSection)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr ); const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtOpenThread)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, const CLIENT_ID *id ); NTSTATUS (WINAPI *NtOpenThread)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, const CLIENT_ID *id );
NTSTATUS (WINAPI *NtOpenTimer)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtPowerInformation)( POWER_INFORMATION_LEVEL level, void *input, ULONG in_size, NTSTATUS (WINAPI *NtPowerInformation)( POWER_INFORMATION_LEVEL level, void *input, ULONG in_size,
void *output, ULONG out_size ); void *output, ULONG out_size );
NTSTATUS (WINAPI *NtProtectVirtualMemory)( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr, NTSTATUS (WINAPI *NtProtectVirtualMemory)( HANDLE process, PVOID *addr_ptr, SIZE_T *size_ptr,
@ -146,8 +141,6 @@ struct unix_funcs
void *query, ULONG query_len, void *query, ULONG query_len,
void *info, ULONG size, ULONG *ret_size ); void *info, ULONG size, ULONG *ret_size );
NTSTATUS (WINAPI *NtQuerySystemTime)( LARGE_INTEGER *time ); NTSTATUS (WINAPI *NtQuerySystemTime)( LARGE_INTEGER *time );
NTSTATUS (WINAPI *NtQueryTimer)( HANDLE handle, TIMER_INFORMATION_CLASS class,
void *info, ULONG len, ULONG *ret_len );
NTSTATUS (WINAPI *NtQueryVirtualMemory)( HANDLE process, LPCVOID addr, NTSTATUS (WINAPI *NtQueryVirtualMemory)( HANDLE process, LPCVOID addr,
MEMORY_INFORMATION_CLASS info_class, MEMORY_INFORMATION_CLASS info_class,
PVOID buffer, SIZE_T len, SIZE_T *res_len ); PVOID buffer, SIZE_T len, SIZE_T *res_len );
@ -189,9 +182,6 @@ struct unix_funcs
NTSTATUS status, SIZE_T count ); NTSTATUS status, SIZE_T count );
NTSTATUS (WINAPI *NtSetLdtEntries)( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_ENTRY entry2 ); NTSTATUS (WINAPI *NtSetLdtEntries)( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_ENTRY entry2 );
NTSTATUS (WINAPI *NtSetSystemTime)( const LARGE_INTEGER *new, LARGE_INTEGER *old ); NTSTATUS (WINAPI *NtSetSystemTime)( const LARGE_INTEGER *new, LARGE_INTEGER *old );
NTSTATUS (WINAPI *NtSetTimer)( HANDLE handle, const LARGE_INTEGER *when,
PTIMER_APC_ROUTINE callback, void *arg,
BOOLEAN resume, ULONG period, BOOLEAN *state );
NTSTATUS (WINAPI *NtSetVolumeInformationFile)( HANDLE handle, IO_STATUS_BLOCK *io, void *info, NTSTATUS (WINAPI *NtSetVolumeInformationFile)( HANDLE handle, IO_STATUS_BLOCK *io, void *info,
ULONG length, FS_INFORMATION_CLASS class ); ULONG length, FS_INFORMATION_CLASS class );
NTSTATUS (WINAPI *NtSignalAndWaitForSingleObject)( HANDLE signal, HANDLE wait, NTSTATUS (WINAPI *NtSignalAndWaitForSingleObject)( HANDLE signal, HANDLE wait,