From 833db5481f1f86745979d3ceda580c2d8fdd24a8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 16 Aug 2011 20:08:34 +0000 Subject: * dlfcn.cc (dlopen): Reimplement RTLD_NODELETE for Windows 2000 using internal datastructures. Explain the code. * ntdll.h (struct _LDR_DATA_TABLE_ENTRY): Define. (struct _PEB_LDR_DATA): Define. (struct _PEB): Change PVOID LoaderData to PPEB_LDR_DATA Ldr. * fhandler_process.cc (format_process_maps): Call NtQueryVirtualMemory with valid return length pointer. Explain why. --- winsup/cygwin/fhandler_process.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler_process.cc') diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index eb36d9d56..36270d1ba 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -960,12 +960,16 @@ format_process_maps (void *data, char *&destbuf) // if a new allocation, figure out what kind it is if (newbase && !last_pass && mb.State != MEM_FREE) { + /* If the return length pointer is missing, NtQueryVirtualMemory + returns with STATUS_ACCESS_VIOLATION on Windows 2000. */ + ULONG ret_len = 0; + st.st_dev = 0; st.st_ino = 0; if ((mb.Type & (MEM_MAPPED | MEM_IMAGE)) - && NT_SUCCESS (NtQueryVirtualMemory (proc, cur.abase, + && NT_SUCCESS (status = NtQueryVirtualMemory (proc, cur.abase, MemorySectionName, - msi, 65536, NULL))) + msi, 65536, &ret_len))) { PWCHAR dosname = drive_maps.fixup_if_match (msi->SectionFileName.Buffer); -- cgit v1.2.3