Rebase against c9f72ccec2387da0c02fa1d35997fb914dcf4656.

This commit is contained in:
Sebastian Lackner
2017-09-08 02:18:58 +02:00
parent 279eca11f1
commit 729ce1f6f3
9 changed files with 61 additions and 291 deletions

View File

@ -1,18 +1,18 @@
From 0da9b9bdc6862bd2ebe58f64798f55dd1f83cf1b Mon Sep 17 00:00:00 2001
From b96f68dff9f1daf7a2aa1427b16299bafb1a068a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sun, 28 May 2017 04:19:06 +0200
Subject: ntdll: Split logic for MemoryBasicInformation into a separate
function.
---
dlls/ntdll/virtual.c | 64 ++++++++++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 27 deletions(-)
dlls/ntdll/virtual.c | 65 ++++++++++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 28 deletions(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index e826fa03c0c..9f9ed6bfe7e 100644
index 2ac0c4394f7..5e92cbb50ea 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2240,41 +2240,18 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
@@ -2439,40 +2439,16 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
return 1;
}
@ -20,7 +20,7 @@ index e826fa03c0c..9f9ed6bfe7e 100644
- case c: \
- FIXME("(process=%p,addr=%p) Unimplemented information class: " #c "\n", process, addr); \
- return STATUS_INVALID_INFO_CLASS
-
-/***********************************************************************
- * NtQueryVirtualMemory (NTDLL.@)
- * ZwQueryVirtualMemory (NTDLL.@)
@ -34,9 +34,8 @@ index e826fa03c0c..9f9ed6bfe7e 100644
+ SIZE_T len, SIZE_T *res_len )
{
struct file_view *view;
char *base, *alloc_base = 0;
struct list *ptr;
SIZE_T size = 0;
char *base, *alloc_base = 0, *alloc_end = working_set_limit;
struct wine_rb_entry *ptr;
- MEMORY_BASIC_INFORMATION *info = buffer;
sigset_t sigset;
@ -58,7 +57,7 @@ index e826fa03c0c..9f9ed6bfe7e 100644
if (process != NtCurrentProcess())
{
NTSTATUS status;
@@ -2390,6 +2367,39 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
@@ -2584,6 +2560,39 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
}
@ -99,5 +98,5 @@ index e826fa03c0c..9f9ed6bfe7e 100644
* NtLockVirtualMemory (NTDLL.@)
* ZwLockVirtualMemory (NTDLL.@)
--
2.12.2
2.14.1

View File

@ -1,4 +1,4 @@
From 60d3299d2e2924023542dcb7245ddfd2f901b319 Mon Sep 17 00:00:00 2001
From cf7fe40a5d1897b86b655b9bbe3686d77cd3bcd6 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sun, 28 May 2017 05:19:30 +0200
Subject: ntdll: Implement NtQueryVirtualMemory(MemorySectionName). (v3)
@ -10,13 +10,13 @@ Contains several improvements by Sebastian Lackner <sebastian@fds-team.de>.
2 files changed, 109 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 9f9ed6bfe7e..7d419de07b8 100644
index 5e92cbb50ea..4ee48ec93ab 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2241,6 +2241,33 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
@@ -2439,6 +2439,33 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
return 1;
}
+/* get the section mapping handle */
+static NTSTATUS get_section_mapping( HANDLE process, LPCVOID addr, HANDLE *mapping )
+{
@ -47,7 +47,7 @@ index 9f9ed6bfe7e..7d419de07b8 100644
/* get basic information about a memory block */
static NTSTATUS get_basic_memory_info( HANDLE process, LPCVOID addr,
MEMORY_BASIC_INFORMATION *info,
@@ -2367,6 +2394,84 @@ static NTSTATUS get_basic_memory_info( HANDLE process, LPCVOID addr,
@@ -2560,6 +2587,84 @@ static NTSTATUS get_basic_memory_info( HANDLE process, LPCVOID addr,
}
@ -132,7 +132,7 @@ index 9f9ed6bfe7e..7d419de07b8 100644
#define UNIMPLEMENTED_INFO_CLASS(c) \
case c: \
FIXME("(process=%p,addr=%p) Unimplemented information class: " #c "\n", process, addr); \
@@ -2388,8 +2493,10 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
@@ -2581,8 +2686,10 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HANDLE process, LPCVOID addr,
case MemoryBasicInformation:
return get_basic_memory_info( process, addr, buffer, len, res_len );
@ -172,5 +172,5 @@ index e35a7b694cb..56bf11a9a85 100644
}
--
2.12.2
2.14.1

View File

@ -1,4 +1,4 @@
From c0db9637afab090e25c807c011c632affdeb3097 Mon Sep 17 00:00:00 2001
From b808bca5ed050a801ae03493788e8c8ec8e3cd38 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 28 May 2017 05:44:38 +0200
Subject: ntdll: Allow to query section names from other processes. (v2)
@ -13,7 +13,7 @@ Subject: ntdll: Allow to query section names from other processes. (v2)
6 files changed, 69 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index c97b1e1f73f..52809112ce8 100644
index ac81c9be9c8..ecee4a193d9 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -161,6 +161,7 @@ extern NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_S
@ -49,11 +49,11 @@ index c02a12ab19a..290d7582f65 100644
result->type = call->type;
addr = wine_server_get_ptr( call->virtual_protect.addr );
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 82cb384a825..0e7df59281a 100644
index 4ee48ec93ab..613caec6642 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2329,7 +2329,7 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
@@ -2440,7 +2440,7 @@ static int get_free_mem_state_callback( void *start, size_t size, void *arg )
}
/* get the section mapping handle */
-static NTSTATUS get_section_mapping( HANDLE process, LPCVOID addr, HANDLE *mapping )
@ -61,7 +61,7 @@ index 82cb384a825..0e7df59281a 100644
{
struct file_view *view;
NTSTATUS status = STATUS_INVALID_ADDRESS;
@@ -2338,8 +2338,18 @@ static NTSTATUS get_section_mapping( HANDLE process, LPCVOID addr, HANDLE *mappi
@@ -2449,8 +2449,18 @@ static NTSTATUS get_section_mapping( HANDLE process, LPCVOID addr, HANDLE *mappi
if (process != NtCurrentProcess())
{
@ -82,7 +82,7 @@ index 82cb384a825..0e7df59281a 100644
}
base = ROUND_ADDR( addr, page_mask );
@@ -2495,7 +2505,7 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -2601,7 +2611,7 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
if (!addr || !info || !res_len) return STATUS_INVALID_PARAMETER;
@ -106,10 +106,11 @@ index 56bf11a9a85..23025eedab3 100644
SetLastError(0xdeadbeef);
ret = pGetMappedFileNameA(NULL, hMod, szMapPath, sizeof(szMapPath));
@@ -457,6 +461,20 @@ todo_wine
@@ -456,6 +460,20 @@ todo_wine
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);
+ SetLastError(0xdeadbeef);
+ ret = pGetMappedFileNameW(current_process, base, map_nameW, sizeof(map_nameW)/sizeof(map_nameW[0]));
+todo_wine {
+ ok(ret, "GetMappedFileNameW error %d\n", GetLastError());
@ -123,10 +124,9 @@ index 56bf11a9a85..23025eedab3 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);
SetLastError(0xdeadbeef);
ret = pGetMappedFileNameA(GetCurrentProcess(), base + 0x2000, map_name, sizeof(map_name));
todo_wine {
ok(ret, "GetMappedFileName error %d\n", GetLastError());
@@ -501,6 +519,7 @@ todo_wine
todo_wine
ok(GetLastError() == ERROR_FILE_INVALID, "expected ERROR_FILE_INVALID, got %d\n", GetLastError());
@ -147,32 +147,32 @@ index ca54b448ebb..504362702b8 100644
APC_VIRTUAL_PROTECT,
APC_VIRTUAL_FLUSH,
APC_VIRTUAL_LOCK,
@@ -506,6 +507,12 @@ typedef union
@@ -505,6 +506,12 @@ typedef union
client_ptr_t addr; /* requested address */
} virtual_query;
struct
{
+ {
+ enum apc_type type; /* APC_VIRTUAL_SECTION */
+ int __pad;
+ client_ptr_t addr; /* requested address */
+ } virtual_section;
+ struct
+ {
{
enum apc_type type; /* APC_VIRTUAL_PROTECT */
unsigned int prot; /* new protection flags */
client_ptr_t addr; /* requested address */
@@ -597,6 +604,12 @@ typedef union
@@ -596,6 +603,12 @@ typedef union
unsigned short alloc_type;/* resulting region allocation type */
} virtual_query;
struct
{
+ {
+ enum apc_type type; /* APC_VIRTUAL_SECTION */
+ unsigned int status; /* status returned by call */
+ obj_handle_t mapping; /* resulting mapping */
+ } virtual_section;
+ struct
+ {
{
enum apc_type type; /* APC_VIRTUAL_PROTECT */
unsigned int status; /* status returned by call */
client_ptr_t addr; /* resulting address */
diff --git a/server/thread.c b/server/thread.c
index 903420bed3f..d3cbcc298c3 100644
--- a/server/thread.c
@ -201,5 +201,5 @@ index 903420bed3f..d3cbcc298c3 100644
break;
case APC_MAP_VIEW:
--
2.13.1
2.14.1

View File

@ -1,4 +1,4 @@
From 68b5e9a9e9a4552c5bc04250d40d20fced0430a6 Mon Sep 17 00:00:00 2001
From 9a69e1e68004fb9b430151c629855ea7df2b0a8c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 28 May 2017 11:17:26 +0200
Subject: ntdll: Resolve drive symlinks before returning section name.
@ -36,7 +36,7 @@ index ecee4a193d9..e8586486a58 100644
extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) DECLSPEC_HIDDEN;
extern NTSTATUS virtual_create_builtin_view( void *base ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 005e9b150d3..deff0da4549 100644
index 613caec6642..467ce54eaaa 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -53,6 +53,7 @@
@ -44,7 +44,7 @@ index 005e9b150d3..deff0da4549 100644
#include "wine/server.h"
#include "wine/exception.h"
+#include "wine/unicode.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include "wine/debug.h"
#include "ntdll_misc.h"
@@ -152,6 +153,8 @@ static BYTE **pages_vprot;
@ -56,7 +56,7 @@ index 005e9b150d3..deff0da4549 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;
@@ -2595,12 +2598,15 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -2602,12 +2605,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 005e9b150d3..deff0da4549 100644
if (!addr || !info || !res_len) return STATUS_INVALID_PARAMETER;
@@ -2650,14 +2656,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
@@ -2657,14 +2663,34 @@ static NTSTATUS get_section_name( HANDLE process, LPCVOID addr,
}
found: