From 95e2d05e5d6b92a2f6b28e00f36064b7bf6b249a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 6 Jun 2020 15:16:38 +0200 Subject: [PATCH] ntdll: Implement NtContinue() in the Unix library. Signed-off-by: Alexandre Julliard --- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/thread.c | 9 +++++++++ dlls/ntdll/unix/loader.c | 1 + dlls/ntdll/unix/thread.c | 12 ++++++++++++ dlls/ntdll/unixlib.h | 3 ++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 11fa03b4d1b..766e458621a 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -157,7 +157,7 @@ @ stdcall NtCompleteConnectPort(ptr) # @ stub NtCompressKey @ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stub NtContinue +@ stdcall NtContinue(ptr long) # @ stub NtCreateDebugObject @ stdcall NtCreateDirectoryObject(ptr long ptr) @ stdcall NtCreateEvent(ptr long ptr long long) @@ -1145,7 +1145,7 @@ @ stdcall -private ZwCompleteConnectPort(ptr) NtCompleteConnectPort # @ stub ZwCompressKey @ stdcall -private ZwConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) NtConnectPort -@ stub ZwContinue +@ stdcall -private ZwContinue(ptr long) NtContinue # @ stub ZwCreateDebugObject @ stdcall -private ZwCreateDirectoryObject(ptr long ptr) NtCreateDirectoryObject @ stdcall -private ZwCreateEvent(ptr long ptr long long) NtCreateEvent diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 18664030df5..d045466f6d2 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -602,6 +602,15 @@ NTSTATUS get_thread_context( HANDLE handle, context_t *context, unsigned int fla } +/*********************************************************************** + * NtContinue (NTDLL.@) + */ +NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable ) +{ + return unix_funcs->NtContinue( context, alertable ); +} + + /*********************************************************************** * NtSetContextThread (NTDLL.@) * ZwSetContextThread (NTDLL.@) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 3116c885d15..618e3d6adb3 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -988,6 +988,7 @@ static struct unix_funcs unix_funcs = NtCancelTimer, NtClearEvent, NtClose, + NtContinue, NtCreateEvent, NtCreateKeyedEvent, NtCreateMutant, diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 1fc7dc84543..d4b7a51a627 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -470,6 +470,18 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL } +/*********************************************************************** + * NtContinue (NTDLL.@) + */ +NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable ) +{ + static const LARGE_INTEGER zero_timeout; + + if (alertable) server_wait( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, &zero_timeout ); + return NtSetContextThread( GetCurrentThread(), context ); +} + + /*********************************************************************** * set_thread_context */ diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index 779b91c89b9..017a0a71b3f 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -28,7 +28,7 @@ struct ldt_copy; struct msghdr; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 31 +#define NTDLL_UNIXLIB_VERSION 32 struct unix_funcs { @@ -39,6 +39,7 @@ struct unix_funcs NTSTATUS (WINAPI *NtCancelTimer)( HANDLE handle, BOOLEAN *state ); NTSTATUS (WINAPI *NtClearEvent)( HANDLE handle ); NTSTATUS (WINAPI *NtClose)( HANDLE handle ); + NTSTATUS (WINAPI *NtContinue)( CONTEXT *context, BOOLEAN alertable ); NTSTATUS (WINAPI *NtCreateEvent)( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN state ); NTSTATUS (WINAPI *NtCreateKeyedEvent)( HANDLE *handle, ACCESS_MASK access,