From 9d911a5736e12fbafdfb4df9870dfb386dd8e888 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 22 Jan 2018 15:17:25 +0100 Subject: [PATCH] ntdll: Move suspending a thread on startup back to the platform-specific files. This partially reverts f64d2688d20952fb0085deeba98c952fd8bf1497. Signed-off-by: Alexandre Julliard --- dlls/ntdll/loader.c | 4 +--- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_arm.c | 2 +- dlls/ntdll/signal_arm64.c | 3 ++- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdll/signal_powerpc.c | 3 ++- dlls/ntdll/signal_x86_64.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index fe02b6c0e58..2b0fefc8b21 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2963,14 +2963,12 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) * Attach to all the loaded dlls. * If this is the first time, perform the full process initialization. */ -NTSTATUS attach_dlls( CONTEXT *context, BOOL suspend ) +NTSTATUS attach_dlls( CONTEXT *context ) { NTSTATUS status; WINE_MODREF *wm; LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; - if (suspend) wait_suspend( context ); - pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL ); if (process_detaching) return STATUS_SUCCESS; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 32a385f919b..e32ea617827 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -106,7 +106,7 @@ extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) /* module handling */ extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; -extern NTSTATUS attach_dlls( CONTEXT *context, BOOL suspend ) DECLSPEC_HIDDEN; +extern NTSTATUS attach_dlls( CONTEXT *context ) DECLSPEC_HIDDEN; extern FARPROC RELAY_GetProcAddress( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size, FARPROC proc, DWORD ordinal, const WCHAR *user ) DECLSPEC_HIDDEN; extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size, diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 355817b0a97..d60c2a9dc26 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -1286,7 +1286,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg, init_thread_context( ctx, entry, arg, relay ); } ctx->ContextFlags = CONTEXT_FULL; - attach_dlls( ctx, FALSE ); + attach_dlls( ctx ); return ctx; } diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 57ec13a3b77..d6ec376c289 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -1016,7 +1016,8 @@ static void thread_startup( void *param ) context.Sp = (DWORD_PTR)NtCurrentTeb()->Tib.StackBase; context.Pc = (DWORD_PTR)info->start; - attach_dlls( &context, info->suspend ); + if (info->suspend) wait_suspend( &context ); + attach_dlls( &context ); ((thread_start_func)context.Pc)( (LPTHREAD_START_ROUTINE)context.u.s.X0, (void *)context.u.s.X1 ); } diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 9bf36c10f11..8b9101903bd 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -2996,7 +2996,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg, init_thread_context( ctx, entry, arg, relay ); } ctx->ContextFlags = CONTEXT_FULL; - attach_dlls( ctx, FALSE ); + attach_dlls( ctx ); return ctx; } diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 3182a13d370..d69c616c3c6 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -1178,7 +1178,8 @@ static void thread_startup( void *param ) context.Gpr4 = (DWORD)info->arg; context.Iar = (DWORD)info->start; - attach_dlls( &context, info->suspend ); + if (info->suspend) wait_suspend( &context ); + attach_dlls( &context ); ((thread_start_func)context.Iar)( (LPTHREAD_START_ROUTINE)context.Gpr3, (void *)context.Gpr4 ); } diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 946c0f1bcd5..abd3174f220 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -4169,7 +4169,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg, init_thread_context( ctx, entry, arg, relay ); } ctx->ContextFlags = CONTEXT_FULL; - attach_dlls( ctx, FALSE ); + attach_dlls( ctx ); return ctx; }