Use LDR_DATA_TABLE_ENTRY instead of LDR_MODULE. the former is the actual structure...
authorAlex Ionescu <aionescu@gmail.com>
Tue, 21 Jun 2005 04:10:45 +0000 (04:10 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Tue, 21 Jun 2005 04:10:45 +0000 (04:10 +0000)
svn path=/trunk/; revision=16203

18 files changed:
reactos/apps/utils/pice/module/symbols.c
reactos/apps/utils/sdkparse/test.h
reactos/include/epsapi.h
reactos/include/napi/types.h
reactos/include/ndk/ldrtypes.h
reactos/include/ntdll/ldr.h
reactos/lib/epsapi/enum/modules.c
reactos/lib/kernel32/misc/ldr.c
reactos/lib/ntdll/inc/ntdllp.h
reactos/lib/ntdll/ldr/startup.c
reactos/lib/ntdll/ldr/utils.c
reactos/lib/ntdll/rtl/dbgbuffer.c
reactos/lib/psapi/psapi.c
reactos/ntoskrnl/ex/dbgctrl.c
reactos/ntoskrnl/include/internal/kd.h
reactos/ntoskrnl/kdbg/kdb_symbols.c
reactos/ntoskrnl/ke/i386/usertrap.c
reactos/subsys/smss/smss.h

index 8713976..9c2358e 100644 (file)
@@ -167,7 +167,7 @@ BOOLEAN ListUserModules( PPEB peb )
 {
        PLIST_ENTRY UserModuleListHead;
        PLIST_ENTRY Entry;
-       PLDR_MODULE Module;
+       PLDR_DATA_TABLE_ENTRY Module;
        PPEB_LDR_DATA Ldr;
 
        ENTER_FUNC();
@@ -179,7 +179,7 @@ BOOLEAN ListUserModules( PPEB peb )
                Entry = UserModuleListHead->Flink;
                while (Entry != UserModuleListHead)
                {
-                       Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+                       Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
                        //DbgPrint("Module: %x, BaseAddress: %x\n", Module, Module->BaseAddress);
 
                        DPRINT((0,"FullName: %S, BaseName: %S, Length: %ld, EntryPoint: %x, BaseAddress: %x\n", Module->FullDllName.Buffer,
index 29f0cfa..189570b 100644 (file)
@@ -89,7 +89,7 @@ typedef NTSTATUS NTAPI (*PSYSMOD_ENUM_ROUTINE)
 typedef NTSTATUS NTAPI (*PPROCMOD_ENUM_ROUTINE)
 (
  IN HANDLE ProcessHandle,
- IN PLDR_MODULE CurrentModule,
+ IN PLDR_DATA_TABLE_ENTRY CurrentModule,
  IN OUT PVOID CallbackContext
 );
 
index 9505fd3..29bb9dd 100644 (file)
 #ifndef __EPSAPI_H_INCLUDED__
 #define __EPSAPI_H_INCLUDED__
 
-/* INCLUDES */
-#include <ntdll/ldr.h> /* FIXME: USE LDR_DATA_TABLE_ENTRY */
-
-/* OBJECTS */
+/* Remove soon */
+#include <ntdll/ldr.h>
 
 /* TYPES */
 typedef NTSTATUS (NTAPI *PPROC_ENUM_ROUTINE)(IN PSYSTEM_PROCESS_INFORMATION CurrentProcess,
@@ -41,7 +39,7 @@ typedef NTSTATUS (NTAPI *PSYSMOD_ENUM_ROUTINE)(IN PSYSTEM_MODULE_INFORMATION_ENT
                                                IN OUT PVOID CallbackContext);
 
 typedef NTSTATUS (NTAPI *PPROCMOD_ENUM_ROUTINE)(IN HANDLE ProcessHandle,
-                                                IN PLDR_MODULE CurrentModule,
+                                                IN PLDR_DATA_TABLE_ENTRY CurrentModule,
                                                 IN OUT PVOID CallbackContext);
 
 /* CONSTANTS */
index 655a348..5a8ee50 100644 (file)
@@ -6,7 +6,7 @@
 /*
  * General type for status information
  */
-
+#ifndef __USE_W32API
 typedef enum _NT_PRODUCT_TYPE
 {
    NtProductWinNt = 1,
index 6bad3f6..726dd1f 100644 (file)
@@ -43,6 +43,7 @@ typedef struct _PEB_LDR_DATA
     PVOID               EntryInProgress;
 } PEB_LDR_DATA, *PPEB_LDR_DATA;
 
+#if 0
 typedef struct _LDR_DATA_TABLE_ENTRY
 {
     LIST_ENTRY InLoadOrderModuleList;
@@ -63,6 +64,7 @@ typedef struct _LDR_DATA_TABLE_ENTRY
     PVOID LoadedImports;
     PVOID EntryPointActivationContext;
 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
+#endif
 
 typedef struct _LDR_RESOURCE_INFO 
 {
index 2bd7b51..371350d 100644 (file)
@@ -54,29 +54,32 @@ LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTION
 #define PROCESS_ATTACH_CALLED  0x00080000
 #define IMAGE_NOT_AT_BASE      0x00200000
 
-typedef struct _LDR_MODULE
+typedef struct _LDR_DATA_TABLE_ENTRY
 {
-   LIST_ENTRY     InLoadOrderModuleList;
-   LIST_ENTRY     InMemoryOrderModuleList;             /* not used */
-   LIST_ENTRY     InInitializationOrderModuleList;     /* not used */
-   PVOID          BaseAddress;
-   ULONG          EntryPoint;
-   ULONG          ResidentSize;
-   UNICODE_STRING FullDllName;
-   UNICODE_STRING BaseDllName;
-   ULONG          Flags;
-   SHORT          LoadCount;
-   SHORT          TlsIndex;
-   HANDLE         SectionHandle;
-   ULONG          CheckSum;
-   ULONG          TimeDateStamp;
+    LIST_ENTRY InLoadOrderModuleList;
+    LIST_ENTRY InMemoryOrderModuleList;
+    LIST_ENTRY InInitializationOrderModuleList;
+    PVOID DllBase;
+    PVOID EntryPoint;
+    ULONG SizeOfImage;
+    UNICODE_STRING FullDllName;
+    UNICODE_STRING BaseDllName;
+    ULONG Flags;
+    SHORT LoadCount; /* FIXME: HACK!!! FIX ASAP */
+    SHORT TlsIndex;  /* FIXME: HACK!!! FIX ASAP */
+    LIST_ENTRY HashLinks;
+    PVOID SectionPointer;
+    ULONG CheckSum;
+    ULONG TimeDateStamp;
+    PVOID LoadedImports;
+    PVOID EntryPointActivationContext;
 #if defined(DBG) || defined(KDBG)
-   PROSSYM_INFO   RosSymInfo;
+    PROSSYM_INFO   RosSymInfo; /* FIXME: THIS _REALLY_ NEEDS TO GO (TLS?)!!! */
 #endif /* KDBG */
-} LDR_MODULE, *PLDR_MODULE;
+} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
 
 typedef struct _LDR_SYMBOL_INFO {
-  PLDR_MODULE ModuleObject;
+  PLDR_DATA_TABLE_ENTRY ModuleObject;
   ULONG_PTR ImageBase;
   PVOID SymbolsBuffer;
   ULONG SymbolsBufferLength;
@@ -90,7 +93,7 @@ typedef struct _LDR_SYMBOL_INFO {
 #if defined(KDBG) || defined(DBG)
 
 VOID
-LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule);
+LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule);
 
 #endif
 
@@ -99,7 +102,7 @@ LdrpGetResidentSize(PIMAGE_NT_HEADERS NTHeaders);
 
 PEPFUNC LdrPEStartup (PVOID  ImageBase,
                      HANDLE SectionHandle,
-                     PLDR_MODULE* Module,
+                     PLDR_DATA_TABLE_ENTRY* Module,
                      PWSTR FullDosName);
 NTSTATUS LdrMapSections(HANDLE ProcessHandle,
                        PVOID ImageBase,
@@ -120,7 +123,7 @@ LdrGetDllHandle(IN PWCHAR Path OPTIONAL,
 
 NTSTATUS STDCALL
 LdrFindEntryForAddress(IN PVOID Address,
-                      OUT PLDR_MODULE *Module);
+                      OUT PLDR_DATA_TABLE_ENTRY *Module);
 
 NTSTATUS STDCALL
 LdrGetProcedureAddress(IN PVOID BaseAddress,
index 3b0d201..3c30825 100644 (file)
@@ -49,7 +49,7 @@ PsaEnumerateProcessModules(IN HANDLE ProcessHandle,
  
       while(Current != ListHead)
       {
-        PLDR_MODULE LoaderModule = CONTAINING_RECORD(Current, LDR_MODULE, InLoadOrderModuleList);
+        PLDR_DATA_TABLE_ENTRY LoaderModule = CONTAINING_RECORD(Current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
    
         /* return the current module to the callback */
         Status = Callback(ProcessHandle, LoaderModule, CallbackContext);
@@ -73,7 +73,7 @@ PsaEnumerateProcessModules(IN HANDLE ProcessHandle,
   {
     PROCESS_BASIC_INFORMATION BasicInformation;
     PPEB_LDR_DATA LoaderData;
-    LDR_MODULE LoaderModule;
+    LDR_DATA_TABLE_ENTRY LoaderModule;
     PLIST_ENTRY ListHead, Current;
  
     /* query the process basic information (includes the PEB address) */
@@ -116,7 +116,7 @@ PsaEnumerateProcessModules(IN HANDLE ProcessHandle,
     {
       /* read the current module */
       Status = NtReadVirtualMemory(ProcessHandle,
-                                   CONTAINING_RECORD(Current, LDR_MODULE, InLoadOrderModuleList),
+                                   CONTAINING_RECORD(Current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList),
                                    &LoaderModule,
                                    sizeof(LoaderModule),
                                    NULL);
index 1ca6ce8..b95ea29 100644 (file)
@@ -268,7 +268,7 @@ GetModuleFileNameA (
        ANSI_STRING FileName;
        PLIST_ENTRY ModuleListHead;
        PLIST_ENTRY Entry;
-       PLDR_MODULE Module;
+       PLDR_DATA_TABLE_ENTRY Module;
        PPEB Peb;
        ULONG Length = 0;
 
@@ -283,8 +283,8 @@ GetModuleFileNameA (
 
        while (Entry != ModuleListHead)
        {
-               Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
-               if (Module->BaseAddress == (PVOID)hModule)
+               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+               if (Module->DllBase == (PVOID)hModule)
                {
                        if (nSize * sizeof(WCHAR) < Module->FullDllName.Length)
                        {
@@ -336,7 +336,7 @@ GetModuleFileNameW (
        UNICODE_STRING FileName;
        PLIST_ENTRY ModuleListHead;
        PLIST_ENTRY Entry;
-       PLDR_MODULE Module;
+       PLDR_DATA_TABLE_ENTRY Module;
        PPEB Peb;
        ULONG Length = 0;
 
@@ -350,9 +350,9 @@ GetModuleFileNameW (
        Entry = ModuleListHead->Flink;
        while (Entry != ModuleListHead)
        {
-               Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-               if (Module->BaseAddress == (PVOID)hModule)
+               if (Module->DllBase == (PVOID)hModule)
                {
                        if (nSize * sizeof(WCHAR) < Module->FullDllName.Length)
                        {
index ff56fcc..566b1d5 100644 (file)
@@ -21,7 +21,7 @@ ULONG
 LdrpGetResidentSize(PIMAGE_NT_HEADERS NTHeaders);
 PEPFUNC LdrPEStartup (PVOID  ImageBase,
                      HANDLE SectionHandle,
-                     PLDR_MODULE* Module,
+                     PLDR_DATA_TABLE_ENTRY* Module,
                      PWSTR FullDosName);
 #if 0
 typedef BOOL 
@@ -36,7 +36,7 @@ RtlpInitDeferedCriticalSection(
 );
 #if defined(KDBG) || defined(DBG)
 VOID
-LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule);
+LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule);
 #endif
 extern HANDLE WindowsApiPort;
 
index 493be6b..104ebe5 100644 (file)
@@ -26,7 +26,7 @@ extern unsigned int _image_base__;
 static RTL_CRITICAL_SECTION PebLock;
 static RTL_CRITICAL_SECTION LoaderLock;
 static RTL_BITMAP TlsBitMap;
-PLDR_MODULE ExeModule;
+PLDR_DATA_TABLE_ENTRY ExeModule;
 
 NTSTATUS LdrpAttachThread (VOID);
 
@@ -225,7 +225,7 @@ __true_LdrInitializeThunk (ULONG Unknown1,
    PIMAGE_DOS_HEADER PEDosHeader;
    PVOID ImageBase;
    PPEB Peb;
-   PLDR_MODULE NtModule;  // ntdll
+   PLDR_DATA_TABLE_ENTRY NtModule;  // ntdll
    NLSTABLEINFO NlsTable;
    WCHAR FullNtDllPath[MAX_PATH];
    SYSTEM_BASIC_INFORMATION SystemInformation;
@@ -350,17 +350,17 @@ __true_LdrInitializeThunk (ULONG Unknown1,
        wcscat (FullNtDllPath, L"\\system32\\ntdll.dll");
 
        /* add entry for ntdll */
-       NtModule = (PLDR_MODULE)RtlAllocateHeap (Peb->ProcessHeap,
+       NtModule = (PLDR_DATA_TABLE_ENTRY)RtlAllocateHeap (Peb->ProcessHeap,
                                                 0,
-                                                sizeof(LDR_MODULE));
+                                                sizeof(LDR_DATA_TABLE_ENTRY));
        if (NtModule == NULL)
          {
            DPRINT1("Failed to create loader module entry (NTDLL)\n");
            ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL);
         }
-       memset(NtModule, 0, sizeof(LDR_MODULE));
+       memset(NtModule, 0, sizeof(LDR_DATA_TABLE_ENTRY));
 
-       NtModule->BaseAddress = (PVOID)&_image_base__;
+       NtModule->DllBase = (PVOID)&_image_base__;
        NtModule->EntryPoint = 0; /* no entry point */
        RtlCreateUnicodeString (&NtModule->FullDllName,
                                FullNtDllPath);
@@ -370,11 +370,11 @@ __true_LdrInitializeThunk (ULONG Unknown1,
 
        NtModule->LoadCount = -1; /* don't unload */
        NtModule->TlsIndex = -1;
-       NtModule->SectionHandle = NULL;
+       NtModule->SectionPointer = NULL;
        NtModule->CheckSum = 0;
 
-       NTHeaders = RtlImageNtHeader (NtModule->BaseAddress);
-       NtModule->ResidentSize = LdrpGetResidentSize(NTHeaders);
+       NTHeaders = RtlImageNtHeader (NtModule->DllBase);
+       NtModule->SizeOfImage = LdrpGetResidentSize(NTHeaders);
        NtModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
 
        InsertTailList(&Peb->Ldr->InLoadOrderModuleList,
@@ -389,15 +389,15 @@ __true_LdrInitializeThunk (ULONG Unknown1,
 #endif /* DBG || KDBG */
 
        /* add entry for executable (becomes first list entry) */
-       ExeModule = (PLDR_MODULE)RtlAllocateHeap (Peb->ProcessHeap,
+       ExeModule = (PLDR_DATA_TABLE_ENTRY)RtlAllocateHeap (Peb->ProcessHeap,
                                                  0,
-                                                 sizeof(LDR_MODULE));
+                                                 sizeof(LDR_DATA_TABLE_ENTRY));
        if (ExeModule == NULL)
          {
            DPRINT1("Failed to create loader module infomation\n");
            ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL);
          }
-       ExeModule->BaseAddress = Peb->ImageBaseAddress;
+       ExeModule->DllBase = Peb->ImageBaseAddress;
 
        if ((Peb->ProcessParameters == NULL) ||
            (Peb->ProcessParameters->ImagePathName.Length == 0))
@@ -418,11 +418,11 @@ __true_LdrInitializeThunk (ULONG Unknown1,
        ExeModule->Flags = ENTRY_PROCESSED;
        ExeModule->LoadCount = -1; /* don't unload */
        ExeModule->TlsIndex = -1;
-       ExeModule->SectionHandle = NULL;
+       ExeModule->SectionPointer = NULL;
        ExeModule->CheckSum = 0;
 
-       NTHeaders = RtlImageNtHeader (ExeModule->BaseAddress);
-       ExeModule->ResidentSize = LdrpGetResidentSize(NTHeaders);
+       NTHeaders = RtlImageNtHeader (ExeModule->DllBase);
+       ExeModule->SizeOfImage = LdrpGetResidentSize(NTHeaders);
        ExeModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
 
        InsertHeadList(&Peb->Ldr->InLoadOrderModuleList,
@@ -437,7 +437,7 @@ __true_LdrInitializeThunk (ULONG Unknown1,
 #endif /* DBG || KDBG */
 
        EntryPoint = LdrPEStartup((PVOID)ImageBase, NULL, NULL, NULL);
-       ExeModule->EntryPoint = (ULONG)EntryPoint;
+       ExeModule->EntryPoint = EntryPoint;
 
        /* all required dlls are loaded now */
        Peb->Ldr->Initialized = TRUE;
index ceba478..0a725b8 100644 (file)
@@ -42,7 +42,7 @@ typedef struct _TLS_DATA
    DWORD TlsDataSize;
    DWORD TlsZeroSize;
    PIMAGE_TLS_CALLBACK TlsAddressOfCallBacks;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
 } TLS_DATA, *PTLS_DATA;
 
 static PTLS_DATA LdrpTlsArray = NULL;
@@ -50,18 +50,18 @@ static ULONG LdrpTlsCount = 0;
 static ULONG LdrpTlsSize = 0;
 static HANDLE LdrpKnownDllsDirHandle = NULL;
 static UNICODE_STRING LdrpKnownDllPath = {0, 0, NULL};
-static PLDR_MODULE LdrpLastModule = NULL;
-extern PLDR_MODULE ExeModule;
+static PLDR_DATA_TABLE_ENTRY LdrpLastModule = NULL;
+extern PLDR_DATA_TABLE_ENTRY ExeModule;
 
 /* PROTOTYPES ****************************************************************/
 
-static NTSTATUS LdrFindEntryForName(PUNICODE_STRING Name, PLDR_MODULE *Module, BOOLEAN Ref);
+static NTSTATUS LdrFindEntryForName(PUNICODE_STRING Name, PLDR_DATA_TABLE_ENTRY *Module, BOOLEAN Ref);
 static PVOID LdrFixupForward(PCHAR ForwardName);
 static PVOID LdrGetExportByName(PVOID BaseAddress, PUCHAR SymbolName, USHORT Hint);
 static NTSTATUS LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
                                IN ULONG LoadFlags,
                                IN PUNICODE_STRING Name,
-                               OUT PLDR_MODULE *Module,
+                               OUT PLDR_DATA_TABLE_ENTRY *Module,
                                OUT PVOID *BaseAddress OPTIONAL);
 static NTSTATUS LdrpAttachProcess(VOID);
 static VOID LdrpDetachProcess(BOOLEAN UnloadAll);
@@ -71,7 +71,7 @@ static VOID LdrpDetachProcess(BOOLEAN UnloadAll);
 #if defined(DBG) || defined(KDBG)
 
 VOID
-LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule)
+LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule)
 {
   NtSystemDebugControl(
     DebugDbgLoadSymbols,
@@ -96,7 +96,7 @@ LdrMappedAsDataFile(PVOID *BaseAddress)
    return FALSE;
 }
 
-static inline LONG LdrpDecrementLoadCount(PLDR_MODULE Module, BOOLEAN Locked)
+static inline LONG LdrpDecrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked)
 {
    LONG LoadCount;
    if (!Locked)
@@ -115,7 +115,7 @@ static inline LONG LdrpDecrementLoadCount(PLDR_MODULE Module, BOOLEAN Locked)
    return LoadCount;
 }
 
-static inline LONG LdrpIncrementLoadCount(PLDR_MODULE Module, BOOLEAN Locked)
+static inline LONG LdrpIncrementLoadCount(PLDR_DATA_TABLE_ENTRY Module, BOOLEAN Locked)
 {
    LONG LoadCount;
    if (!Locked)
@@ -134,7 +134,7 @@ static inline LONG LdrpIncrementLoadCount(PLDR_MODULE Module, BOOLEAN Locked)
    return LoadCount;
 }
 
-static inline VOID LdrpAcquireTlsSlot(PLDR_MODULE Module, ULONG Size, BOOLEAN Locked)
+static inline VOID LdrpAcquireTlsSlot(PLDR_DATA_TABLE_ENTRY Module, ULONG Size, BOOLEAN Locked)
 {
    if (!Locked)
      {
@@ -149,7 +149,7 @@ static inline VOID LdrpAcquireTlsSlot(PLDR_MODULE Module, ULONG Size, BOOLEAN Lo
      }
 }
 
-static inline VOID LdrpTlsCallback(PLDR_MODULE Module, ULONG dwReason)
+static inline VOID LdrpTlsCallback(PLDR_DATA_TABLE_ENTRY Module, ULONG dwReason)
 {
    PIMAGE_TLS_CALLBACK TlsCallback;
    if (Module->TlsIndex >= 0 && Module->LoadCount == -1)
@@ -161,14 +161,14 @@ static inline VOID LdrpTlsCallback(PLDR_MODULE Module, ULONG dwReason)
              {
                TRACE_LDR("%wZ - Calling tls callback at %x\n",
                          &Module->BaseDllName, TlsCallback);
-               TlsCallback(Module->BaseAddress, dwReason, NULL);
+               TlsCallback(Module->DllBase, dwReason, NULL);
                TlsCallback++;
              }
          }
      }
 }
 
-static BOOLEAN LdrpCallDllEntry(PLDR_MODULE Module, DWORD dwReason, PVOID lpReserved)
+static BOOLEAN LdrpCallDllEntry(PLDR_DATA_TABLE_ENTRY Module, DWORD dwReason, PVOID lpReserved)
 {
    if (!(Module->Flags & IMAGE_DLL) ||
        Module->EntryPoint == 0)
@@ -176,7 +176,7 @@ static BOOLEAN LdrpCallDllEntry(PLDR_MODULE Module, DWORD dwReason, PVOID lpRese
        return TRUE;
      }
    LdrpTlsCallback(Module, dwReason);
-   return  ((PDLLMAIN_FUNC)Module->EntryPoint)(Module->BaseAddress, dwReason, lpReserved);
+   return  ((PDLLMAIN_FUNC)Module->EntryPoint)(Module->DllBase, dwReason, lpReserved);
 }
 
 static NTSTATUS
@@ -234,7 +234,7 @@ LdrpInitializeTlsForProccess(VOID)
 {
    PLIST_ENTRY ModuleListHead;
    PLIST_ENTRY Entry;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
    PIMAGE_TLS_DIRECTORY TlsDirectory;
    PTLS_DATA TlsData;
 
@@ -255,12 +255,12 @@ LdrpInitializeTlsForProccess(VOID)
        Entry = ModuleListHead->Flink;
        while (Entry != ModuleListHead)
          {
-           Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+           Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
            if (Module->LoadCount == -1 &&
                Module->TlsIndex >= 0)
              {
                TlsDirectory = (PIMAGE_TLS_DIRECTORY)
-                                 RtlImageDirectoryEntryToData(Module->BaseAddress,
+                                 RtlImageDirectoryEntryToData(Module->DllBase,
                                                               TRUE,
                                                               IMAGE_DIRECTORY_ENTRY_TLS,
                                                               NULL);
@@ -458,21 +458,21 @@ LdrAdjustDllName (PUNICODE_STRING FullDllName,
    RtlCreateUnicodeString(FullDllName, Buffer);
 }
 
-PLDR_MODULE
+PLDR_DATA_TABLE_ENTRY
 LdrAddModuleEntry(PVOID ImageBase,
                   PIMAGE_NT_HEADERS NTHeaders,
                   PWSTR FullDosName)
 {
-  PLDR_MODULE Module;
+  PLDR_DATA_TABLE_ENTRY Module;
 
-  Module = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof (LDR_MODULE));
+  Module = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof (LDR_DATA_TABLE_ENTRY));
   ASSERT(Module);
-  memset(Module, 0, sizeof(LDR_MODULE));
-  Module->BaseAddress = (PVOID)ImageBase;
-  Module->EntryPoint = NTHeaders->OptionalHeader.AddressOfEntryPoint;
+  memset(Module, 0, sizeof(LDR_DATA_TABLE_ENTRY));
+  Module->DllBase = (PVOID)ImageBase;
+  Module->EntryPoint = (PVOID)NTHeaders->OptionalHeader.AddressOfEntryPoint;
   if (Module->EntryPoint != 0)
-    Module->EntryPoint += (ULONG)Module->BaseAddress;
-  Module->ResidentSize = LdrpGetResidentSize(NTHeaders);
+    Module->EntryPoint += (ULONG)Module->DllBase;
+  Module->SizeOfImage = LdrpGetResidentSize(NTHeaders);
   if (NtCurrentPeb()->Ldr->Initialized == TRUE)
     {
       /* loading while app is running */
@@ -728,7 +728,7 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
             OUT PVOID *BaseAddress OPTIONAL)
 {
   NTSTATUS              Status;
-  PLDR_MODULE           Module;
+  PLDR_DATA_TABLE_ENTRY           Module;
 
   TRACE_LDR("LdrLoadDll, loading %wZ%s%S\n",
             Name,
@@ -751,7 +751,7 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
       RtlLeaveCriticalSection(NtCurrentPeb()->LoaderLock);
       if (NT_SUCCESS(Status))
         {
-          *BaseAddress = Module->BaseAddress;
+          *BaseAddress = Module->DllBase;
         }
    }
   return Status;
@@ -776,11 +776,11 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
  */
 NTSTATUS STDCALL
 LdrFindEntryForAddress(PVOID Address,
-                       PLDR_MODULE *Module)
+                       PLDR_DATA_TABLE_ENTRY *Module)
 {
   PLIST_ENTRY ModuleListHead;
   PLIST_ENTRY Entry;
-  PLDR_MODULE ModulePtr;
+  PLDR_DATA_TABLE_ENTRY ModulePtr;
 
   DPRINT("LdrFindEntryForAddress(Address %p)\n", Address);
 
@@ -798,12 +798,12 @@ LdrFindEntryForAddress(PVOID Address,
 
   while (Entry != ModuleListHead)
     {
-      ModulePtr = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-      DPRINT("Scanning %wZ at %p\n", &ModulePtr->BaseDllName, ModulePtr->BaseAddress);
+      DPRINT("Scanning %wZ at %p\n", &ModulePtr->BaseDllName, ModulePtr->DllBase);
 
-      if ((Address >= ModulePtr->BaseAddress) &&
-          (Address <= (ModulePtr->BaseAddress + ModulePtr->ResidentSize)))
+      if ((Address >= ModulePtr->DllBase) &&
+          (Address <= (ModulePtr->DllBase + ModulePtr->SizeOfImage)))
         {
           *Module = ModulePtr;
           RtlLeaveCriticalSection(NtCurrentPeb()->LoaderLock);
@@ -837,12 +837,12 @@ LdrFindEntryForAddress(PVOID Address,
  */
 static NTSTATUS
 LdrFindEntryForName(PUNICODE_STRING Name,
-                    PLDR_MODULE *Module,
+                    PLDR_DATA_TABLE_ENTRY *Module,
                     BOOLEAN Ref)
 {
   PLIST_ENTRY ModuleListHead;
   PLIST_ENTRY Entry;
-  PLDR_MODULE ModulePtr;
+  PLDR_DATA_TABLE_ENTRY ModulePtr;
   BOOLEAN ContainsPath;
   UNICODE_STRING AdjustedName;
   unsigned i;
@@ -897,7 +897,7 @@ LdrFindEntryForName(PUNICODE_STRING Name,
     }
   while (Entry != ModuleListHead)
     {
-      ModulePtr = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
       DPRINT("Scanning %wZ %wZ\n", &ModulePtr->BaseDllName, &AdjustedName);
 
@@ -947,7 +947,7 @@ LdrFixupForward(PCHAR ForwardName)
    UNICODE_STRING DllName;
    NTSTATUS Status;
    PCHAR p;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
    PVOID BaseAddress;
 
    strcpy(NameBuffer, ForwardName);
@@ -982,9 +982,9 @@ LdrFixupForward(PCHAR ForwardName)
             return NULL;
           }
 
-        DPRINT("BaseAddress: %p\n", Module->BaseAddress);
+        DPRINT("BaseAddress: %p\n", Module->DllBase);
 
-        return LdrGetExportByName(Module->BaseAddress, (PUCHAR)(p+1), -1);
+        return LdrGetExportByName(Module->DllBase, (PUCHAR)(p+1), -1);
      }
 
    return NULL;
@@ -1341,7 +1341,7 @@ LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders,
 static NTSTATUS
 LdrpGetOrLoadModule(PWCHAR SerachPath,
                     PCHAR Name,
-                    PLDR_MODULE* Module,
+                    PLDR_DATA_TABLE_ENTRY* Module,
                     BOOLEAN Load)
 {
    UNICODE_STRING DllName;
@@ -1373,8 +1373,8 @@ LdrpGetOrLoadModule(PWCHAR SerachPath,
 }
 
 static NTSTATUS
-LdrpProcessImportDirectoryEntry(PLDR_MODULE Module,
-                                PLDR_MODULE ImportedModule,
+LdrpProcessImportDirectoryEntry(PLDR_DATA_TABLE_ENTRY Module,
+                                PLDR_DATA_TABLE_ENTRY ImportedModule,
                                 PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory)
 {
    NTSTATUS Status;
@@ -1391,16 +1391,16 @@ LdrpProcessImportDirectoryEntry(PLDR_MODULE Module,
      }
 
    /* Get the import address list. */
-   ImportAddressList = (PVOID *)(Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
+   ImportAddressList = (PVOID *)(Module->DllBase + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
 
    /* Get the list of functions to import. */
    if (ImportModuleDirectory->OriginalFirstThunk != 0)
      {
-       FunctionNameList = (PULONG) (Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
+       FunctionNameList = (PULONG) (Module->DllBase + (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
      }
    else
      {
-       FunctionNameList = (PULONG)(Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
+       FunctionNameList = (PULONG)(Module->DllBase + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
      }
 
    /* Get the size of IAT. */
@@ -1430,7 +1430,7 @@ LdrpProcessImportDirectoryEntry(PLDR_MODULE Module,
        if ((*FunctionNameList) & 0x80000000)
          {
            Ordinal = (*FunctionNameList) & 0x7fffffff;
-           *ImportAddressList = LdrGetExportByOrdinal(ImportedModule->BaseAddress, Ordinal);
+           *ImportAddressList = LdrGetExportByOrdinal(ImportedModule->DllBase, Ordinal);
            if ((*ImportAddressList) == NULL)
              {
                DPRINT1("Failed to import #%ld from %wZ\n", Ordinal, &ImportedModule->FullDllName);
@@ -1440,8 +1440,8 @@ LdrpProcessImportDirectoryEntry(PLDR_MODULE Module,
        else
          {
            IMAGE_IMPORT_BY_NAME *pe_name;
-           pe_name = RVA(Module->BaseAddress, *FunctionNameList);
-           *ImportAddressList = LdrGetExportByName(ImportedModule->BaseAddress, pe_name->Name, pe_name->Hint);
+           pe_name = RVA(Module->DllBase, *FunctionNameList);
+           *ImportAddressList = LdrGetExportByName(ImportedModule->DllBase, pe_name->Name, pe_name->Hint);
            if ((*ImportAddressList) == NULL)
              {
                DPRINT1("Failed to import %s from %wZ\n", pe_name->Name, &ImportedModule->FullDllName);
@@ -1469,8 +1469,8 @@ LdrpProcessImportDirectoryEntry(PLDR_MODULE Module,
 
 static NTSTATUS
 LdrpProcessImportDirectory(
-   PLDR_MODULE Module,
-   PLDR_MODULE ImportedModule,
+   PLDR_DATA_TABLE_ENTRY Module,
+   PLDR_DATA_TABLE_ENTRY ImportedModule,
    PCHAR ImportedName)
 {
    NTSTATUS Status;
@@ -1482,7 +1482,7 @@ LdrpProcessImportDirectory(
 
 
    ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR)
-                             RtlImageDirectoryEntryToData(Module->BaseAddress,
+                             RtlImageDirectoryEntryToData(Module->DllBase,
                                                           TRUE,
                                                           IMAGE_DIRECTORY_ENTRY_IMPORT,
                                                           NULL);
@@ -1493,7 +1493,7 @@ LdrpProcessImportDirectory(
 
    while (ImportModuleDirectory->Name)
      {
-       Name = (PCHAR)Module->BaseAddress + ImportModuleDirectory->Name;
+       Name = (PCHAR)Module->DllBase + ImportModuleDirectory->Name;
        if (0 == _stricmp(Name, ImportedName))
          {
            Status = LdrpProcessImportDirectoryEntry(Module,
@@ -1513,8 +1513,8 @@ LdrpProcessImportDirectory(
 
 
 static NTSTATUS
-LdrpAdjustImportDirectory(PLDR_MODULE Module,
-                          PLDR_MODULE ImportedModule,
+LdrpAdjustImportDirectory(PLDR_DATA_TABLE_ENTRY Module,
+                          PLDR_DATA_TABLE_ENTRY ImportedModule,
                           PCHAR ImportedName)
 {
    PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory;
@@ -1534,7 +1534,7 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
           Module, &Module->BaseDllName, ImportedModule, &ImportedModule->BaseDllName, ImportedName);
 
    ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR)
-                              RtlImageDirectoryEntryToData(Module->BaseAddress,
+                              RtlImageDirectoryEntryToData(Module->DllBase,
                                                            TRUE,
                                                            IMAGE_DIRECTORY_ENTRY_IMPORT,
                                                            NULL);
@@ -1545,21 +1545,21 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
 
    while (ImportModuleDirectory->Name)
      {
-       Name = (PCHAR)Module->BaseAddress + ImportModuleDirectory->Name;
+       Name = (PCHAR)Module->DllBase + ImportModuleDirectory->Name;
        if (0 == _stricmp(Name, (PCHAR)ImportedName))
          {
 
            /* Get the import address list. */
-           ImportAddressList = (PVOID *)(Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
+           ImportAddressList = (PVOID *)(Module->DllBase + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
 
            /* Get the list of functions to import. */
            if (ImportModuleDirectory->OriginalFirstThunk != 0)
              {
-               FunctionNameList = (PULONG) (Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
+               FunctionNameList = (PULONG) (Module->DllBase + (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
              }
            else
              {
-               FunctionNameList = (PULONG)(Module->BaseAddress + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
+               FunctionNameList = (PULONG)(Module->DllBase + (ULONG_PTR)ImportModuleDirectory->FirstThunk);
              }
 
            /* Get the size of IAT. */
@@ -1583,10 +1583,10 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
                return(Status);
              }
 
-           NTHeaders = RtlImageNtHeader (ImportedModule->BaseAddress);
+           NTHeaders = RtlImageNtHeader (ImportedModule->DllBase);
            Start = (PVOID)NTHeaders->OptionalHeader.ImageBase;
-           End = Start + ImportedModule->ResidentSize;
-           Offset = ImportedModule->BaseAddress - Start;
+           End = Start + ImportedModule->SizeOfImage;
+           Offset = ImportedModule->DllBase - Start;
 
            /* Walk through function list and fixup addresses. */
            while (*FunctionNameList != 0L)
@@ -1636,7 +1636,7 @@ LdrpAdjustImportDirectory(PLDR_MODULE Module,
  */
 static NTSTATUS
 LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
-                IN PLDR_MODULE Module)
+                IN PLDR_DATA_TABLE_ENTRY Module)
 {
    PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory;
    PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectoryCurrent;
@@ -1645,14 +1645,14 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
    PIMAGE_TLS_DIRECTORY TlsDirectory;
    ULONG TlsSize = 0;
    NTSTATUS Status;
-   PLDR_MODULE ImportedModule;
+   PLDR_DATA_TABLE_ENTRY ImportedModule;
    PCHAR ImportedName;
 
    DPRINT("LdrFixupImports(SearchPath %x, Module %x)\n", SearchPath, Module);
 
    /* Check for tls data */
    TlsDirectory = (PIMAGE_TLS_DIRECTORY)
-                     RtlImageDirectoryEntryToData(Module->BaseAddress,
+                     RtlImageDirectoryEntryToData(Module->DllBase,
                                                   TRUE,
                                                   IMAGE_DIRECTORY_ENTRY_TLS,
                                                   NULL);
@@ -1673,13 +1673,13 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
     * Process each import module.
     */
    ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR)
-                              RtlImageDirectoryEntryToData(Module->BaseAddress,
+                              RtlImageDirectoryEntryToData(Module->DllBase,
                                                            TRUE,
                                                            IMAGE_DIRECTORY_ENTRY_IMPORT,
                                                            NULL);
 
    BoundImportDescriptor = (PIMAGE_BOUND_IMPORT_DESCRIPTOR)
-                              RtlImageDirectoryEntryToData(Module->BaseAddress,
+                              RtlImageDirectoryEntryToData(Module->DllBase,
                                                            TRUE,
                                                            IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT,
                                                            NULL);
@@ -1737,7 +1737,7 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
                  {
                    PIMAGE_BOUND_FORWARDER_REF BoundForwarderRef;
                    ULONG i;
-                   PLDR_MODULE ForwarderModule;
+                   PLDR_DATA_TABLE_ENTRY ForwarderModule;
                    PCHAR ForwarderName;
 
                    BoundForwarderRef = (PIMAGE_BOUND_FORWARDER_REF)(BoundImportDescriptorCurrent + 1);
@@ -1821,7 +1821,7 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
        ImportModuleDirectoryCurrent = ImportModuleDirectory;
        while (ImportModuleDirectoryCurrent->Name)
          {
-           ImportedName = (PCHAR)Module->BaseAddress + ImportModuleDirectoryCurrent->Name;
+           ImportedName = (PCHAR)Module->DllBase + ImportModuleDirectoryCurrent->Name;
            TRACE_LDR("%wZ imports functions from %s\n", &Module->BaseDllName, ImportedName);
 
            Status = LdrpGetOrLoadModule(SearchPath, ImportedName, &ImportedModule, TRUE);
@@ -1886,14 +1886,14 @@ LdrFixupImports(IN PWSTR SearchPath OPTIONAL,
  */
 PEPFUNC LdrPEStartup (PVOID  ImageBase,
                       HANDLE SectionHandle,
-                      PLDR_MODULE* Module,
+                      PLDR_DATA_TABLE_ENTRY* Module,
                       PWSTR FullDosName)
 {
    NTSTATUS             Status;
    PEPFUNC              EntryPoint = NULL;
    PIMAGE_DOS_HEADER    DosHeader;
    PIMAGE_NT_HEADERS    NTHeaders;
-   PLDR_MODULE tmpModule;
+   PLDR_DATA_TABLE_ENTRY tmpModule;
 
    DPRINT("LdrPEStartup(ImageBase %x SectionHandle %x)\n",
            ImageBase, (ULONG)SectionHandle);
@@ -1924,7 +1924,7 @@ PEPFUNC LdrPEStartup (PVOID  ImageBase,
    if (Module != NULL)
      {
        *Module = LdrAddModuleEntry(ImageBase, NTHeaders, FullDosName);
-       (*Module)->SectionHandle = SectionHandle;
+       (*Module)->SectionPointer = SectionHandle;
      }
    else
      {
@@ -1989,13 +1989,13 @@ static NTSTATUS
 LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
                IN ULONG LoadFlags,
                IN PUNICODE_STRING Name,
-               PLDR_MODULE *Module,
+               PLDR_DATA_TABLE_ENTRY *Module,
                PVOID *BaseAddress OPTIONAL)
 {
     UNICODE_STRING AdjustedName;
     UNICODE_STRING FullDosName;
     NTSTATUS Status;
-    PLDR_MODULE tmpModule;
+    PLDR_DATA_TABLE_ENTRY tmpModule;
     HANDLE SectionHandle;
     ULONG ViewSize;
     PVOID ImageBase;
@@ -2019,7 +2019,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
         RtlFreeUnicodeString(&AdjustedName);
         if (NULL != BaseAddress)
           {
-            *BaseAddress = (*Module)->BaseAddress;
+            *BaseAddress = (*Module)->DllBase;
           }
       }
     else
@@ -2104,7 +2104,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
               }
           }
         *Module = LdrAddModuleEntry(ImageBase, NtHeaders, FullDosName.Buffer);
-        (*Module)->SectionHandle = SectionHandle;
+        (*Module)->SectionPointer = SectionHandle;
         if (ImageBase != (PVOID) NtHeaders->OptionalHeader.ImageBase)
           {
             (*Module)->Flags |= IMAGE_NOT_AT_BASE;
@@ -2132,14 +2132,14 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
 }
 
 static NTSTATUS
-LdrpUnloadModule(PLDR_MODULE Module,
+LdrpUnloadModule(PLDR_DATA_TABLE_ENTRY Module,
                  BOOLEAN Unload)
 {
    PIMAGE_IMPORT_DESCRIPTOR ImportModuleDirectory;
    PIMAGE_BOUND_IMPORT_DESCRIPTOR BoundImportDescriptor;
    PIMAGE_BOUND_IMPORT_DESCRIPTOR BoundImportDescriptorCurrent;
    PCHAR ImportedName;
-   PLDR_MODULE ImportedModule;
+   PLDR_DATA_TABLE_ENTRY ImportedModule;
    NTSTATUS Status;
    LONG LoadCount;
 
@@ -2160,7 +2160,7 @@ LdrpUnloadModule(PLDR_MODULE Module,
    else if (LoadCount == 1)
      {
        BoundImportDescriptor = (PIMAGE_BOUND_IMPORT_DESCRIPTOR)
-                                 RtlImageDirectoryEntryToData(Module->BaseAddress,
+                                 RtlImageDirectoryEntryToData(Module->DllBase,
                                                               TRUE,
                                                               IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT,
                                                               NULL);
@@ -2194,7 +2194,7 @@ LdrpUnloadModule(PLDR_MODULE Module,
        else
          {
            ImportModuleDirectory = (PIMAGE_IMPORT_DESCRIPTOR)
-                                      RtlImageDirectoryEntryToData(Module->BaseAddress,
+                                      RtlImageDirectoryEntryToData(Module->DllBase,
                                                                    TRUE,
                                                                    IMAGE_DIRECTORY_ENTRY_IMPORT,
                                                                    NULL);
@@ -2203,7 +2203,7 @@ LdrpUnloadModule(PLDR_MODULE Module,
                /* dereferencing all imported modules, use the import descriptor */
                while (ImportModuleDirectory->Name)
                  {
-                   ImportedName = (PCHAR)Module->BaseAddress + ImportModuleDirectory->Name;
+                   ImportedName = (PCHAR)Module->DllBase + ImportModuleDirectory->Name;
                    TRACE_LDR("%wZ trys to unload %s\n", &Module->BaseDllName, ImportedName);
                    Status = LdrpGetOrLoadModule(NULL, ImportedName, &ImportedModule, FALSE);
                    if (!NT_SUCCESS(Status))
@@ -2242,7 +2242,7 @@ LdrpUnloadModule(PLDR_MODULE Module,
 NTSTATUS STDCALL
 LdrUnloadDll (IN PVOID BaseAddress)
 {
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
    NTSTATUS Status;
 
    if (BaseAddress == NULL)
@@ -2273,7 +2273,7 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
 {
     PLIST_ENTRY ModuleListHead;
     PLIST_ENTRY Entry;
-    PLDR_MODULE Module;
+    PLDR_DATA_TABLE_ENTRY Module;
     NTSTATUS Status;
 
     DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %x)\n", BaseAddress);
@@ -2284,11 +2284,11 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
     Entry = ModuleListHead->Flink;
     while (Entry != ModuleListHead)
       {
-        Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-        DPRINT("BaseDllName %wZ BaseAddress %x\n", &Module->BaseDllName, Module->BaseAddress);
+        DPRINT("BaseDllName %wZ BaseAddress %x\n", &Module->BaseDllName, Module->DllBase);
 
-        if (Module->BaseAddress == BaseAddress)
+        if (Module->DllBase == BaseAddress)
           {
             if (Module->TlsIndex == -1)
               {
@@ -2312,7 +2312,7 @@ LdrGetDllHandle(IN PWCHAR Path OPTIONAL,
                 IN PUNICODE_STRING DllName,
                 OUT PVOID* BaseAddress)
 {
-    PLDR_MODULE Module;
+    PLDR_DATA_TABLE_ENTRY Module;
     NTSTATUS Status;
 
     TRACE_LDR("LdrGetDllHandle, searching for %wZ from %S\n", DllName, Path ? Path : L"");
@@ -2320,7 +2320,7 @@ LdrGetDllHandle(IN PWCHAR Path OPTIONAL,
     /* NULL is the current executable */
     if (DllName == NULL)
       {
-        *BaseAddress = ExeModule->BaseAddress;
+        *BaseAddress = ExeModule->DllBase;
         DPRINT("BaseAddress %x\n", *BaseAddress);
         return STATUS_SUCCESS;
       }
@@ -2328,7 +2328,7 @@ LdrGetDllHandle(IN PWCHAR Path OPTIONAL,
     Status = LdrFindEntryForName(DllName, &Module, FALSE);
     if (NT_SUCCESS(Status))
       {
-        *BaseAddress = Module->BaseAddress;
+        *BaseAddress = Module->DllBase;
         return STATUS_SUCCESS;
       }
 
@@ -2406,7 +2406,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
 {
    PLIST_ENTRY ModuleListHead;
    PLIST_ENTRY Entry;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
    static ULONG CallingCount = 0;
 
    DPRINT("LdrpDetachProcess() called for %wZ\n",
@@ -2418,7 +2418,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
    Entry = ModuleListHead->Blink;
    while (Entry != ModuleListHead)
      {
-       Module = CONTAINING_RECORD(Entry, LDR_MODULE, InInitializationOrderModuleList);
+       Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
        if (((UnloadAll && Module->LoadCount <= 0) || Module->LoadCount == 0) &&
            Module->Flags & ENTRY_PROCESSED &&
            !(Module->Flags & UNLOAD_IN_PROGRESS))
@@ -2451,7 +2451,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
        Entry = ModuleListHead->Blink;
        while (Entry != ModuleListHead)
          {
-           Module = CONTAINING_RECORD(Entry, LDR_MODULE, InInitializationOrderModuleList);
+           Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
            Entry = Entry->Blink;
            if (Module->Flags & UNLOAD_IN_PROGRESS &&
                ((UnloadAll && Module->LoadCount >= 0) || Module->LoadCount == 0))
@@ -2460,8 +2460,8 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
                RemoveEntryList (&Module->InLoadOrderModuleList);
                RemoveEntryList (&Module->InInitializationOrderModuleList);
 
-               NtUnmapViewOfSection (NtCurrentProcess (), Module->BaseAddress);
-               NtClose (Module->SectionHandle);
+               NtUnmapViewOfSection (NtCurrentProcess (), Module->DllBase);
+               NtClose (Module->SectionPointer);
 
                TRACE_LDR("%wZ unloaded\n", &Module->BaseDllName);
 
@@ -2500,7 +2500,7 @@ LdrpAttachProcess(VOID)
 {
    PLIST_ENTRY ModuleListHead;
    PLIST_ENTRY Entry;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
    BOOLEAN Result;
    NTSTATUS Status = STATUS_SUCCESS;
 
@@ -2511,7 +2511,7 @@ LdrpAttachProcess(VOID)
    Entry = ModuleListHead->Flink;
    while (Entry != ModuleListHead)
      {
-       Module = CONTAINING_RECORD(Entry, LDR_MODULE, InInitializationOrderModuleList);
+       Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
        if (!(Module->Flags & (LOAD_IN_PROGRESS|UNLOAD_IN_PROGRESS|ENTRY_PROCESSED)))
          {
            Module->Flags |= LOAD_IN_PROGRESS;
@@ -2560,7 +2560,7 @@ LdrpAttachThread (VOID)
 {
   PLIST_ENTRY ModuleListHead;
   PLIST_ENTRY Entry;
-  PLDR_MODULE Module;
+  PLDR_DATA_TABLE_ENTRY Module;
   NTSTATUS Status;
 
   DPRINT("LdrpAttachThread() called for %wZ\n",
@@ -2577,7 +2577,7 @@ LdrpAttachThread (VOID)
 
       while (Entry != ModuleListHead)
         {
-          Module = CONTAINING_RECORD(Entry, LDR_MODULE, InInitializationOrderModuleList);
+          Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
           if (Module->Flags & PROCESS_ATTACH_CALLED &&
               !(Module->Flags & DONT_CALL_FOR_THREAD) &&
               !(Module->Flags & UNLOAD_IN_PROGRESS))
@@ -2590,7 +2590,7 @@ LdrpAttachThread (VOID)
         }
 
       Entry = NtCurrentPeb()->Ldr->InLoadOrderModuleList.Flink;
-      Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
       LdrpTlsCallback(Module, DLL_THREAD_ATTACH);
     }
 
@@ -2610,7 +2610,7 @@ LdrShutdownThread (VOID)
 {
    PLIST_ENTRY ModuleListHead;
    PLIST_ENTRY Entry;
-   PLDR_MODULE Module;
+   PLDR_DATA_TABLE_ENTRY Module;
 
    DPRINT("LdrShutdownThread() called for %wZ\n",
           &ExeModule->BaseDllName);
@@ -2621,7 +2621,7 @@ LdrShutdownThread (VOID)
    Entry = ModuleListHead->Blink;
    while (Entry != ModuleListHead)
      {
-       Module = CONTAINING_RECORD(Entry, LDR_MODULE, InInitializationOrderModuleList);
+       Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList);
 
        if (Module->Flags & PROCESS_ATTACH_CALLED &&
            !(Module->Flags & DONT_CALL_FOR_THREAD) &&
@@ -2670,7 +2670,7 @@ LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTION
 {
   PLIST_ENTRY ModuleListHead;
   PLIST_ENTRY Entry;
-  PLDR_MODULE Module;
+  PLDR_DATA_TABLE_ENTRY Module;
   PDEBUG_MODULE_INFORMATION ModulePtr = NULL;
   NTSTATUS Status = STATUS_SUCCESS;
   ULONG UsedSize = sizeof(ULONG);
@@ -2697,7 +2697,7 @@ LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTION
 
   while (Entry != ModuleListHead)
     {
-      Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
+      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
       DPRINT("  Module %wZ\n",
              &Module->FullDllName);
@@ -2709,8 +2709,8 @@ LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTION
       else if (ModuleInformation != NULL)
         {
           ModulePtr->Reserved[0] = ModulePtr->Reserved[1] = 0;      // FIXME: ??
-          ModulePtr->Base = Module->BaseAddress;
-          ModulePtr->Size = Module->ResidentSize;
+          ModulePtr->Base = Module->DllBase;
+          ModulePtr->Size = Module->SizeOfImage;
           ModulePtr->Flags = Module->Flags;
           ModulePtr->Index = 0;      // FIXME: index ??
           ModulePtr->Unknown = 0;      // FIXME: ??
index d1b92a0..a1bb4aa 100644 (file)
@@ -101,7 +101,7 @@ RtlpQueryRemoteProcessModules(HANDLE ProcessHandle,
 {
   PROCESS_BASIC_INFORMATION pbiInfo;
   PPEB_LDR_DATA ppldLdrData;
-  LDR_MODULE lmModule;
+  LDR_DATA_TABLE_ENTRY lmModule;
   PLIST_ENTRY pleListHead;
   PLIST_ENTRY pleCurEntry;
 
@@ -178,9 +178,9 @@ RtlpQueryRemoteProcessModules(HANDLE ProcessHandle,
 
    /* read the current module */
    Status = NtReadVirtualMemory ( ProcessHandle,
-            CONTAINING_RECORD(pleCurEntry, LDR_MODULE, InLoadOrderModuleList),
+            CONTAINING_RECORD(pleCurEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList),
                                  &lmModule,
-                                 sizeof(LDR_MODULE),
+                                 sizeof(LDR_DATA_TABLE_ENTRY),
                                  NULL );
 
    /* Import module name from remote Process user space. */
@@ -210,8 +210,8 @@ RtlpQueryRemoteProcessModules(HANDLE ProcessHandle,
       else if (ModuleInformation != NULL)
         {
           ModulePtr->Reserved[0] = ModulePtr->Reserved[1] = 0;      // FIXME: ??
-          ModulePtr->Base        = lmModule.BaseAddress;
-          ModulePtr->Size        = lmModule.ResidentSize;
+          ModulePtr->Base        = lmModule.DllBase;
+          ModulePtr->Size        = lmModule.SizeOfImage;
           ModulePtr->Flags       = lmModule.Flags;
           ModulePtr->Index       = 0;      // FIXME:  ??
           ModulePtr->Unknown     = 0;      // FIXME: ??
index 6e7b34f..5b1f26a 100644 (file)
@@ -101,7 +101,7 @@ typedef struct _ENUM_PROCESS_MODULES_CONTEXT
 
 NTSTATUS STDCALL
 EnumProcessModulesCallback(IN HANDLE ProcessHandle,
-                           IN PLDR_MODULE CurrentModule,
+                           IN PLDR_DATA_TABLE_ENTRY CurrentModule,
                            IN OUT PVOID CallbackContext)
 {
   PENUM_PROCESS_MODULES_CONTEXT Context = (PENUM_PROCESS_MODULES_CONTEXT)CallbackContext;
@@ -113,7 +113,7 @@ EnumProcessModulesCallback(IN HANDLE ProcessHandle,
   }
 
   /* return current process */
-  *Context->lphModule = CurrentModule->BaseAddress;
+  *Context->lphModule = CurrentModule->DllBase;
 
   /* go to next array slot */
   Context->lphModule++;
@@ -386,13 +386,13 @@ typedef struct _GET_MODULE_INFORMATION_CONTEXT
 
 NTSTATUS STDCALL
 GetModuleInformationCallback(IN HANDLE ProcessHandle,
-                             IN PLDR_MODULE CurrentModule,
+                             IN PLDR_DATA_TABLE_ENTRY CurrentModule,
                              IN OUT PVOID CallbackContext)
 {
   PGET_MODULE_INFORMATION_CONTEXT Context = (PGET_MODULE_INFORMATION_CONTEXT)CallbackContext;
 
   /* found the module we were looking for */
-  if(CurrentModule->BaseAddress == Context->hModule)
+  if(CurrentModule->DllBase == Context->hModule)
   {
     /* we want the module name */
     if(Context->Flags.bWantName)
@@ -514,17 +514,17 @@ exitWithStatus:
       ULONG nSize = Context->nBufSize;
 
       /* base address */
-      if(nSize >= sizeof(CurrentModule->BaseAddress))
+      if(nSize >= sizeof(CurrentModule->DllBase))
       {
-        Context->lpmodinfo->lpBaseOfDll = CurrentModule->BaseAddress;
-        nSize -= sizeof(CurrentModule->BaseAddress);
+        Context->lpmodinfo->lpBaseOfDll = CurrentModule->DllBase;
+        nSize -= sizeof(CurrentModule->DllBase);
       }
 
       /* image size */
-      if(nSize >= sizeof(CurrentModule->ResidentSize))
+      if(nSize >= sizeof(CurrentModule->SizeOfImage))
       {
-        Context->lpmodinfo->SizeOfImage = CurrentModule->ResidentSize;
-        nSize -= sizeof(CurrentModule->ResidentSize);
+        Context->lpmodinfo->SizeOfImage = CurrentModule->SizeOfImage;
+        nSize -= sizeof(CurrentModule->SizeOfImage);
       }
 
       /* entry point */
index c29e65d..fdf6d49 100644 (file)
@@ -35,7 +35,7 @@ NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode,
             break;
 
         case DebugDbgLoadSymbols:
-            KDB_LOADUSERMODULE_HOOK((PLDR_MODULE) InputBuffer);
+            KDB_LOADUSERMODULE_HOOK((PLDR_DATA_TABLE_ENTRY) InputBuffer);
             break;
 
         default:
index 1d105b1..561abc6 100644 (file)
@@ -18,7 +18,7 @@ struct _KD_DISPATCH_TABLE;
 #if defined(KDBG) || defined(DBG)
 
 VOID
-KdbSymLoadUserModuleSymbols(IN PLDR_MODULE LdrModule);
+KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule);
 
 VOID
 KdbSymFreeProcessSymbols(IN PEPROCESS Process);
index e668e30..617f106 100644 (file)
@@ -51,7 +51,7 @@ KdbpSymFindUserModule(IN PVOID Address  OPTIONAL,
                       OUT PKDB_MODULE_INFO pInfo)
 {
   PLIST_ENTRY current_entry;
-  PLDR_MODULE current;
+  PLDR_DATA_TABLE_ENTRY current;
   PEPROCESS CurrentProcess;
   PPEB Peb = NULL;
   INT Count = 0;
@@ -72,10 +72,10 @@ KdbpSymFindUserModule(IN PVOID Address  OPTIONAL,
   while (current_entry != &Peb->Ldr->InLoadOrderModuleList &&
          current_entry != NULL)
     {
-      current = CONTAINING_RECORD(current_entry, LDR_MODULE, InLoadOrderModuleList);
+      current = CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-      if ((Address != NULL && (Address >= (PVOID)current->BaseAddress &&
-                               Address < (PVOID)((char *)current->BaseAddress + current->ResidentSize))) ||
+      if ((Address != NULL && (Address >= (PVOID)current->DllBase &&
+                               Address < (PVOID)((char *)current->DllBase + current->SizeOfImage))) ||
           (Name != NULL && _wcsicmp(current->BaseDllName.Buffer, Name) == 0) ||
           (Index >= 0 && Count++ == Index))
         {
@@ -84,8 +84,8 @@ KdbpSymFindUserModule(IN PVOID Address  OPTIONAL,
            Length = 255;
          wcsncpy(pInfo->Name, current->BaseDllName.Buffer, Length);
          pInfo->Name[Length] = L'\0';
-          pInfo->Base = (ULONG_PTR)current->BaseAddress;
-          pInfo->Size = current->ResidentSize;
+          pInfo->Base = (ULONG_PTR)current->DllBase;
+          pInfo->Size = current->SizeOfImage;
           pInfo->RosSymInfo = current->RosSymInfo;
           return TRUE;
         }
@@ -488,7 +488,7 @@ KdbpSymUnloadModuleSymbols(IN PROSSYM_INFO RosSymInfo)
  * \param LdrModule Pointer to the module to load symbols for.
  */
 VOID
-KdbSymLoadUserModuleSymbols(IN PLDR_MODULE LdrModule)
+KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule)
 {
   static WCHAR Prefix[] = L"\\??\\";
   UNICODE_STRING KernelName;
@@ -521,7 +521,7 @@ VOID
 KdbSymFreeProcessSymbols(IN PEPROCESS Process)
 {
   PLIST_ENTRY CurrentEntry;
-  PLDR_MODULE Current;
+  PLDR_DATA_TABLE_ENTRY Current;
   PEPROCESS CurrentProcess;
   PPEB Peb;
 
@@ -538,7 +538,7 @@ KdbSymFreeProcessSymbols(IN PEPROCESS Process)
   while (CurrentEntry != &Peb->Ldr->InLoadOrderModuleList &&
         CurrentEntry != NULL)
     {
-      Current = CONTAINING_RECORD(CurrentEntry, LDR_MODULE, InLoadOrderModuleList);
+      Current = CONTAINING_RECORD(CurrentEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
       KdbpSymUnloadModuleSymbols(Current->RosSymInfo);
 
index f545add..097a018 100644 (file)
@@ -20,7 +20,7 @@ BOOLEAN
 print_user_address(PVOID address)
 {
    PLIST_ENTRY current_entry;
-   PLDR_MODULE current;
+   PLDR_DATA_TABLE_ENTRY current;
    PEPROCESS CurrentProcess;
    PPEB Peb = NULL;
    ULONG_PTR RelativeAddress;
@@ -51,13 +51,13 @@ print_user_address(PVOID address)
          current_entry != NULL)
      {
        current =
-         CONTAINING_RECORD(current_entry, LDR_MODULE, InLoadOrderModuleList);
+         CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
 
-       if (address >= (PVOID)current->BaseAddress &&
-           address < (PVOID)((char*)current->BaseAddress + current->ResidentSize))
+       if (address >= (PVOID)current->DllBase &&
+           address < (PVOID)((char*)current->DllBase + current->SizeOfImage))
          {
             RelativeAddress =
-             (ULONG_PTR) address - (ULONG_PTR)current->BaseAddress;
+             (ULONG_PTR) address - (ULONG_PTR)current->DllBase;
            DbgPrint("<%wZ: %x>", &current->BaseDllName, RelativeAddress);
            return(TRUE);
          }
index 81f309d..1b3d338 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <windows.h>
 #define NTOS_MODE_USER
+#define READY_FOR_NEW_NTDLL
 #include <ndk/ntndk.h>
 
 #include <rosrtl/string.h>