Updated ntdll-ForceBottomUpAlloc patchset.

This commit is contained in:
Paul Gofman
2020-06-02 21:10:34 +03:00
parent 6387991cc0
commit 676f261e5e
11 changed files with 531 additions and 517 deletions

View File

@@ -1,4 +1,4 @@
From 70785e15d5f0344c186714e859595b667dc34a07 Mon Sep 17 00:00:00 2001
From bc7e6ddf9534dd8afced865788a3d6ce8d068a47 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 28 May 2017 11:17:26 +0200
Subject: [PATCH] ntdll: Resolve drive symlinks before returning section name.
@@ -11,10 +11,10 @@ Subject: [PATCH] ntdll: Resolve drive symlinks before returning section name.
4 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 453568d641e..12da4316e88 100644
index 7a9de26ccb0..1062e35e009 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2798,7 +2798,7 @@ static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, ANSI
@@ -2806,7 +2806,7 @@ static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, ANSI
}
/* read the contents of an NT symlink object */
@@ -24,10 +24,10 @@ index 453568d641e..12da4316e88 100644
OBJECT_ATTRIBUTES attr;
UNICODE_STRING targetW;
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 427cdaad441..f92adb0c0dc 100644
index b6507599a92..b7822c54ad0 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -177,6 +177,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
@@ -182,6 +182,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
UINT disposition ) DECLSPEC_HIDDEN;
/* virtual memory */
@@ -36,19 +36,19 @@ index 427cdaad441..f92adb0c0dc 100644
const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type,
ULONG protect, pe_image_info_t *image_info ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index fb9a1a57729..89ed3bb3f0b 100644
index cc1d6e5d6f2..3d53b92cb8e 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -188,6 +188,8 @@ static BYTE **pages_vprot;
@@ -192,6 +192,8 @@ static BYTE **pages_vprot;
static BYTE *pages_vprot;
#endif
+#define MAX_DIR_ENTRY_LEN 255 /* max length of a directory entry in chars */
+
static struct file_view *view_block_start, *view_block_end, *next_free_view;
static const size_t view_block_size = 0x100000;
static void *preload_reserve_start;
@@ -3471,12 +3473,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
#ifdef _WIN64
static const size_t view_block_size = 0x200000;
@@ -3713,12 +3715,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
MEMORY_SECTION_NAME *info,
SIZE_T len, SIZE_T *res_len )
{
@@ -65,7 +65,7 @@ index fb9a1a57729..89ed3bb3f0b 100644
if (!addr || !info || !res_len) return STATUS_INVALID_PARAMETER;
@@ -3535,14 +3540,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -3777,14 +3782,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
}
found:
@@ -106,10 +106,10 @@ index fb9a1a57729..89ed3bb3f0b 100644
else
status = (len < sizeof(MEMORY_SECTION_NAME)) ? STATUS_INFO_LENGTH_MISMATCH : STATUS_BUFFER_OVERFLOW;
diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c
index f6a7b69eca0..a8263a2f44b 100644
index 99e87db9543..3984805d2b9 100644
--- a/dlls/psapi/tests/psapi_main.c
+++ b/dlls/psapi/tests/psapi_main.c
@@ -476,7 +476,6 @@ static void test_GetMappedFileName(void)
@@ -488,7 +488,6 @@ static void test_GetMappedFileName(void)
ret = GetMappedFileNameA(GetCurrentProcess(), base, map_name, sizeof(map_name));
ok(ret, "GetMappedFileName error %d\n", GetLastError());
ok(ret > strlen(device_name), "map_name should be longer than device_name\n");
@@ -117,7 +117,7 @@ index f6a7b69eca0..a8263a2f44b 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
SetLastError(0xdeadbeef);
@@ -489,7 +488,6 @@ todo_wine {
@@ -501,7 +500,6 @@ todo_wine {
{
ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name);
WideCharToMultiByte(CP_ACP, 0, map_nameW, -1, map_name, MAX_PATH, NULL, NULL);
@@ -125,7 +125,7 @@ index f6a7b69eca0..a8263a2f44b 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
}
@@ -502,7 +500,6 @@ todo_wine
@@ -514,7 +512,6 @@ todo_wine
{
ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name);
WideCharToMultiByte(CP_ACP, 0, map_nameW, -1, map_name, MAX_PATH, NULL, NULL);
@@ -133,7 +133,7 @@ index f6a7b69eca0..a8263a2f44b 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
}
@@ -510,7 +507,6 @@ todo_wine
@@ -522,7 +519,6 @@ todo_wine
ret = GetMappedFileNameA(GetCurrentProcess(), base + 0x2000, map_name, sizeof(map_name));
ok(ret, "GetMappedFileName error %d\n", GetLastError());
ok(ret > strlen(device_name), "map_name should be longer than device_name\n");
@@ -141,7 +141,7 @@ index f6a7b69eca0..a8263a2f44b 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
SetLastError(0xdeadbeef);
@@ -592,7 +588,7 @@ static void test_GetProcessImageFileName(void)
@@ -604,7 +600,7 @@ static void test_GetProcessImageFileName(void)
{
/* Windows returns 2*strlen-1 */
ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%d\n", szImgPath, ret);