Rebase against fa9f4a20f5305b7cbcfe3a644d39d4b759f89203.

This commit is contained in:
Alistair Leslie-Hughes 2020-10-02 08:48:09 +10:00
parent cd9f6dbd90
commit 7145412e08
8 changed files with 21 additions and 191 deletions

View File

@ -1,4 +1,4 @@
From 700513f28e4844cbfc40b3ebf1b77cf121b71e71 Mon Sep 17 00:00:00 2001
From 0cf6433af95363c5fbba2af482b2ba50b863dfb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:44:31 +0200
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 587c87bbfc0..05b40326d82 100644
index 20bc3f977d1..c2187a19397 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
@ -20,7 +20,7 @@ index 587c87bbfc0..05b40326d82 100644
#ifdef _WIN64
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
@@ -3487,6 +3488,7 @@ static void process_breakpoint(void)
@@ -3456,6 +3457,7 @@ static void process_breakpoint(void)
__ENDTRY
}
@ -28,17 +28,17 @@ index 587c87bbfc0..05b40326d82 100644
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
@@ -3497,6 +3499,9 @@ static void process_breakpoint(void)
@@ -3465,6 +3467,9 @@ static void process_breakpoint(void)
*/
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const unsigned int fls_slot_count = 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits);
+ OBJECT_ATTRIBUTES staging_event_attr;
+ UNICODE_STRING staging_event_string;
+ HANDLE staging_event;
static int attach_done;
int i;
NTSTATUS status;
@@ -3515,6 +3520,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
@@ -3483,6 +3488,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
entry = (void **)&context->u.s.X0;
#endif

View File

@ -1 +1 @@
Depends: ntdll-FLS_Callbacks
#Depends: ntdll-FLS_Callbacks

View File

