ntdll: Use syscall thunks for wait functions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-16 10:30:34 +02:00
parent aa08e15415
commit 9f8acda167
4 changed files with 11 additions and 75 deletions

View File

@ -191,7 +191,7 @@
@ stdcall -arch=win32,arm64 NtCurrentTeb() @ stdcall -arch=win32,arm64 NtCurrentTeb()
# @ stub NtDebugActiveProcess # @ stub NtDebugActiveProcess
# @ stub NtDebugContinue # @ stub NtDebugContinue
@ stdcall NtDelayExecution(long ptr) @ stdcall -syscall NtDelayExecution(long ptr)
@ stdcall NtDeleteAtom(long) @ stdcall NtDeleteAtom(long)
# @ stub NtDeleteBootEntry # @ stub NtDeleteBootEntry
@ stdcall NtDeleteFile(ptr) @ stdcall NtDeleteFile(ptr)
@ -401,7 +401,7 @@
@ stdcall NtSetValueKey(long ptr long long ptr long) @ stdcall NtSetValueKey(long ptr long long ptr long)
@ stdcall NtSetVolumeInformationFile(long ptr ptr long long) @ stdcall NtSetVolumeInformationFile(long ptr ptr long long)
@ stdcall NtShutdownSystem(long) @ stdcall NtShutdownSystem(long)
@ stdcall NtSignalAndWaitForSingleObject(long long long ptr) @ stdcall -syscall NtSignalAndWaitForSingleObject(long long long ptr)
@ stub NtStartProfile @ stub NtStartProfile
@ stub NtStopProfile @ stub NtStopProfile
@ stdcall NtSuspendProcess(long) @ stdcall NtSuspendProcess(long)
@ -423,16 +423,16 @@
@ stub NtW32Call @ stub NtW32Call
# @ stub NtWaitForDebugEvent # @ stub NtWaitForDebugEvent
@ stdcall NtWaitForKeyedEvent(long ptr long ptr) @ stdcall NtWaitForKeyedEvent(long ptr long ptr)
@ stdcall NtWaitForMultipleObjects(long ptr long long ptr) @ stdcall -syscall NtWaitForMultipleObjects(long ptr long long ptr)
@ stub NtWaitForProcessMutant @ stub NtWaitForProcessMutant
@ stdcall NtWaitForSingleObject(long long ptr) @ stdcall -syscall NtWaitForSingleObject(long long ptr)
@ stub NtWaitHighEventPair @ stub NtWaitHighEventPair
@ stub NtWaitLowEventPair @ stub NtWaitLowEventPair
@ stdcall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr) @ stdcall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr)
@ stdcall NtWriteFileGather(long long ptr ptr ptr ptr long ptr ptr) @ stdcall NtWriteFileGather(long long ptr ptr ptr ptr long ptr ptr)
@ stub NtWriteRequestData @ stub NtWriteRequestData
@ stdcall NtWriteVirtualMemory(long ptr ptr long ptr) @ stdcall NtWriteVirtualMemory(long ptr ptr long ptr)
@ stdcall NtYieldExecution() @ stdcall -syscall NtYieldExecution()
@ stub PfxFindPrefix @ stub PfxFindPrefix
@ stub PfxInitialize @ stub PfxInitialize
@ stub PfxInsertPrefix @ stub PfxInsertPrefix
@ -1176,7 +1176,7 @@
# @ stub ZwCreateWaitablePort # @ stub ZwCreateWaitablePort
# @ stub ZwDebugActiveProcess # @ stub ZwDebugActiveProcess
# @ stub ZwDebugContinue # @ stub ZwDebugContinue
@ stdcall -private ZwDelayExecution(long ptr) NtDelayExecution @ stdcall -private -syscall ZwDelayExecution(long ptr) NtDelayExecution
@ stdcall -private ZwDeleteAtom(long) NtDeleteAtom @ stdcall -private ZwDeleteAtom(long) NtDeleteAtom
# @ stub ZwDeleteBootEntry # @ stub ZwDeleteBootEntry
@ stdcall -private ZwDeleteFile(ptr) NtDeleteFile @ stdcall -private ZwDeleteFile(ptr) NtDeleteFile
@ -1385,7 +1385,7 @@
@ stdcall -private ZwSetValueKey(long ptr long long ptr long) NtSetValueKey @ stdcall -private ZwSetValueKey(long ptr long long ptr long) NtSetValueKey
@ stdcall -private ZwSetVolumeInformationFile(long ptr ptr long long) NtSetVolumeInformationFile @ stdcall -private ZwSetVolumeInformationFile(long ptr ptr long long) NtSetVolumeInformationFile
@ stdcall -private ZwShutdownSystem(long) NtShutdownSystem @ stdcall -private ZwShutdownSystem(long) NtShutdownSystem
@ stdcall -private ZwSignalAndWaitForSingleObject(long long long ptr) NtSignalAndWaitForSingleObject @ stdcall -private -syscall ZwSignalAndWaitForSingleObject(long long long ptr) NtSignalAndWaitForSingleObject
@ stub ZwStartProfile @ stub ZwStartProfile
@ stub ZwStopProfile @ stub ZwStopProfile
@ stdcall -private ZwSuspendProcess(long) NtSuspendProcess @ stdcall -private ZwSuspendProcess(long) NtSuspendProcess
@ -1407,16 +1407,16 @@
@ stub ZwW32Call @ stub ZwW32Call
# @ stub ZwWaitForDebugEvent # @ stub ZwWaitForDebugEvent
@ stdcall -private ZwWaitForKeyedEvent(long ptr long ptr) NtWaitForKeyedEvent @ stdcall -private ZwWaitForKeyedEvent(long ptr long ptr) NtWaitForKeyedEvent
@ stdcall -private ZwWaitForMultipleObjects(long ptr long long ptr) NtWaitForMultipleObjects @ stdcall -private -syscall ZwWaitForMultipleObjects(long ptr long long ptr) NtWaitForMultipleObjects
@ stub ZwWaitForProcessMutant @ stub ZwWaitForProcessMutant
@ stdcall -private ZwWaitForSingleObject(long long ptr) NtWaitForSingleObject @ stdcall -private -syscall ZwWaitForSingleObject(long long ptr) NtWaitForSingleObject
@ stub ZwWaitHighEventPair @ stub ZwWaitHighEventPair
@ stub ZwWaitLowEventPair @ stub ZwWaitLowEventPair
@ stdcall -private ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) NtWriteFile @ stdcall -private ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) NtWriteFile
@ stdcall -private ZwWriteFileGather(long long ptr ptr ptr ptr long ptr ptr) NtWriteFileGather @ stdcall -private ZwWriteFileGather(long long ptr ptr ptr ptr long ptr ptr) NtWriteFileGather
@ stub ZwWriteRequestData @ stub ZwWriteRequestData
@ stdcall -private ZwWriteVirtualMemory(long ptr ptr long ptr) NtWriteVirtualMemory @ stdcall -private ZwWriteVirtualMemory(long ptr ptr long ptr) NtWriteVirtualMemory
@ stdcall -private ZwYieldExecution() NtYieldExecution @ stdcall -private -syscall ZwYieldExecution() NtYieldExecution
@ cdecl -private -arch=i386 _CIcos() @ cdecl -private -arch=i386 _CIcos()
@ cdecl -private -arch=i386 _CIlog() @ cdecl -private -arch=i386 _CIlog()
@ cdecl -private -arch=i386 _CIpow() @ cdecl -private -arch=i386 _CIpow()

