ntdll-APC_Start_Process: Disable.

This commit is contained in:
Zebediah Figura 2018-02-21 18:30:24 -06:00
parent fa8100f1b9
commit c0279488d1
5 changed files with 34 additions and 49 deletions

View File

@ -3,7 +3,6 @@ Fixes: [39262] Run explorer.exe as unevaluated process
Depends: advapi32-CreateRestrictedToken
Depends: kernel32-COMSPEC
Depends: kernel32-UmsStubs
Depends: ntdll-APC_Start_Process
Depends: server-CreateProcess_ACLs
Depends: server-Misc_ACL
Depends: Staging

View File

@ -1 +1,17 @@
Fixes: Process APC calls before starting process
Disabled: true
# This patch is for an old snapshot build of Cygwin. It was originally posted
# in bug 24018, and a more detailed description is in bug 34865:
#
# https://bugs.winehq.org/show_bug.cgi?id=24018#c12
# https://bugs.winehq.org/show_bug.cgi?id=34865#c2
#
# Basic summary: user APCs which are queued in DllMain and in TLS callbacks
# need to be executed after all dlls are loaded and loader lock is released
# but before process entry.
# It broke due to recent reworking of the loader code. Alistair tried to rebase
# it but, with no explanation of the bug, did it incorrectly.
# The bug is potentially still valid (as given by comment 13 of the first link)
# so I'm not going to remove it. However, there is almost surely no application
# that needs it, so I have disabled it and removed all dependences on it.

View File

@ -1,14 +1,15 @@
From d209582c297d376da27f80dc62c59b2f5440da25 Mon Sep 17 00:00:00 2001
From d7f4b0f5977434617b89b513f3cfcc358c5584e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 1 Apr 2015 04:34:20 +0200
Subject: ntdll: Load CLI/.NET images in the same way as Windows XP and above.
Subject: [PATCH] ntdll: Load CLI/.NET images in the same way as Windows XP and
above.
---
dlls/ntdll/loader.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 123 insertions(+), 4 deletions(-)
dlls/ntdll/loader.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 127 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index cdf8d586c36..fa66c4c40d2 100644
index 3fcbbf7..16d4426 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -104,11 +104,16 @@ struct builtin_load_info
@ -28,7 +29,7 @@ index cdf8d586c36..fa66c4c40d2 100644
static RTL_CRITICAL_SECTION loader_section;
static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{
@@ -341,6 +346,78 @@ static inline ULONG_PTR allocate_stub( c
@@ -341,6 +346,78 @@ static inline ULONG_PTR allocate_stub( const char *dll, const char *name ) { ret
/*************************************************************************
@ -107,7 +108,7 @@ index cdf8d586c36..fa66c4c40d2 100644
* get_modref
*
* Looks for the referenced HMODULE in the current process
@@ -917,6 +994,10 @@ static NTSTATUS fixup_imports( WINE_MODR
@@ -904,6 +981,10 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
if (!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS)) return STATUS_SUCCESS; /* already done */
wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS;
@ -118,7 +119,7 @@ index cdf8d586c36..fa66c4c40d2 100644
wm->ldr.TlsIndex = alloc_tls_slot( &wm->ldr );
if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE,
@@ -1107,8 +1188,47 @@ static NTSTATUS MODULE_InitDLL( WINE_MOD
@@ -1094,8 +1175,47 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
BOOL retv = FALSE;
/* Skip calls for modules loaded with special load flags */
@ -167,7 +168,7 @@ index cdf8d586c36..fa66c4c40d2 100644
if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason );
if (!entry || !(wm->ldr.Flags & LDR_IMAGE_IS_DLL)) return STATUS_SUCCESS;
@@ -3329,12 +3449,17 @@ void WINAPI LdrInitializeThunk( void *ke
@@ -3154,6 +3274,12 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), status );
NtTerminateProcess( GetCurrentProcess(), status );
}
@ -177,14 +178,9 @@ index cdf8d586c36..fa66c4c40d2 100644
+ debugstr_w(peb->ProcessParameters->ImagePathName.Buffer), status );
+ NtTerminateProcess( GetCurrentProcess(), status );
+ }
timeout.QuadPart = 0;
NtDelayExecution( TRUE, &timeout );
- server_init_process_done();
+ server_init_process_done();
server_init_process_done();
}
--
2.14.1
2.7.4

View File

@ -1,3 +1,2 @@
Fixes: [38661] Implement proper handling of CLI .NET images in Wine library loader
Depends: mscoree-CorValidateImage
Depends: ntdll-APC_Start_Process

View File