@ -1,4 +1,4 @@
From 803d1e468279ef5efc5f8f872e2fb9db2466cd75 Mon Sep 17 00:00:00 2001
From 768f70f18be51fe0a1d92c04fbf3795fd619e127 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 3 Apr 2017 01:06:26 +0200
Subject: [PATCH] ntdll: Add dummy apiset to PEB.
@ -12,18 +12,18 @@ Subject: [PATCH] ntdll: Add dummy apiset to PEB.
create mode 100644 include/apiset.h
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index bd19474e844..00a146278a5 100644
index c2187a19397..2fb24737495 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -166,6 +166,7 @@ static PEB_LDR_DATA ldr = { sizeof(ldr), TRUE };
@@ -170,6 +170,7 @@ static PEB_LDR_DATA ldr = { sizeof(ldr), TRUE };
static RTL_BITMAP tls_bitmap;
static RTL_BITMAP tls_expansion_bitmap;
static RTL_BITMAP fls_bitmap;
+static API_SET_NAMESPACE_ARRAY apiset_map;
static CRITICAL_SECTION fls_section;
static CRITICAL_SECTION_DEBUG fls_critsect_debug =
@@ -4016,6 +4017,7 @@ void __wine_process_init(void)
static WINE_MODREF *cached_modref;
static WINE_MODREF *current_modref;
@@ -4017,6 +4018,7 @@ static NTSTATUS process_init(void)
peb->LdrData = &ldr;
peb->FastPebLock = &peb_lock;
@ -32,7 +32,7 @@ index bd19474e844..00a146278a5 100644
peb->TlsExpansionBitmap = &tls_expansion_bitmap;
peb->FlsBitmap = &fls_bitmap;
diff --git a/include/Makefile.in b/include/Makefile.in
index 90fb873f203..015ad7c6942 100644
index 34daad90e78..ad4a131c245 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -15,6 +15,7 @@ SOURCES = \
@ -87,7 +87,7 @@ index 00000000000..6801cd5f509
+
+#endif
diff --git a/include/winternl.h b/include/winternl.h
index 9a70a2014f1..1d3ef1f5adb 100644
index 82328167c9e..6c720f7eff6 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -23,6 +23,7 @@
@ -98,7 +98,7 @@ index 9a70a2014f1..1d3ef1f5adb 100644
#ifdef __cplusplus
extern "C" {
@@ -288,7 +289,7 @@ typedef struct _PEB
@@ -289,7 +290,7 @@ typedef struct _PEB
ULONG EnvironmentUpdateCount; /* 028/050 */
PVOID KernelCallbackTable; /* 02c/058 */
ULONG Reserved[2]; /* 030/060 */
@ -108,5 +108,5 @@ index 9a70a2014f1..1d3ef1f5adb 100644
PRTL_BITMAP TlsBitmap; /* 040/078 */
ULONG TlsBitmapBits[2]; /* 044/080 */
--
2.27.0
2.28.0

View File

@ -1,2 +1,2 @@
Fixes: [44658] Add dummy apiset to PEB struct
Depends: ntdll-FLS_Callbacks
#Depends: ntdll-FLS_Callbacks

View File

@ -1,2 +1,2 @@
Fixes: [49012] Application build with .NET CoreRT crashes due to FLS callbacks not being called
Disabled: True

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "d45b3d4fdd7cbcfdba70c327ab90976a3b658da2"
echo "fa9f4a20f5305b7cbcfe3a644d39d4b759f89203"
}
# Show version information
@ -161,7 +161,6 @@ patch_enable_all ()
enable_ntdll_DOS_Attributes="$1"
enable_ntdll_Dealloc_Thread_Stack="$1"
enable_ntdll_Exception="$1"
enable_ntdll_FLS_Callbacks="$1"
enable_ntdll_FileDispositionInformation="$1"
enable_ntdll_FileFsFullSizeInformation="$1"
enable_ntdll_Fix_Alignment="$1"
@ -324,7 +323,6 @@ patch_enable_all ()
enable_wpcap_Dynamic_Linking="$1"
enable_ws2_32_APC_Performance="$1"
enable_ws2_32_Connect_Time="$1"
enable_ws2_32_getaddrinfo="$1"
enable_ws2_32_getsockopt="$1"
enable_wtsapi32_EnumerateProcesses="$1"
enable_xactengine_initial="$1"
@ -573,9 +571,6 @@ patch_enable ()
ntdll-Exception)
enable_ntdll_Exception="$2"
;;
ntdll-FLS_Callbacks)
enable_ntdll_FLS_Callbacks="$2"
;;
ntdll-FileDispositionInformation)
enable_ntdll_FileDispositionInformation="$2"
;;
@ -1062,9 +1057,6 @@ patch_enable ()
ws2_32-Connect_Time)
enable_ws2_32_Connect_Time="$2"
;;
ws2_32-getaddrinfo)
enable_ws2_32_getaddrinfo="$2"
;;
ws2_32-getsockopt)
enable_ws2_32_getsockopt="$2"
;;
@ -1639,13 +1631,6 @@ if test "$enable_ntdll_WRITECOPY" -eq 1; then
enable_ntdll_ForceBottomUpAlloc=1
fi
if test "$enable_ntdll_ApiSetMap" -eq 1; then
if test "$enable_ntdll_FLS_Callbacks" -gt 1; then
abort "Patchset ntdll-FLS_Callbacks disabled, but ntdll-ApiSetMap depends on that."
fi
enable_ntdll_FLS_Callbacks=1
fi
if test "$enable_kernel32_Processor_Group" -eq 1; then
if test "$enable_api_ms_win_Stub_DLLs" -gt 1; then
abort "Patchset api-ms-win-Stub_DLLs disabled, but kernel32-Processor_Group depends on that."
@ -1709,13 +1694,6 @@ if test "$enable_nvapi_Stub_DLL" -eq 1; then
enable_nvcuda_CUDA_Support=1
fi
if test "$enable_Staging" -eq 1; then
if test "$enable_ntdll_FLS_Callbacks" -gt 1; then
abort "Patchset ntdll-FLS_Callbacks disabled, but Staging depends on that."
fi
enable_ntdll_FLS_Callbacks=1
fi
# Patchset Compiler_Warnings
# |
@ -1754,29 +1732,8 @@ if test "$enable_Pipelight" -eq 1; then
patch_apply Pipelight/0004-winex11.drv-Indicate-direct-rendering-through-OpenGL.patch
fi
# Patchset ntdll-FLS_Callbacks
# |
# | This patchset fixes the following Wine bugs:
# | * [#49012] Application build with .NET CoreRT crashes due to FLS callbacks not being called
# |
# | Modified files:
# | * dlls/kernel32/tests/fiber.c, dlls/kernel32/tests/loader.c, dlls/kernel32/tests/thread.c, dlls/kernelbase/thread.c,
# | dlls/ntdll/loader.c
# |
if test "$enable_ntdll_FLS_Callbacks" -eq 1; then
patch_apply ntdll-FLS_Callbacks/0001-kernelbase-Maintain-FLS-storage-list-in-PEB.patch
patch_apply ntdll-FLS_Callbacks/0002-kernelbase-Don-t-use-PEB-lock-for-FLS-data.patch
patch_apply ntdll-FLS_Callbacks/0003-kernelbase-Zero-all-FLS-slots-instances-in-FlsFree.patch
patch_apply ntdll-FLS_Callbacks/0004-ntdll-Call-FLS-callbacks-on-thread-shutdown.patch
patch_apply ntdll-FLS_Callbacks/0005-kernelbase-Call-FLS-callbacks-from-FlsFree.patch
patch_apply ntdll-FLS_Callbacks/0006-kernelbase-Call-FLS-callbacks-from-DeleteFiber.patch
fi
# Patchset Staging
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-FLS_Callbacks
# |
# | Modified files:
# | * Makefile.in, dlls/ntdll/Makefile.in, dlls/ntdll/loader.c
# |
@ -2808,9 +2765,6 @@ fi
# Patchset ntdll-ApiSetMap
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-FLS_Callbacks
# |
# | This patchset fixes the following Wine bugs:
# | * [#44658] Add dummy apiset to PEB struct
# |
@ -4984,15 +4938,6 @@ if test "$enable_ws2_32_Connect_Time" -eq 1; then
patch_apply ws2_32-Connect_Time/0001-ws2_32-Implement-returning-the-proper-time-with-SO_C.patch
fi
# Patchset ws2_32-getaddrinfo
# |
# | Modified files:
# | * dlls/ws2_32/socket.c
# |
if test "$enable_ws2_32_getaddrinfo" -eq 1; then
patch_apply ws2_32-getaddrinfo/0001-ws2_32-Fix-handling-of-empty-string-in-WS_getaddrinf.patch
fi
# Patchset ws2_32-getsockopt
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,115 +0,0 @@
From 381a5842063016c8cec8810f81baaa7e07b790ac Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 31 Aug 2017 01:15:05 +0200
Subject: [PATCH] ws2_32: Fix handling of empty string in WS_getaddrinfo.
Fixes a regression introduced in a2053597cc326e2305c44e1c1a954c2e0ee2853e.
---
dlls/ws2_32/socket.c | 46 +++++++++++++++++++++++++++++++++++++-------
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 05423d4b90c..71aaf433d1b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -6759,6 +6759,22 @@ static int convert_eai_u2w(int unixret) {
return unixret;
}
+static char *get_hostname(void)
+{
+ char *ret;
+ DWORD size = 0;
+
+ GetComputerNameExA( ComputerNamePhysicalDnsHostname, NULL, &size );
+ if (GetLastError() != ERROR_MORE_DATA) return NULL;
+ if (!(ret = HeapAlloc( GetProcessHeap(), 0, size ))) return NULL;
+ if (!GetComputerNameExA( ComputerNamePhysicalDnsHostname, ret, &size ))
+ {
+ HeapFree( GetProcessHeap(), 0, ret );
+ return NULL;
+ }
+ return ret;
+}
+
static char *get_fqdn(void)
{
char *ret;
@@ -6784,7 +6800,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
struct addrinfo *unixaires = NULL;
int result;
struct addrinfo unixhints, *punixhints = NULL;
- char *nodeV6 = NULL, *fqdn = NULL;
+ char *nodeV6 = NULL, *hostname, *fqdn = NULL;
const char *node;
*res = NULL;
@@ -6794,13 +6810,20 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
return WSAHOST_NOT_FOUND;
}
+ hostname = get_hostname();
+ if (!hostname) return WSA_NOT_ENOUGH_MEMORY;
+
+ fqdn = get_fqdn();
+ if (!fqdn)
+ {
+ HeapFree(GetProcessHeap(), 0, hostname);
+ return WSA_NOT_ENOUGH_MEMORY;
+ }
+
if (!nodename)
node = NULL;
else if (!nodename[0])
- {
- if (!(fqdn = get_fqdn())) return WSA_NOT_ENOUGH_MEMORY;
- node = fqdn;
- }
+ node = hostname;
else
{
node = nodename;
@@ -6813,7 +6836,13 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
if (node[0] == '[' && (close_bracket = strchr(node + 1, ']')))
{
nodeV6 = HeapAlloc(GetProcessHeap(), 0, close_bracket - node);
- if (!nodeV6) return WSA_NOT_ENOUGH_MEMORY;
+ if (!nodeV6)
+ {
+ HeapFree(GetProcessHeap(), 0, hostname);
+ HeapFree(GetProcessHeap(), 0, fqdn);
+ return WSA_NOT_ENOUGH_MEMORY;
+ }
+
lstrcpynA(nodeV6, node + 1, close_bracket - node);
node = nodeV6;
}
@@ -6840,6 +6869,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
if (punixhints->ai_socktype < 0)
{
SetLastError(WSAESOCKTNOSUPPORT);
+ HeapFree(GetProcessHeap(), 0, hostname);
HeapFree(GetProcessHeap(), 0, fqdn);
HeapFree(GetProcessHeap(), 0, nodeV6);
return SOCKET_ERROR;
@@ -6864,7 +6894,8 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
/* getaddrinfo(3) is thread safe, no need to wrap in CS */
result = getaddrinfo(node, servname, punixhints, &unixaires);
- if (result && (!hints || !(hints->ai_flags & WS_AI_NUMERICHOST)) && node)
+ if (result && (!hints || !(hints->ai_flags & WS_AI_NUMERICHOST))
+ && node && (!strcmp(node, hostname) || !strcmp(node, fqdn)))
{
if (!fqdn && !(fqdn = get_fqdn()))
{
@@ -6881,6 +6912,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
}
}
TRACE("%s, %s %p -> %p %d\n", debugstr_a(nodename), debugstr_a(servname), hints, res, result);
+ HeapFree(GetProcessHeap(), 0, hostname);
HeapFree(GetProcessHeap(), 0, fqdn);
HeapFree(GetProcessHeap(), 0, nodeV6);
--
2.28.0

View File

@ -1 +1 @@
d45b3d4fdd7cbcfdba70c327ab90976a3b658da2
fa9f4a20f5305b7cbcfe3a644d39d4b759f89203