Author: akhaldi
Date: Mon Jun 15 18:38:57 2015
New Revision: 68151
URL:
http://svn.reactos.org/svn/reactos?rev=68151&view=rev
Log:
[NDK][NTDLL][PSAPI] Correct the the names of two LDR_DATA_TABLE_ENTRY fields. Brought to
you by Mike Nordell aka tamlin. CORE-9817
Modified:
trunk/reactos/dll/ntdll/ldr/ldrapi.c
trunk/reactos/dll/ntdll/ldr/ldrinit.c
trunk/reactos/dll/ntdll/ldr/ldrpe.c
trunk/reactos/dll/ntdll/ldr/ldrutils.c
trunk/reactos/dll/win32/psapi/psapi.c
trunk/reactos/include/ndk/ldrtypes.h
Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -476,7 +476,7 @@
while (NextEntry != ListHead)
{
/* Get the entry and NT Headers */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderLinks);
NtHeader = RtlImageNtHeader(LdrEntry->DllBase);
if (NtHeader)
{
@@ -1036,7 +1036,7 @@
while (InitEntry != InitListHead)
{
- InitModule = CONTAINING_RECORD(InitEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderModuleList);
+ InitModule = CONTAINING_RECORD(InitEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderLinks);
/* Increase the index */
ModulePtr->InitOrderIndex++;
@@ -1384,7 +1384,7 @@
/* Get the entry */
LdrEntry = CONTAINING_RECORD(NextEntry,
LDR_DATA_TABLE_ENTRY,
- InInitializationOrderModuleList);
+ InInitializationOrderLinks);
NextEntry = NextEntry->Blink;
/* Remove flag */
@@ -1408,8 +1408,8 @@
/* Unlink it */
CurrentEntry = LdrEntry;
- RemoveEntryList(&CurrentEntry->InInitializationOrderModuleList);
- RemoveEntryList(&CurrentEntry->InMemoryOrderModuleList);
+ RemoveEntryList(&CurrentEntry->InInitializationOrderLinks);
+ RemoveEntryList(&CurrentEntry->InMemoryOrderLinks);
RemoveEntryList(&CurrentEntry->HashLinks);
/* If there's more then one active unload */
@@ -1417,7 +1417,7 @@
{
/* Flush the cached DLL handle and clear the list */
LdrpLoadedDllHandleCache = NULL;
- CurrentEntry->InMemoryOrderModuleList.Flink = NULL;
+ CurrentEntry->InMemoryOrderLinks.Flink = NULL;
}
/* Add the entry on the unload list */
@@ -1443,7 +1443,7 @@
/* Set the entry and clear it from the list */
CurrentEntry = LdrEntry;
LdrpLoadedDllHandleCache = NULL;
- CurrentEntry->InMemoryOrderModuleList.Flink = NULL;
+ CurrentEntry->InMemoryOrderLinks.Flink = NULL;
/* Move it from the global to the local list */
RemoveEntryList(&CurrentEntry->HashLinks);
Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -526,7 +526,7 @@
while (NextEntry != ListHead)
{
/* Get the current entry */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderLinks);
/* Make sure it's not ourselves */
if (Peb->ImageBaseAddress != LdrEntry->DllBase)
@@ -674,7 +674,7 @@
while (NextEntry != ListHead)
{
/* Get the Data Entry */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderLinks);
/* Check if we have a Root Entry */
if (LdrRootEntry)
@@ -840,7 +840,7 @@
while (NextEntry != ListHead)
{
/* Get the Data Entrry */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderLinks);
/* FIXME: Verify NX Compat */
// LdrpCheckNXCompatibility()
@@ -932,7 +932,7 @@
while (NextEntry != ListHead)
{
/* Get the current entry */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderLinks);
NextEntry = NextEntry->Blink;
/* Make sure it's not ourselves */
@@ -1037,7 +1037,7 @@
while (NextEntry != ListHead)
{
/* Get the current entry */
- LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderModuleList);
+ LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY,
InInitializationOrderLinks);
NextEntry = NextEntry->Blink;
/* Make sure it's not ourselves */
@@ -1927,7 +1927,7 @@
/* Link the Init Order List */
InsertHeadList(&Peb->Ldr->InInitializationOrderModuleList,
- &LdrpNtDllDataTableEntry->InInitializationOrderModuleList);
+ &LdrpNtDllDataTableEntry->InInitializationOrderLinks);
/* Initialize Wine's active context implementation for the current process */
actctx_init();
Modified: trunk/reactos/dll/ntdll/ldr/ldrpe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrpe.c?rev=…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrpe.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrpe.c [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -318,7 +318,7 @@
{
/* Add it to our list */
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &DllLdrEntry->InInitializationOrderModuleList);
+ &DllLdrEntry->InInitializationOrderLinks);
}
/* Check if the Bound Entry is now invalid */
@@ -381,7 +381,7 @@
{
/* Add it to our list */
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
-
&ForwarderLdrEntry->InInitializationOrderModuleList);
+ &ForwarderLdrEntry->InInitializationOrderLinks);
}
}
@@ -590,7 +590,7 @@
{
/* Add the DLL to our list */
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &DllLdrEntry->InInitializationOrderModuleList);
+ &DllLdrEntry->InInitializationOrderLinks);
}
/* Now snap the IAT Entry */
@@ -850,7 +850,7 @@
{
/* Add it to the in-init-order list in case of failure */
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &(*DataTableEntry)->InInitializationOrderModuleList);
+ &(*DataTableEntry)->InInitializationOrderLinks);
}
return Status;
Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrutils.c?r…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -1273,7 +1273,7 @@
{
/* Remove the DLL from the lists */
RemoveEntryList(&LdrEntry->InLoadOrderLinks);
- RemoveEntryList(&LdrEntry->InMemoryOrderModuleList);
+ RemoveEntryList(&LdrEntry->InMemoryOrderLinks);
RemoveEntryList(&LdrEntry->HashLinks);
/* Remove the LDR Entry */
@@ -1341,7 +1341,7 @@
CandidateEnd = CandidateBase + CandidateEntry->SizeOfImage;
/* Make sure this entry isn't unloading */
- if (!CandidateEntry->InMemoryOrderModuleList.Flink) continue;
+ if (!CandidateEntry->InMemoryOrderLinks.Flink) continue;
/* Check if our regions are colliding */
if ((ImageBase >= CandidateBase && ImageBase <= CandidateEnd)
||
@@ -1465,7 +1465,7 @@
{
/* Remove it from the lists */
RemoveEntryList(&LdrEntry->InLoadOrderLinks);
- RemoveEntryList(&LdrEntry->InMemoryOrderModuleList);
+ RemoveEntryList(&LdrEntry->InMemoryOrderLinks);
RemoveEntryList(&LdrEntry->HashLinks);
/* Unmap it, clear the entry */
@@ -1576,7 +1576,7 @@
/* Insert into other lists */
InsertTailList(&PebData->InLoadOrderModuleList,
&LdrEntry->InLoadOrderLinks);
- InsertTailList(&PebData->InMemoryOrderModuleList,
&LdrEntry->InMemoryOrderModuleList);
+ InsertTailList(&PebData->InMemoryOrderModuleList,
&LdrEntry->InMemoryOrderLinks);
}
VOID
@@ -1630,7 +1630,7 @@
InLoadOrderLinks);
/* Make sure it's not unloading and check for a match */
- if ((Current->InMemoryOrderModuleList.Flink) && (Base ==
Current->DllBase))
+ if ((Current->InMemoryOrderLinks.Flink) && (Base ==
Current->DllBase))
{
/* Save in cache */
LdrpLoadedDllHandleCache = Current;
@@ -2097,7 +2097,7 @@
ListEntry = ListEntry->Flink;
/* Check if it's being unloaded */
- if (!CurEntry->InMemoryOrderModuleList.Flink) continue;
+ if (!CurEntry->InMemoryOrderLinks.Flink) continue;
/* Check if name matches */
if (RtlEqualUnicodeString(&FullDllName,
@@ -2195,7 +2195,7 @@
ListEntry = ListEntry->Flink;
/* Check if it's in the process of being unloaded */
- if (!CurEntry->InMemoryOrderModuleList.Flink) continue;
+ if (!CurEntry->InMemoryOrderLinks.Flink) continue;
/* The header is untrusted, use SEH */
_SEH2_TRY
@@ -2362,7 +2362,7 @@
Entry = NtCurrentPeb()->Ldr->InInitializationOrderModuleList.Blink;
LdrEntry = CONTAINING_RECORD(Entry,
LDR_DATA_TABLE_ENTRY,
- InInitializationOrderModuleList);
+ InInitializationOrderLinks);
/* Make sure we didn't process it yet*/
if (!(LdrEntry->Flags & LDRP_ENTRY_PROCESSED))
@@ -2536,7 +2536,7 @@
/* Clear entrypoint, and insert into list */
LdrEntry->EntryPoint = NULL;
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &LdrEntry->InInitializationOrderModuleList);
+ &LdrEntry->InInitializationOrderLinks);
/* Cancel the load */
LdrpClearLoadInProgress();
@@ -2563,7 +2563,7 @@
/* Insert it into the list */
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &LdrEntry->InInitializationOrderModuleList);
+ &LdrEntry->InInitializationOrderLinks);
/* If we have to run the entrypoint, make sure the DB is ready */
if (CallInit && LdrpLdrDatabaseIsSetup)
@@ -2653,7 +2653,7 @@
/* Get the loader entry */
LdrEntry = CONTAINING_RECORD(Entry,
LDR_DATA_TABLE_ENTRY,
- InInitializationOrderModuleList);
+ InInitializationOrderLinks);
/* Clear load in progress flag */
LdrEntry->Flags &= ~LDRP_LOAD_IN_PROGRESS;
Modified: trunk/reactos/dll/win32/psapi/psapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/psapi/psapi.c?re…
==============================================================================
--- trunk/reactos/dll/win32/psapi/psapi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/psapi/psapi.c [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -187,7 +187,7 @@
{
/* Load module data */
if (!ReadProcessMemory(hProcess,
- CONTAINING_RECORD(ListEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderModuleList),
+ CONTAINING_RECORD(ListEntry, LDR_DATA_TABLE_ENTRY,
InMemoryOrderLinks),
Module,
sizeof(*Module),
NULL))
@@ -208,7 +208,7 @@
}
/* Get to next listed module */
- ListEntry = Module->InMemoryOrderModuleList.Flink;
+ ListEntry = Module->InMemoryOrderLinks.Flink;
}
SetLastError(ERROR_INVALID_HANDLE);
Modified: trunk/reactos/include/ndk/ldrtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ldrtypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/ldrtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/ldrtypes.h [iso-8859-1] Mon Jun 15 18:38:57 2015
@@ -128,11 +128,14 @@
//
// Loader Data Table Entry
//
+// NOTE: The field 'InMemoryOrderLinks' MUST have that name.
+// It's hard-coded into WinDbg for PEB dumping!
+//
typedef struct _LDR_DATA_TABLE_ENTRY
{
LIST_ENTRY InLoadOrderLinks;
- LIST_ENTRY InMemoryOrderModuleList;
- LIST_ENTRY InInitializationOrderModuleList;
+ LIST_ENTRY InMemoryOrderLinks;
+ LIST_ENTRY InInitializationOrderLinks;
PVOID DllBase;
PVOID EntryPoint;
ULONG SizeOfImage;