[PATCH 5/5] Cygwin: Use MEMORY_WORKING_SET_EX_INFORMATION in dumper

Takashi Yano takashi.yano@nifty.ne.jp
Tue Jul 28 02:20:56 GMT 2020


Hi Jon,

On Sat, 18 Jul 2020 16:00:28 +0100
Jon Turney wrote:
> Use the (undocumented) MEMORY_WORKING_SET_EX_INFORMATION in dumper to
> determine if a MEM_IMAGE region is unsharable, and hence has been
> modified.
> ---
>  winsup/doc/utils.xml     |  8 ++---
>  winsup/utils/Makefile.in |  2 +-
>  winsup/utils/dumper.cc   | 63 ++++++++++++++++++++++++++++++++++++++--
>  3 files changed, 65 insertions(+), 8 deletions(-)

After this commit, 32bit build failes with:

/usr/lib/gcc/i686-pc-cygwin/9.3.0/../../../../i686-pc-cygwin/bin/ld: dumper.o:/home/yano/newlib-cygwin/i686-pc-cygwin/winsup/utils/../../.././winsup/utils/dumper.cc:295: undefined reference to `NtQueryVirtualMemory'

This seems to be solved with the patch:

diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc
index 3af138b9e..36dbf9dbb 100644
--- a/winsup/utils/dumper.cc
+++ b/winsup/utils/dumper.cc
@@ -272,7 +272,7 @@ typedef enum _MEMORY_INFORMATION_CLASS
 } MEMORY_INFORMATION_CLASS;

 extern "C"
-NTSTATUS
+NTSTATUS NTAPI
 NtQueryVirtualMemory(HANDLE ProcessHandle,
                     LPVOID BaseAddress,
                     MEMORY_INFORMATION_CLASS MemoryInformationClass,

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin-patches mailing list