* 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.
This commit is contained in:
Corinna Vinschen
2011-08-16 20:08:34 +00:00
parent 9d3b795b47
commit 833db5481f
4 changed files with 67 additions and 9 deletions

View File

@ -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);