@ -223,7 +223,6 @@ patch_enable_all ()
enable_msvfw32_ICGetDisplayFormat="$1"
enable_msxml3_Normalize_Data="$1"
enable_ntdll_APC_Performance="$1"
enable_ntdll_APC_Start_Process="$1"
enable_ntdll_Activation_Context="$1"
enable_ntdll_ApiSetMap="$1"
enable_ntdll_ApiSetQueryApiSetPresence="$1"
@ -918,9 +917,6 @@ patch_enable ()
ntdll-APC_Performance)
enable_ntdll_APC_Performance="$2"
;;
ntdll-APC_Start_Process)
enable_ntdll_APC_Start_Process="$2"
;;
ntdll-Activation_Context)
enable_ntdll_Activation_Context="$2"
;;
@ -2527,11 +2523,7 @@ if test "$enable_ntdll_CLI_Images" -eq 1; then
if test "$enable_mscoree_CorValidateImage" -gt 1; then
abort "Patchset mscoree-CorValidateImage disabled, but ntdll-CLI_Images depends on that."
fi
if test "$enable_ntdll_APC_Start_Process" -gt 1; then
abort "Patchset ntdll-APC_Start_Process disabled, but ntdll-CLI_Images depends on that."
fi
enable_mscoree_CorValidateImage=1
enable_ntdll_APC_Start_Process=1
fi
if test "$enable_ntdll_Builtin_Prot" -eq 1; then
@ -2697,9 +2689,6 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
if test "$enable_kernel32_UmsStubs" -gt 1; then
abort "Patchset kernel32-UmsStubs disabled, but advapi32-Token_Integrity_Level depends on that."
fi
if test "$enable_ntdll_APC_Start_Process" -gt 1; then
abort "Patchset ntdll-APC_Start_Process disabled, but advapi32-Token_Integrity_Level depends on that."
fi
if test "$enable_server_CreateProcess_ACLs" -gt 1; then
abort "Patchset server-CreateProcess_ACLs disabled, but advapi32-Token_Integrity_Level depends on that."
fi
@ -2710,7 +2699,6 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then
enable_advapi32_CreateRestrictedToken=1
enable_kernel32_COMSPEC=1
enable_kernel32_UmsStubs=1
enable_ntdll_APC_Start_Process=1
enable_server_CreateProcess_ACLs=1
enable_server_Misc_ACL=1
fi
@ -3027,23 +3015,10 @@ if test "$enable_kernel32_UmsStubs" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-APC_Start_Process
# |
# | Modified files:
# | * dlls/ntdll/loader.c
# |
if test "$enable_ntdll_APC_Start_Process" -eq 1; then
patch_apply ntdll-APC_Start_Process/0001-ntdll-Process-APC-calls-before-starting-process.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Process APC calls before starting process.", 1 },';
) >> "$patchlist"
fi
# Patchset advapi32-Token_Integrity_Level
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * Staging, advapi32-CreateRestrictedToken, kernel32-COMSPEC, kernel32-UmsStubs, ntdll-APC_Start_Process, server-
# | CreateProcess_ACLs, server-Misc_ACL
# | * Staging, advapi32-CreateRestrictedToken, kernel32-COMSPEC, kernel32-UmsStubs, server-CreateProcess_ACLs, server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
# | * [#40613] Basic implementation for token integrity levels and UAC handling
@ -5666,7 +5641,7 @@ fi
# Patchset ntdll-CLI_Images
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mscoree-CorValidateImage, ntdll-APC_Start_Process
# | * mscoree-CorValidateImage
# |
# | This patchset fixes the following Wine bugs:
# | * [#38661] Implement proper handling of CLI .NET images in Wine library loader
@ -5890,7 +5865,7 @@ fi
# Patchset ntdll-HashLinks
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mscoree-CorValidateImage, ntdll-APC_Start_Process, ntdll-CLI_Images, ntdll-LDR_MODULE
# | * mscoree-CorValidateImage, ntdll-CLI_Images, ntdll-LDR_MODULE
# |
# | Modified files:
# | * dlls/kernel32/tests/loader.c, dlls/ntdll/loader.c, include/winternl.h
@ -6013,8 +5988,8 @@ fi
# Patchset ntdll-LdrRegisterDllNotification
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mscoree-CorValidateImage, ntdll-APC_Start_Process, ntdll-CLI_Images, ntdll-LDR_MODULE, ntdll-HashLinks, ntdll-
# | ThreadTime, ntdll-Hide_Wine_Exports, ntdll-RtlQueryPackageIdentity
# | * mscoree-CorValidateImage, ntdll-CLI_Images, ntdll-LDR_MODULE, ntdll-HashLinks, ntdll-ThreadTime, ntdll-
# | Hide_Wine_Exports, ntdll-RtlQueryPackageIdentity
# |
# | Modified files:
# | * dlls/ntdll/loader.c, dlls/ntdll/ntdll.spec, dlls/ntdll/tests/rtl.c, include/winternl.h