Rebase against c13351c05af43aa542938e0c0935b154a8166905

This commit is contained in:
Alistair Leslie-Hughes
2019-06-14 09:20:21 +10:00
parent e2fa6bd9c0
commit e7110e5153
7 changed files with 31 additions and 302 deletions

View File

@@ -1,4 +1,4 @@
From e4d3e4ff13314d3b0161ade6f1cae2b7aa5c2f61 Mon Sep 17 00:00:00 2001
From 7eab2b3aaa657c6db87de440786dedecae1abe21 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.
@@ -6,12 +6,12 @@ Subject: [PATCH] ntdll: Resolve drive symlinks before returning section name.
---
dlls/ntdll/directory.c | 2 +-
dlls/ntdll/ntdll_misc.h | 1 +
dlls/ntdll/virtual.c | 38 ++++++++++++++++++++++++++++++++------
dlls/ntdll/virtual.c | 38 +++++++++++++++++++++++++++++------
dlls/psapi/tests/psapi_main.c | 6 +-----
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 664fa7b..902517a 100644
index 4810a9b7962..c6d496abdf2 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2928,7 +2928,7 @@ static NTSTATUS nt_to_unix_file_name_internal( const UNICODE_STRING *nameW, ANSI
@@ -24,19 +24,19 @@ index 664fa7b..902517a 100644
OBJECT_ATTRIBUTES attr;
UNICODE_STRING targetW;
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 165f083..d5d91dd 100644
index 5edd53c4610..6e1f14c432d 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -165,6 +165,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
UINT disposition ) DECLSPEC_HIDDEN;
@@ -176,6 +176,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
/* virtual memory */
extern NTSTATUS virtual_alloc_aligned( PVOID *ret, ULONG zero_bits, SIZE_T *size_ptr,
ULONG type, ULONG protect, ULONG alignment ) DECLSPEC_HIDDEN;
+extern NTSTATUS read_nt_symlink( HANDLE root, UNICODE_STRING *name, WCHAR *target, size_t length ) DECLSPEC_HIDDEN;
extern NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG zero_bits, SIZE_T commit_size,
const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG protect,
pe_image_info_t *image_info ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 1cb6428..a7bff45 100644
index ff0df9de70f..0641e1310e1 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -56,6 +56,7 @@
@@ -56,7 +56,7 @@ index 1cb6428..a7bff45 100644
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;
@@ -2907,12 +2910,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -2999,12 +3002,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
MEMORY_SECTION_NAME *info,
SIZE_T len, SIZE_T *res_len )
{
@@ -73,7 +73,7 @@ index 1cb6428..a7bff45 100644
if (!addr || !info || !res_len) return STATUS_INVALID_PARAMETER;
@@ -2971,14 +2977,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -3063,14 +3069,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
}
found:
@@ -114,10 +114,10 @@ index 1cb6428..a7bff45 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 e92b55b..6eb7e23 100644
index 9143fa79e7d..80636eb74a8 100644
--- a/dlls/psapi/tests/psapi_main.c
+++ b/dlls/psapi/tests/psapi_main.c
@@ -477,7 +477,6 @@ static void test_GetMappedFileName(void)
@@ -489,7 +489,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");
@@ -125,7 +125,7 @@ index e92b55b..6eb7e23 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);
@@ -490,7 +489,6 @@ todo_wine {
@@ -502,7 +501,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 e92b55b..6eb7e23 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
}
@@ -503,7 +501,6 @@ todo_wine
@@ -515,7 +513,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);
@@ -141,7 +141,7 @@ index e92b55b..6eb7e23 100644
ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name);
}
@@ -511,7 +508,6 @@ todo_wine
@@ -523,7 +520,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");
@@ -149,7 +149,7 @@ index e92b55b..6eb7e23 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);
@@ -593,7 +589,7 @@ static void test_GetProcessImageFileName(void)
@@ -605,7 +601,7 @@ static void test_GetProcessImageFileName(void)
{
/* Windows returns 2*strlen-1 */
ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%d\n", szImgPath, ret);
@@ -159,5 +159,5 @@ index e92b55b..6eb7e23 100644
SetLastError(0xdeadbeef);
--
2.7.4
2.17.1