[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f98700a: Fix restoring from pdumper file on MS-Windows 9X
From: |
Eli Zaretskii |
Subject: |
master f98700a: Fix restoring from pdumper file on MS-Windows 9X |
Date: |
Sat, 11 Sep 2021 02:57:33 -0400 (EDT) |
branch: master
commit f98700af80b37a43669955ec399ac300c3979384
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix restoring from pdumper file on MS-Windows 9X
* src/pdumper.c (dump_map_file_w32): Use PAGE_WRITECOPY flag when
calling CreateFileMapping for DUMP_MEMORY_ACCESS_READWRITE access,
as that is required by Windows 9X. (Bug#50453)
---
src/pdumper.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/pdumper.c b/src/pdumper.c
index 7730ea3..2291fce 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4537,15 +4537,28 @@ dump_map_file_w32 (void *base, int fd, off_t offset,
size_t size,
uint32_t offset_low = (uint32_t) (full_offset & 0xffffffff);
int error;
+ DWORD protect;
DWORD map_access;
file = (HANDLE) _get_osfhandle (fd);
if (file == INVALID_HANDLE_VALUE)
goto out;
+ switch (protection)
+ {
+ case DUMP_MEMORY_ACCESS_READWRITE:
+ protect = PAGE_WRITECOPY; /* for Windows 9X */
+ break;
+ default:
+ case DUMP_MEMORY_ACCESS_NONE:
+ case DUMP_MEMORY_ACCESS_READ:
+ protect = PAGE_READONLY;
+ break;
+ }
+
section = CreateFileMapping (file,
/*lpAttributes=*/NULL,
- PAGE_READONLY,
+ protect,
/*dwMaximumSizeHigh=*/0,
/*dwMaximumSizeLow=*/0,
/*lpName=*/NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f98700a: Fix restoring from pdumper file on MS-Windows 9X,
Eli Zaretskii <=