diff options
| author | Eli Zaretskii | 2021-09-11 09:56:27 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-09-11 09:56:27 +0300 |
| commit | f98700af80b37a43669955ec399ac300c3979384 (patch) | |
| tree | 417fb6bf2750dc90e83c94055628b11ed2eae24c /src | |
| parent | d37dcfa30ff20aa2d5b0d6c2e43ef5930e72e375 (diff) | |
| download | emacs-f98700af80b37a43669955ec399ac300c3979384.tar.gz emacs-f98700af80b37a43669955ec399ac300c3979384.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/pdumper.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index 7730ea3d061..2291fced5d7 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, | |||
| 4537 | uint32_t offset_low = (uint32_t) (full_offset & 0xffffffff); | 4537 | uint32_t offset_low = (uint32_t) (full_offset & 0xffffffff); |
| 4538 | 4538 | ||
| 4539 | int error; | 4539 | int error; |
| 4540 | DWORD protect; | ||
| 4540 | DWORD map_access; | 4541 | DWORD map_access; |
| 4541 | 4542 | ||
| 4542 | file = (HANDLE) _get_osfhandle (fd); | 4543 | file = (HANDLE) _get_osfhandle (fd); |
| 4543 | if (file == INVALID_HANDLE_VALUE) | 4544 | if (file == INVALID_HANDLE_VALUE) |
| 4544 | goto out; | 4545 | goto out; |
| 4545 | 4546 | ||
| 4547 | switch (protection) | ||
| 4548 | { | ||
| 4549 | case DUMP_MEMORY_ACCESS_READWRITE: | ||
| 4550 | protect = PAGE_WRITECOPY; /* for Windows 9X */ | ||
| 4551 | break; | ||
| 4552 | default: | ||
| 4553 | case DUMP_MEMORY_ACCESS_NONE: | ||
| 4554 | case DUMP_MEMORY_ACCESS_READ: | ||
| 4555 | protect = PAGE_READONLY; | ||
| 4556 | break; | ||
| 4557 | } | ||
| 4558 | |||
| 4546 | section = CreateFileMapping (file, | 4559 | section = CreateFileMapping (file, |
| 4547 | /*lpAttributes=*/NULL, | 4560 | /*lpAttributes=*/NULL, |
| 4548 | PAGE_READONLY, | 4561 | protect, |
| 4549 | /*dwMaximumSizeHigh=*/0, | 4562 | /*dwMaximumSizeHigh=*/0, |
| 4550 | /*dwMaximumSizeLow=*/0, | 4563 | /*dwMaximumSizeLow=*/0, |
| 4551 | /*lpName=*/NULL); | 4564 | /*lpName=*/NULL); |