View File

@ -167,56 +167,6 @@ NTSTATUS WINAPI NtSetTimerResolution(IN ULONG resolution,
/* wait operations */
/******************************************************************
* NtWaitForMultipleObjects (NTDLL.@)
*/
NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
BOOLEAN wait_any, BOOLEAN alertable,
const LARGE_INTEGER *timeout )
{
return unix_funcs->NtWaitForMultipleObjects( count, handles, wait_any, alertable, timeout );
}
/******************************************************************
* NtWaitForSingleObject (NTDLL.@)
*/
NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
return unix_funcs->NtWaitForSingleObject( handle, alertable, timeout );
}
/******************************************************************
* NtSignalAndWaitForSingleObject (NTDLL.@)
*/
NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait,
BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
return unix_funcs->NtSignalAndWaitForSingleObject( signal, wait, alertable, timeout );
}
/******************************************************************
* NtYieldExecution (NTDLL.@)
*/
NTSTATUS WINAPI NtYieldExecution(void)
{
return unix_funcs->NtYieldExecution();
}
/******************************************************************
* NtDelayExecution (NTDLL.@)
*/
NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
return unix_funcs->NtDelayExecution( alertable, timeout );
}
/****************************************************************************** /******************************************************************************
* NtCreateKeyedEvent (NTDLL.@) * NtCreateKeyedEvent (NTDLL.@)
*/ */

View File

@ -1372,7 +1372,6 @@ static struct unix_funcs unix_funcs =
NtCreateThreadEx, NtCreateThreadEx,
NtCreateUserProcess, NtCreateUserProcess,
NtCurrentTeb, NtCurrentTeb,
NtDelayExecution,
NtDeleteFile, NtDeleteFile,
NtDeviceIoControlFile, NtDeviceIoControlFile,
NtDuplicateObject, NtDuplicateObject,
@ -1430,7 +1429,6 @@ static struct unix_funcs unix_funcs =
NtSetLdtEntries, NtSetLdtEntries,
NtSetSystemTime, NtSetSystemTime,
NtSetVolumeInformationFile, NtSetVolumeInformationFile,
NtSignalAndWaitForSingleObject,
NtSuspendProcess, NtSuspendProcess,
NtSuspendThread, NtSuspendThread,
NtTerminateProcess, NtTerminateProcess,
@ -1438,12 +1436,9 @@ static struct unix_funcs unix_funcs =
NtUnlockVirtualMemory, NtUnlockVirtualMemory,
NtUnmapViewOfSection, NtUnmapViewOfSection,
NtWaitForKeyedEvent, NtWaitForKeyedEvent,
NtWaitForMultipleObjects,
NtWaitForSingleObject,
NtWriteFile, NtWriteFile,
NtWriteFileGather, NtWriteFileGather,
NtWriteVirtualMemory, NtWriteVirtualMemory,
NtYieldExecution,
DbgUiIssueRemoteBreakin, DbgUiIssueRemoteBreakin,
RtlGetSystemTimePrecise, RtlGetSystemTimePrecise,
RtlWaitOnAddress, RtlWaitOnAddress,

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 79 #define NTDLL_UNIXLIB_VERSION 80
struct unix_funcs struct unix_funcs
{ {
@ -67,7 +67,6 @@ struct unix_funcs
RTL_USER_PROCESS_PARAMETERS *params, PS_CREATE_INFO *info, RTL_USER_PROCESS_PARAMETERS *params, PS_CREATE_INFO *info,
PS_ATTRIBUTE_LIST *attr ); PS_ATTRIBUTE_LIST *attr );
TEB * (WINAPI *NtCurrentTeb)(void); TEB * (WINAPI *NtCurrentTeb)(void);
NTSTATUS (WINAPI *NtDelayExecution)( BOOLEAN alertable, const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtDeleteFile)( OBJECT_ATTRIBUTES *attr ); NTSTATUS (WINAPI *NtDeleteFile)( OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtDeviceIoControlFile)( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, NTSTATUS (WINAPI *NtDeviceIoControlFile)( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
void *apc_context, IO_STATUS_BLOCK *io, ULONG code, void *apc_context, IO_STATUS_BLOCK *io, ULONG code,
@ -184,8 +183,6 @@ struct unix_funcs
NTSTATUS (WINAPI *NtSetSystemTime)( const LARGE_INTEGER *new, LARGE_INTEGER *old ); NTSTATUS (WINAPI *NtSetSystemTime)( const LARGE_INTEGER *new, LARGE_INTEGER *old );
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,
BOOLEAN alertable, const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtSuspendProcess)( HANDLE handle ); NTSTATUS (WINAPI *NtSuspendProcess)( HANDLE handle );
NTSTATUS (WINAPI *NtSuspendThread)( HANDLE handle, ULONG *count ); NTSTATUS (WINAPI *NtSuspendThread)( HANDLE handle, ULONG *count );
NTSTATUS (WINAPI *NtTerminateProcess)( HANDLE handle, LONG exit_code ); NTSTATUS (WINAPI *NtTerminateProcess)( HANDLE handle, LONG exit_code );
@ -195,11 +192,6 @@ struct unix_funcs
NTSTATUS (WINAPI *NtUnmapViewOfSection)( HANDLE process, PVOID addr ); NTSTATUS (WINAPI *NtUnmapViewOfSection)( HANDLE process, PVOID addr );
NTSTATUS (WINAPI *NtWaitForKeyedEvent)( HANDLE handle, const void *key, BOOLEAN alertable, NTSTATUS (WINAPI *NtWaitForKeyedEvent)( HANDLE handle, const void *key, BOOLEAN alertable,
const LARGE_INTEGER *timeout ); const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtWaitForMultipleObjects)( DWORD count, const HANDLE *handles,
BOOLEAN wait_any, BOOLEAN alertable,
const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtWaitForSingleObject)( HANDLE handle, BOOLEAN alertable,
const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtWriteFile)( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, NTSTATUS (WINAPI *NtWriteFile)( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user,
IO_STATUS_BLOCK *io, const void *buffer, ULONG length, IO_STATUS_BLOCK *io, const void *buffer, ULONG length,
LARGE_INTEGER *offset, ULONG *key ); LARGE_INTEGER *offset, ULONG *key );
@ -209,7 +201,6 @@ struct unix_funcs
LARGE_INTEGER *offset, ULONG *key ); LARGE_INTEGER *offset, ULONG *key );
NTSTATUS (WINAPI *NtWriteVirtualMemory)( HANDLE process, void *addr, const void *buffer, NTSTATUS (WINAPI *NtWriteVirtualMemory)( HANDLE process, void *addr, const void *buffer,
SIZE_T size, SIZE_T *bytes_written ); SIZE_T size, SIZE_T *bytes_written );
NTSTATUS (WINAPI *NtYieldExecution)(void);
/* other Win32 API functions */ /* other Win32 API functions */
NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process ); NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process );