This name is used in Microsoft's public winternl.h.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/kernel_main.c | 2 +- dlls/kernel32/module.c | 32 ++++++++--------- dlls/kernel32/tests/loader.c | 6 ++-- dlls/kernel32/toolhelp.c | 16 ++++----- dlls/kernelbase/loader.c | 2 +- dlls/krnl386.exe16/ne_module.c | 2 +- dlls/ntdll/actctx.c | 4 +-- dlls/ntdll/exception.c | 4 +-- dlls/ntdll/loader.c | 64 +++++++++++++++++----------------- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_arm64.c | 2 +- dlls/ntdll/signal_x86_64.c | 2 +- dlls/ntdll/tests/rtl.c | 14 ++++---- dlls/ntoskrnl.exe/ntoskrnl.c | 8 ++--- include/winternl.h | 8 ++--- programs/winedbg/symbol.c | 4 +-- tools/winapi/win32.api | 2 +- 17 files changed, 87 insertions(+), 87 deletions(-)
diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c index cdbb4b9a38..fbc2e8daee 100644 --- a/dlls/kernel32/kernel_main.c +++ b/dlls/kernel32/kernel_main.c @@ -104,7 +104,7 @@ static BOOL process_attach( HMODULE module ) } else { - LDR_MODULE *ldr; + LDR_DATA_TABLE_ENTRY *ldr;
if (LdrFindEntryForAddress( GetModuleHandleW( 0 ), &ldr ) || !(ldr->Flags & LDR_WINE_INTERNAL)) LoadLibraryA( "krnl386.exe16" ); diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 45814dbff3..f0557f944c 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -390,7 +390,7 @@ typedef struct _UNICODE_STRING32 DWORD Buffer; } UNICODE_STRING32;
-typedef struct _LDR_MODULE32 +typedef struct _LDR_DATA_TABLE_ENTRY32 { LIST_ENTRY32 InLoadOrderModuleList; LIST_ENTRY32 InMemoryOrderModuleList; @@ -400,14 +400,14 @@ typedef struct _LDR_MODULE32 ULONG SizeOfImage; UNICODE_STRING32 FullDllName; UNICODE_STRING32 BaseDllName; -} LDR_MODULE32; +} LDR_DATA_TABLE_ENTRY32;
typedef struct { HANDLE process; PLIST_ENTRY head, current; - LDR_MODULE ldr_module; + LDR_DATA_TABLE_ENTRY ldr_module; BOOL wow64; - LDR_MODULE32 ldr_module32; + LDR_DATA_TABLE_ENTRY32 ldr_module32; } MODULE_ITERATOR;
static BOOL init_module_iterator(MODULE_ITERATOR *iter, HANDLE process) @@ -479,7 +479,7 @@ static int module_iterator_next(MODULE_ITERATOR *iter) LIST_ENTRY32 *entry32 = (LIST_ENTRY32 *)iter->current;
if (!ReadProcessMemory(iter->process, - CONTAINING_RECORD(entry32, LDR_MODULE32, InLoadOrderModuleList), + CONTAINING_RECORD(entry32, LDR_DATA_TABLE_ENTRY32, InLoadOrderModuleList), &iter->ldr_module32, sizeof(iter->ldr_module32), NULL)) return -1;
@@ -488,7 +488,7 @@ static int module_iterator_next(MODULE_ITERATOR *iter) }
if (!ReadProcessMemory(iter->process, - CONTAINING_RECORD(iter->current, LDR_MODULE, InLoadOrderModuleList), + CONTAINING_RECORD(iter->current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), &iter->ldr_module, sizeof(iter->ldr_module), NULL)) return -1;
@@ -496,7 +496,7 @@ static int module_iterator_next(MODULE_ITERATOR *iter) return 1; }
-static BOOL get_ldr_module(HANDLE process, HMODULE module, LDR_MODULE *ldr_module) +static BOOL get_ldr_module(HANDLE process, HMODULE module, LDR_DATA_TABLE_ENTRY *ldr_module) { MODULE_ITERATOR iter; INT ret; @@ -519,7 +519,7 @@ static BOOL get_ldr_module(HANDLE process, HMODULE module, LDR_MODULE *ldr_modul return FALSE; }
-static BOOL get_ldr_module32(HANDLE process, HMODULE module, LDR_MODULE32 *ldr_module) +static BOOL get_ldr_module32(HANDLE process, HMODULE module, LDR_DATA_TABLE_ENTRY32 *ldr_module) { MODULE_ITERATOR iter; INT ret; @@ -568,8 +568,8 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, } while (entry != head) { - PLDR_MODULE table_entry = (PLDR_MODULE) - ((PBYTE)entry - offsetof(LDR_MODULE, InLoadOrderModuleList)); + PLDR_DATA_TABLE_ENTRY table_entry = (PLDR_DATA_TABLE_ENTRY) + ((PBYTE)entry - offsetof(LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList)); if (cb >= sizeof(HMODULE)) { *lphModule++ = table_entry->BaseAddress; @@ -641,7 +641,7 @@ BOOL WINAPI K32EnumProcessModulesEx(HANDLE process, HMODULE *lphModule, DWORD WINAPI K32GetModuleBaseNameW(HANDLE process, HMODULE module, LPWSTR base_name, DWORD size) { - LDR_MODULE ldr_module; + LDR_DATA_TABLE_ENTRY ldr_module; BOOL wow64;
if (!IsWow64Process(process, &wow64)) @@ -649,7 +649,7 @@ DWORD WINAPI K32GetModuleBaseNameW(HANDLE process, HMODULE module,
if (sizeof(void *) == 8 && wow64) { - LDR_MODULE32 ldr_module32; + LDR_DATA_TABLE_ENTRY32 ldr_module32;
if (!get_ldr_module32(process, module, &ldr_module32)) return 0; @@ -710,7 +710,7 @@ DWORD WINAPI K32GetModuleBaseNameA(HANDLE process, HMODULE module, DWORD WINAPI K32GetModuleFileNameExW(HANDLE process, HMODULE module, LPWSTR file_name, DWORD size) { - LDR_MODULE ldr_module; + LDR_DATA_TABLE_ENTRY ldr_module; BOOL wow64; DWORD len;
@@ -721,7 +721,7 @@ DWORD WINAPI K32GetModuleFileNameExW(HANDLE process, HMODULE module,
if (sizeof(void *) == 8 && wow64) { - LDR_MODULE32 ldr_module32; + LDR_DATA_TABLE_ENTRY32 ldr_module32;
if (!get_ldr_module32(process, module, &ldr_module32)) return 0; @@ -805,7 +805,7 @@ DWORD WINAPI K32GetModuleFileNameExA(HANDLE process, HMODULE module, BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module, MODULEINFO *modinfo, DWORD cb) { - LDR_MODULE ldr_module; + LDR_DATA_TABLE_ENTRY ldr_module; BOOL wow64;
if (cb < sizeof(MODULEINFO)) @@ -819,7 +819,7 @@ BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module,
if (sizeof(void *) == 8 && wow64) { - LDR_MODULE32 ldr_module32; + LDR_DATA_TABLE_ENTRY32 ldr_module32;
if (!get_ldr_module32(process, module, &ldr_module32)) return FALSE; diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 35c6b3c099..89496ac7e8 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -3807,7 +3807,7 @@ static void test_InMemoryOrderModuleList(void) PEB_LDR_DATA *ldr = NtCurrentTeb()->Peb->LdrData; LIST_ENTRY *entry1, *mark1 = &ldr->InLoadOrderModuleList; LIST_ENTRY *entry2, *mark2 = &ldr->InMemoryOrderModuleList; - LDR_MODULE *module1, *module2; + LDR_DATA_TABLE_ENTRY *module1, *module2;
ok(ldr->Initialized == TRUE, "expected TRUE, got %u\n", ldr->Initialized);
@@ -3815,8 +3815,8 @@ static void test_InMemoryOrderModuleList(void) entry1 != mark1 && entry2 != mark2; entry1 = entry1->Flink, entry2 = entry2->Flink) { - module1 = CONTAINING_RECORD(entry1, LDR_MODULE, InLoadOrderModuleList); - module2 = CONTAINING_RECORD(entry2, LDR_MODULE, InMemoryOrderModuleList); + module1 = CONTAINING_RECORD(entry1, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); ok(module1 == module2, "expected module1 == module2, got %p and %p\n", module1, module2); } ok(entry1 == mark1, "expected entry1 == mark1, got %p and %p\n", entry1, mark1); diff --git a/dlls/kernel32/toolhelp.c b/dlls/kernel32/toolhelp.c index 49e14ff6b3..2bfe964750 100644 --- a/dlls/kernel32/toolhelp.c +++ b/dlls/kernel32/toolhelp.c @@ -73,7 +73,7 @@ static WCHAR *fetch_string( HANDLE hProcess, UNICODE_STRING* us) return local; }
-static BOOL fetch_module( DWORD process, DWORD flags, LDR_MODULE** ldr_mod, ULONG* num ) +static BOOL fetch_module( DWORD process, DWORD flags, LDR_DATA_TABLE_ENTRY **ldr_mod, ULONG *num ) { HANDLE hProcess; PROCESS_BASIC_INFORMATION pbi; @@ -109,19 +109,19 @@ static BOOL fetch_module( DWORD process, DWORD flags, LDR_MODULE** ldr_mod, ULON while (curr != head) { if (!*num) - *ldr_mod = HeapAlloc( GetProcessHeap(), 0, sizeof(LDR_MODULE) ); + *ldr_mod = HeapAlloc( GetProcessHeap(), 0, sizeof(LDR_DATA_TABLE_ENTRY) ); else *ldr_mod = HeapReAlloc( GetProcessHeap(), 0, *ldr_mod, - (*num + 1) * sizeof(LDR_MODULE) ); + (*num + 1) * sizeof(LDR_DATA_TABLE_ENTRY) ); if (!*ldr_mod) break; if (!ReadProcessMemory( hProcess, - CONTAINING_RECORD(curr, LDR_MODULE, + CONTAINING_RECORD(curr, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), &(*ldr_mod)[*num], - sizeof(LDR_MODULE), NULL)) + sizeof(LDR_DATA_TABLE_ENTRY), NULL)) break; curr = (*ldr_mod)[*num].InLoadOrderModuleList.Flink; - /* if we cannot fetch the strings, then just ignore this LDR_MODULE + /* if we cannot fetch the strings, then just ignore this LDR_DATA_TABLE_ENTRY * and continue loading the other ones in the list */ if (!fetch_string( hProcess, &(*ldr_mod)[*num].BaseDllName )) continue; @@ -140,7 +140,7 @@ static BOOL fetch_module( DWORD process, DWORD flags, LDR_MODULE** ldr_mod, ULON }
static void fill_module( struct snapshot* snap, ULONG* offset, ULONG process, - LDR_MODULE* ldr_mod, ULONG num ) + LDR_DATA_TABLE_ENTRY* ldr_mod, ULONG num ) { MODULEENTRY32W* mod; ULONG i; @@ -293,7 +293,7 @@ static void fill_thread( struct snapshot* snap, ULONG* offset, LPVOID info, ULON HANDLE WINAPI CreateToolhelp32Snapshot( DWORD flags, DWORD process ) { SYSTEM_PROCESS_INFORMATION* spi = NULL; - LDR_MODULE* mod = NULL; + LDR_DATA_TABLE_ENTRY *mod = NULL; ULONG num_pcs, num_thd, num_mod; HANDLE hSnapShot = 0;
diff --git a/dlls/kernelbase/loader.c b/dlls/kernelbase/loader.c index 19aaabf726..4b615e4a08 100644 --- a/dlls/kernelbase/loader.c +++ b/dlls/kernelbase/loader.c @@ -301,7 +301,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetModuleFileNameW( HMODULE module, LPWSTR filena { ULONG len = 0; ULONG_PTR magic; - LDR_MODULE *pldr; + LDR_DATA_TABLE_ENTRY *pldr; WIN16_SUBSYSTEM_TIB *win16_tib;
if (!module && ((win16_tib = NtCurrentTeb()->Tib.SubSystemTib)) && win16_tib->exe_name) diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c index 88485372ff..f1e1a14dd6 100644 --- a/dlls/krnl386.exe16/ne_module.c +++ b/dlls/krnl386.exe16/ne_module.c @@ -971,7 +971,7 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_ /* if module has a 32-bit owner, match the load order of the owner */ if ((main_module = (void *)GetProcAddress( mod32, "__wine_spec_main_module" ))) { - LDR_MODULE *ldr; + LDR_DATA_TABLE_ENTRY *ldr; HMODULE main_owner = LoadLibraryA( main_module );
if (!main_owner) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 1ca14827a7..b84372bd00 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -821,7 +821,7 @@ static NTSTATUS get_module_filename( HMODULE module, UNICODE_STRING *str, unsign { NTSTATUS status; ULONG_PTR magic; - LDR_MODULE *pldr; + LDR_DATA_TABLE_ENTRY *pldr;
LdrLockLoaderLock(0, NULL, &magic); status = LdrFindEntryForAddress( module, &pldr ); @@ -3375,7 +3375,7 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class ) else if (flags & (QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS|QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE)) { ULONG_PTR magic; - LDR_MODULE *pldr; + LDR_DATA_TABLE_ENTRY *pldr;
if (!*handle) return STATUS_INVALID_PARAMETER;
diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 5df037b7ea..ed4c80025f 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -581,7 +581,7 @@ static RUNTIME_FUNCTION *find_function_info( ULONG_PTR pc, ULONG_PTR base, /********************************************************************** * lookup_function_info */ -RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_MODULE **module ) +RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_DATA_TABLE_ENTRY **module ) { RUNTIME_FUNCTION *func = NULL; struct dynamic_unwind_entry *entry; @@ -628,7 +628,7 @@ RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_MODUL PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base, UNWIND_HISTORY_TABLE *table ) { - LDR_MODULE *module; + LDR_DATA_TABLE_ENTRY *module; RUNTIME_FUNCTION *func;
/* FIXME: should use the history table to make things faster */ diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 04ea7ea121..676e5e650e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -69,7 +69,7 @@ WINE_DECLARE_DEBUG_CHANNEL(imports); #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID ((ULONG_PTR)2)
typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID); -typedef void (CALLBACK *LDRENUMPROC)(LDR_MODULE *, void *, BOOLEAN *); +typedef void (CALLBACK *LDRENUMPROC)(LDR_DATA_TABLE_ENTRY *, void *, BOOLEAN *);
/* system directory with trailing backslash */ const WCHAR system_dir[] = {'C',':','\','w','i','n','d','o','w','s','\', @@ -125,7 +125,7 @@ static const WCHAR dllW[] = {'.','d','l','l',0}; /* internal representation of 32bit modules. per process. */ typedef struct _wine_modref { - LDR_MODULE ldr; + LDR_DATA_TABLE_ENTRY ldr; dev_t dev; ino_t ino; void *so_handle; @@ -209,7 +209,7 @@ static RTL_UNLOAD_EVENT_TRACE unload_traces[RTL_UNLOAD_EVENT_TRACE_NUMBER]; static RTL_UNLOAD_EVENT_TRACE *unload_trace_ptr; static unsigned int unload_trace_seq;
-static void module_push_unload_trace( const LDR_MODULE *ldr ) +static void module_push_unload_trace( const LDR_DATA_TABLE_ENTRY *ldr ) { RTL_UNLOAD_EVENT_TRACE *ptr = &unload_traces[unload_trace_seq]; unsigned int len = min(sizeof(ptr->ImageName) - sizeof(WCHAR), ldr->BaseDllName.Length); @@ -439,7 +439,7 @@ static inline ULONG_PTR allocate_stub( const char *dll, const char *name ) { ret #endif /* __i386__ */
/* call ldr notifications */ -static void call_ldr_notifications( ULONG reason, LDR_MODULE *module ) +static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) { struct ldr_notification *notify, *notify_next; LDR_DLL_NOTIFICATION_DATA data; @@ -471,14 +471,14 @@ static void call_ldr_notifications( ULONG reason, LDR_MODULE *module ) static WINE_MODREF *get_modref( HMODULE hmod ) { PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + PLDR_DATA_TABLE_ENTRY mod;
if (cached_modref && cached_modref->ldr.BaseAddress == hmod) return cached_modref;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); if (mod->BaseAddress == hmod) return cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); } @@ -505,7 +505,7 @@ static WINE_MODREF *find_basename_module( LPCWSTR name ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); @@ -537,7 +537,7 @@ static WINE_MODREF *find_fullname_module( const UNICODE_STRING *nt_name ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); if (RtlEqualUnicodeString( &name, &mod->FullDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); @@ -564,7 +564,7 @@ static WINE_MODREF *find_fileid_module( struct stat *st ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_MODULE *mod = CONTAINING_RECORD( entry, LDR_MODULE, InLoadOrderModuleList ); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList ); WINE_MODREF *wm = CONTAINING_RECORD( mod, WINE_MODREF, ldr );
if (wm->dev == st->st_dev && wm->ino == st->st_ino) @@ -590,7 +590,7 @@ static WINE_MODREF *find_so_module( void *handle ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_MODULE *mod = CONTAINING_RECORD( entry, LDR_MODULE, InLoadOrderModuleList ); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList ); WINE_MODREF *wm = CONTAINING_RECORD( mod, WINE_MODREF, ldr );
if (wm->so_handle == handle) return wm; @@ -918,7 +918,7 @@ done: /*********************************************************************** * create_module_activation_context */ -static NTSTATUS create_module_activation_context( LDR_MODULE *module ) +static NTSTATUS create_module_activation_context( LDR_DATA_TABLE_ENTRY *module ) { NTSTATUS status; LDR_RESOURCE_INFO info; @@ -948,7 +948,7 @@ static NTSTATUS create_module_activation_context( LDR_MODULE *module ) * Some dlls (corpol.dll from IE6 for instance) are incorrectly marked as native * while being perfectly normal DLLs. This heuristic should catch such breakages. */ -static BOOL is_dll_native_subsystem( LDR_MODULE *mod, const IMAGE_NT_HEADERS *nt, LPCWSTR filename ) +static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_HEADERS *nt, LPCWSTR filename ) { static const WCHAR ntdllW[] = {'n','t','d','l','l','.','d','l','l',0}; static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0}; @@ -985,7 +985,7 @@ static BOOL is_dll_native_subsystem( LDR_MODULE *mod, const IMAGE_NT_HEADERS *nt * Allocate a TLS slot for a newly-loaded module. * The loader_section must be locked while calling this function. */ -static SHORT alloc_tls_slot( LDR_MODULE *mod ) +static SHORT alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) { const IMAGE_TLS_DIRECTORY *dir; ULONG i, size; @@ -1070,7 +1070,7 @@ static SHORT alloc_tls_slot( LDR_MODULE *mod ) * Free the module TLS slot on unload. * The loader_section must be locked while calling this function. */ -static void free_tls_slot( LDR_MODULE *mod ) +static void free_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) { ULONG i = (USHORT)mod->TlsIndex;
@@ -1526,7 +1526,7 @@ static void attach_implicitly_loaded_dlls( LPVOID reserved ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
if (!(mod->Flags & LDR_IMAGE_IS_DLL)) continue; if (mod->Flags & (LDR_LOAD_IN_PROGRESS | LDR_PROCESS_ATTACHED)) continue; @@ -1549,14 +1549,14 @@ static void attach_implicitly_loaded_dlls( LPVOID reserved ) static void process_detach(void) { PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + PLDR_DATA_TABLE_ENTRY mod;
mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; do { for (entry = mark->Blink; entry != mark; entry = entry->Blink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); /* Check whether to detach this DLL */ if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) @@ -1587,12 +1587,12 @@ static void process_detach(void) static void thread_attach(void) { PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + PLDR_DATA_TABLE_ENTRY mod;
mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) continue; @@ -1630,15 +1630,15 @@ NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE hModule) * * The loader_section must be locked while calling this function */ -NTSTATUS WINAPI LdrFindEntryForAddress(const void* addr, PLDR_MODULE* pmod) +NTSTATUS WINAPI LdrFindEntryForAddress( const void *addr, PLDR_DATA_TABLE_ENTRY *pmod ) { PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + PLDR_DATA_TABLE_ENTRY mod;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); if (mod->BaseAddress <= addr && (const char *)addr < (char*)mod->BaseAddress + mod->SizeOfImage) { @@ -1655,7 +1655,7 @@ NTSTATUS WINAPI LdrFindEntryForAddress(const void* addr, PLDR_MODULE* pmod) NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, void *context ) { LIST_ENTRY *mark, *entry; - LDR_MODULE *mod; + LDR_DATA_TABLE_ENTRY *mod; BOOLEAN stop = FALSE;
TRACE( "(%p, %p, %p)\n", unknown, callback, context ); @@ -1668,7 +1668,7 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD( entry, LDR_MODULE, InMemoryOrderModuleList ); + mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList ); callback( mod, context, &stop ); if (stop) break; } @@ -3483,7 +3483,7 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(PSYSTEM_MODULE_INFORMATION smi, ANSI_STRING str; char* ptr; PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + LDR_DATA_TABLE_ENTRY *mod; WORD id = 0;
smi->ModulesCount = 0; @@ -3492,7 +3492,7 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(PSYSTEM_MODULE_INFORMATION smi, mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); size += sizeof(*sm); if (size <= buf_size) { @@ -3743,7 +3743,7 @@ void WINAPI RtlExitUserProcess( DWORD status ) void WINAPI LdrShutdownThread(void) { PLIST_ENTRY mark, entry; - PLDR_MODULE mod; + LDR_DATA_TABLE_ENTRY *mod; UINT i; void **pointers;
@@ -3757,7 +3757,7 @@ void WINAPI LdrShutdownThread(void) mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; for (entry = mark->Blink; entry != mark; entry = entry->Blink) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) continue; @@ -3828,13 +3828,13 @@ static void free_modref( WINE_MODREF *wm ) static void MODULE_FlushModrefs(void) { PLIST_ENTRY mark, entry, prev; - PLDR_MODULE mod; + LDR_DATA_TABLE_ENTRY *mod; WINE_MODREF*wm;
mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; for (entry = mark->Blink; entry != mark; entry = prev) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, InInitializationOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr); prev = entry->Blink; if (!mod->LoadCount) free_modref( wm ); @@ -3844,7 +3844,7 @@ static void MODULE_FlushModrefs(void) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Blink; entry != mark; entry = prev) { - mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr); prev = entry->Blink; if (!mod->LoadCount) free_modref( wm ); @@ -4189,7 +4189,7 @@ PVOID WINAPI RtlImageRvaToVa( const IMAGE_NT_HEADERS *nt, HMODULE module, */ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) { - LDR_MODULE *module; + LDR_DATA_TABLE_ENTRY *module; PVOID ret = NULL;
RtlEnterCriticalSection( &loader_section ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 0ae696b7f2..cbb3f6d93d 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -69,7 +69,7 @@ extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULON extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ) DECLSPEC_HIDDEN;
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) -extern RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_MODULE **module ) DECLSPEC_HIDDEN; +extern RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_DATA_TABLE_ENTRY **module ) DECLSPEC_HIDDEN; #endif
/* debug helpers */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 031c271846..15e78dbb56 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -609,7 +609,7 @@ static NTSTATUS libunwind_virtual_unwind( ULONG_PTR ip, ULONG_PTR *frame, CONTEX */ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) { - LDR_MODULE *module; + LDR_DATA_TABLE_ENTRY *module; NTSTATUS status;
dispatch->ImageBase = 0; diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 89caca9f30..2f9c3dae22 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1578,7 +1578,7 @@ static NTSTATUS libunwind_virtual_unwind( ULONG64 ip, BOOL* got_info, ULONG64 *f */ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) { - LDR_MODULE *module; + LDR_DATA_TABLE_ENTRY *module; NTSTATUS status;
dispatch->ImageBase = 0; diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 445f3538d8..b8e30bd947 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3329,7 +3329,7 @@ struct ldr_enum_context int count; };
-static void WINAPI ldr_enum_callback(LDR_MODULE *module, void *context, BOOLEAN *stop) +static void WINAPI ldr_enum_callback(LDR_DATA_TABLE_ENTRY *module, void *context, BOOLEAN *stop) { static const WCHAR ntdllW[] = {'n','t','d','l','l','.','d','l','l',0}; struct ldr_enum_context *ctx = context; @@ -3435,9 +3435,9 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT const IMAGE_IMPORT_DESCRIPTOR *imports; const IMAGE_THUNK_DATA *import_list; IMAGE_THUNK_DATA *thunk_list; + LDR_DATA_TABLE_ENTRY *mod; DWORD *calls = context; LIST_ENTRY *mark; - LDR_MODULE *mod; ULONG size; int i, j;
@@ -3455,7 +3455,7 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT
/* expect module to be last module listed in LdrData load order list */ mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_MODULE, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); ok(!lstrcmpiW(mod->BaseDllName.Buffer, expected_dll), "Expected %s, got %s\n", @@ -3507,7 +3507,7 @@ static void CALLBACK ldr_notify_callback_dll_main(ULONG reason, LDR_DLL_NOTIFICA { DWORD *calls = context; LIST_ENTRY *mark; - LDR_MODULE *mod; + LDR_DATA_TABLE_ENTRY *mod;
*calls <<= 4; *calls |= reason; @@ -3516,7 +3516,7 @@ static void CALLBACK ldr_notify_callback_dll_main(ULONG reason, LDR_DLL_NOTIFICA return;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_MODULE, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) @@ -3546,7 +3546,7 @@ static void CALLBACK ldr_notify_callback_fail(ULONG reason, LDR_DLL_NOTIFICATION { DWORD *calls = context; LIST_ENTRY *mark; - LDR_MODULE *mod; + LDR_DATA_TABLE_ENTRY *mod;
*calls <<= 4; *calls |= reason; @@ -3555,7 +3555,7 @@ static void CALLBACK ldr_notify_callback_fail(ULONG reason, LDR_DLL_NOTIFICATION return;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_MODULE, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 4ad5160328..89241d30b4 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -803,7 +803,7 @@ static void unload_driver( struct wine_rb_entry *entry, void *context ) { struct wine_driver *driver = WINE_RB_ENTRY_VALUE( entry, struct wine_driver, entry ); SERVICE_STATUS_HANDLE service_handle = driver->service_handle; - LDR_MODULE *ldr; + LDR_DATA_TABLE_ENTRY *ldr;
if (!service_handle) return; /* not a service */
@@ -3304,10 +3304,10 @@ error: return STATUS_UNSUCCESSFUL; }
-/* find the LDR_MODULE corresponding to the driver module */ -static LDR_MODULE *find_ldr_module( HMODULE module ) +/* find the LDR_DATA_TABLE_ENTRY corresponding to the driver module */ +static LDR_DATA_TABLE_ENTRY *find_ldr_module( HMODULE module ) { - LDR_MODULE *ldr; + LDR_DATA_TABLE_ENTRY *ldr; ULONG_PTR magic;
LdrLockLoaderLock( 0, NULL, &magic ); diff --git a/include/winternl.h b/include/winternl.h index f36419da78..0fa5485596 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2317,7 +2317,7 @@ typedef enum _LDR_DLL_LOAD_REASON LoadReasonUnknown = -1 } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON;
-typedef struct _LDR_MODULE +typedef struct _LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderModuleList; LIST_ENTRY InMemoryOrderModuleList; @@ -2348,7 +2348,7 @@ typedef struct _LDR_MODULE LDR_DLL_LOAD_REASON LoadReason; ULONG ImplicitPathOptions; ULONG ReferenceCount; -} LDR_MODULE, *PLDR_MODULE; +} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA { @@ -2376,7 +2376,7 @@ typedef union _LDR_DLL_NOTIFICATION_DATA
typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
-/* those defines are (some of the) regular LDR_MODULE.Flags values */ +/* those defines are (some of the) regular LDR_DATA_TABLE_ENTRY.Flags values */ #define LDR_IMAGE_IS_DLL 0x00000004 #define LDR_LOAD_IN_PROGRESS 0x00001000 #define LDR_UNLOAD_IN_PROGRESS 0x00002000 @@ -2443,7 +2443,7 @@ NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_EN NTSYSAPI NTSTATUS WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**); NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE); NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE); -NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*); +NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_DATA_TABLE_ENTRY*); NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**); NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**); NTSYSAPI NTSTATUS WINAPI LdrGetDllDirectory(UNICODE_STRING*); diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index 372ae76c33..6f92362d44 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -144,7 +144,7 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base, PEB peb; PEB_LDR_DATA ldr_data; PLIST_ENTRY head, current; - LDR_MODULE ldr_module; + LDR_DATA_TABLE_ENTRY ldr_module; unsigned tlsindex = -1;
if (NtQueryInformationProcess(dbg_curr_process->handle, ProcessBasicInformation, @@ -165,7 +165,7 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base, head = &((PEB_LDR_DATA*)peb.LdrData)->InLoadOrderModuleList; do { - if (!dbg_read_memory(CONTAINING_RECORD(current, LDR_MODULE, InLoadOrderModuleList), + if (!dbg_read_memory(CONTAINING_RECORD(current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), &ldr_module, sizeof(ldr_module))) goto tls_error; if ((DWORD_PTR)ldr_module.BaseAddress == sym->ModBase) { diff --git a/tools/winapi/win32.api b/tools/winapi/win32.api index 3a4557a719..ed14ecc034 100644 --- a/tools/winapi/win32.api +++ b/tools/winapi/win32.api @@ -3408,7 +3408,7 @@ PIO_APC_ROUTINE PIO_STATUS_BLOCK PKEY_MULTIPLE_VALUE_INFORMATION PLARGE_INTEGER -PLDR_MODULE * +PLDR_DATA_TABLE_ENTRY * PLONG PLPC_MESSAGE PLPC_SECTION_READ
To match Microsoft's public definition.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/tests/loader.c | 2 +- dlls/ntdll/loader.c | 18 +++++++++--------- dlls/ntdll/tests/rtl.c | 6 +++--- include/winternl.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 89496ac7e8..2164440494 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -3816,7 +3816,7 @@ static void test_InMemoryOrderModuleList(void) entry1 = entry1->Flink, entry2 = entry2->Flink) { module1 = CONTAINING_RECORD(entry1, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); - module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(module1 == module2, "expected module1 == module2, got %p and %p\n", module1, module2); } ok(entry1 == mark1, "expected entry1 == mark1, got %p and %p\n", entry1, mark1); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 676e5e650e..529c4f40e9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -478,7 +478,7 @@ static WINE_MODREF *get_modref( HMODULE hmod ) mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); if (mod->BaseAddress == hmod) return cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); } @@ -1226,7 +1226,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name InsertTailList(&NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, - &wm->ldr.InMemoryOrderModuleList); + &wm->ldr.InMemoryOrderLinks); /* wait until init is called for inserting into InInitializationOrderModuleList */
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) @@ -1638,7 +1638,7 @@ NTSTATUS WINAPI LdrFindEntryForAddress( const void *addr, PLDR_DATA_TABLE_ENTRY mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); if (mod->BaseAddress <= addr && (const char *)addr < (char*)mod->BaseAddress + mod->SizeOfImage) { @@ -1668,7 +1668,7 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList ); + mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks ); callback( mod, context, &stop ); if (stop) break; } @@ -2029,7 +2029,7 @@ static NTSTATUS build_so_dll_module( const WCHAR *load_path, const UNICODE_STRIN { /* the module has only been inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); /* FIXME: free the modref */ return status; } @@ -2572,7 +2572,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam { /* the module has only be inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
/* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the @@ -3790,7 +3790,7 @@ void WINAPI LdrShutdownThread(void) static void free_modref( WINE_MODREF *wm ) { RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); if (wm->ldr.InInitializationOrderModuleList.Flink) RemoveEntryList(&wm->ldr.InInitializationOrderModuleList);
@@ -4578,8 +4578,8 @@ void __wine_process_init(void) /* the main exe needs to be the first in the load order list */ RemoveEntryList( &wm->ldr.InLoadOrderModuleList ); InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList ); - RemoveEntryList( &wm->ldr.InMemoryOrderModuleList ); - InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderModuleList ); + RemoveEntryList( &wm->ldr.InMemoryOrderLinks ); + InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks );
virtual_alloc_thread_stack( &stack, 0, 0, NULL ); teb->Tib.StackBase = stack.StackBase; diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index b8e30bd947..f29eca24f0 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3455,7 +3455,7 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT
/* expect module to be last module listed in LdrData load order list */ mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); ok(!lstrcmpiW(mod->BaseDllName.Buffer, expected_dll), "Expected %s, got %s\n", @@ -3516,7 +3516,7 @@ static void CALLBACK ldr_notify_callback_dll_main(ULONG reason, LDR_DLL_NOTIFICA return;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) @@ -3555,7 +3555,7 @@ static void CALLBACK ldr_notify_callback_fail(ULONG reason, LDR_DLL_NOTIFICATION return;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) diff --git a/include/winternl.h b/include/winternl.h index 0fa5485596..b246871f07 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2320,7 +2320,7 @@ typedef enum _LDR_DLL_LOAD_REASON typedef struct _LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; + LIST_ENTRY InMemoryOrderLinks; LIST_ENTRY InInitializationOrderModuleList; void* BaseAddress; void* EntryPoint;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=70404
Your paranoid android.
=== w1064v1809_2scr (32 bit report) ===
kernel32: loader.c:692: Test failed: 1278: got test dll but expected fallback loader.c:692: Test failed: 1285: got test dll but expected fallback loader.c:692: Test failed: 1292: got test dll but expected fallback loader.c:692: Test failed: 1300: got test dll but expected fallback loader.c:692: Test failed: 1307: got test dll but expected fallback loader.c:692: Test failed: 1317: got test dll but expected fallback loader.c:692: Test failed: 1322: got test dll but expected fallback loader.c:692: Test failed: 1327: got test dll but expected fallback loader.c:692: Test failed: 1332: got test dll but expected fallback loader.c:692: Test failed: 1337: got test dll but expected fallback
=== w1064v1809_he (32 bit report) ===
kernel32: loader.c:3215: Test failed: child process failed to terminate
=== w1064v1809_ja (32 bit report) ===
kernel32: loader.c:3187: Test failed: child process failed to terminate
=== w1064v1809_zh_CN (32 bit report) ===
kernel32: loader.c:3187: Test failed: child process failed to terminate
=== w1064v1809 (64 bit report) ===
kernel32: loader.c:692: Test failed: 1392: got test dll but expected fallback loader.c:692: Test failed: 1398: got test dll but expected fallback loader.c:692: Test failed: 1404: got test dll but expected fallback loader.c:692: Test failed: 1411: got test dll but expected fallback loader.c:692: Test failed: 1438: got test dll but expected fallback
=== w1064v1809 (32 bit report) ===
ntdll: 1838:rtl: unhandled exception c0000005 at 77D89D4B
=== w1064v1809_2scr (32 bit report) ===
ntdll: 198c:rtl: unhandled exception c0000005 at 77BA9D4B
=== w1064v1809_ar (32 bit report) ===
ntdll: 130c:rtl: unhandled exception c0000005 at 77219D4B
=== w1064v1809_he (32 bit report) ===
ntdll: 18b4:rtl: unhandled exception c0000005 at 77D39D4B
=== w1064v1809_ja (32 bit report) ===
ntdll: 1908:rtl: unhandled exception c0000005 at 772B9D4B
=== w1064v1809_zh_CN (32 bit report) ===
ntdll: 1860:rtl: unhandled exception c0000005 at 77979D4B
=== debiant (build log) ===
The task timed out
=== debiant (build log) ===
The task timed out
To match Microsoft's public definition.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/module.c | 8 ++-- dlls/kernel32/toolhelp.c | 4 +- dlls/ntdll/actctx.c | 2 +- dlls/ntdll/exception.c | 6 +-- dlls/ntdll/loader.c | 90 ++++++++++++++++++------------------ dlls/ntdll/tests/rtl.c | 16 +++---- dlls/ntoskrnl.exe/ntoskrnl.c | 2 +- include/winternl.h | 2 +- programs/winedbg/symbol.c | 2 +- 9 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index f0557f944c..3188e43562 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -507,7 +507,7 @@ static BOOL get_ldr_module(HANDLE process, HMODULE module, LDR_DATA_TABLE_ENTRY while ((ret = module_iterator_next(&iter)) > 0) /* When hModule is NULL we return the process image - which will be * the first module since our iterator uses InLoadOrderModuleList */ - if (!module || module == iter.ldr_module.BaseAddress) + if (!module || module == iter.ldr_module.DllBase) { *ldr_module = iter.ldr_module; return TRUE; @@ -572,7 +572,7 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, ((PBYTE)entry - offsetof(LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList)); if (cb >= sizeof(HMODULE)) { - *lphModule++ = table_entry->BaseAddress; + *lphModule++ = table_entry->DllBase; cb -= sizeof(HMODULE); } size += sizeof(HMODULE); @@ -605,7 +605,7 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, if (sizeof(void *) == 8 && iter.wow64) *lphModule++ = (HMODULE) (DWORD_PTR)iter.ldr_module32.BaseAddress; else - *lphModule++ = iter.ldr_module.BaseAddress; + *lphModule++ = iter.ldr_module.DllBase; cb -= sizeof(HMODULE); } size += sizeof(HMODULE); @@ -833,7 +833,7 @@ BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module, if (!get_ldr_module(process, module, &ldr_module)) return FALSE;
- modinfo->lpBaseOfDll = ldr_module.BaseAddress; + modinfo->lpBaseOfDll = ldr_module.DllBase; modinfo->SizeOfImage = ldr_module.SizeOfImage; modinfo->EntryPoint = ldr_module.EntryPoint; } diff --git a/dlls/kernel32/toolhelp.c b/dlls/kernel32/toolhelp.c index 2bfe964750..77feec64fc 100644 --- a/dlls/kernel32/toolhelp.c +++ b/dlls/kernel32/toolhelp.c @@ -160,9 +160,9 @@ static void fill_module( struct snapshot* snap, ULONG* offset, ULONG process, mod->th32ProcessID = process ? process : GetCurrentProcessId(); mod->GlblcntUsage = 0xFFFF; /* FIXME */ mod->ProccntUsage = 0xFFFF; /* FIXME */ - mod->modBaseAddr = ldr_mod[i].BaseAddress; + mod->modBaseAddr = ldr_mod[i].DllBase; mod->modBaseSize = ldr_mod[i].SizeOfImage; - mod->hModule = ldr_mod[i].BaseAddress; + mod->hModule = ldr_mod[i].DllBase;
l = min(ldr_mod[i].BaseDllName.Length, sizeof(mod->szModule) - sizeof(WCHAR)); memcpy(mod->szModule, ldr_mod[i].BaseDllName.Buffer, l); diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index b84372bd00..1ca794ae3e 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -3382,7 +3382,7 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class ) LdrLockLoaderLock( 0, NULL, &magic ); if (!LdrFindEntryForAddress( *handle, &pldr )) { - if ((flags & QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE) && *handle != pldr->BaseAddress) + if ((flags & QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE) && *handle != pldr->DllBase) status = STATUS_DLL_NOT_FOUND; else *handle = pldr->ActivationContext; diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index ed4c80025f..fd1d7c6d64 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -590,12 +590,12 @@ RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_DATA_ /* PE module or wine module */ if (!LdrFindEntryForAddress( (void *)pc, module )) { - *base = (ULONG_PTR)(*module)->BaseAddress; - if ((func = RtlImageDirectoryEntryToData( (*module)->BaseAddress, TRUE, + *base = (ULONG_PTR)(*module)->DllBase; + if ((func = RtlImageDirectoryEntryToData( (*module)->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size ))) { /* lookup in function table */ - func = find_function_info( pc, (ULONG_PTR)(*module)->BaseAddress, func, size/sizeof(*func) ); + func = find_function_info( pc, (ULONG_PTR)(*module)->DllBase, func, size/sizeof(*func) ); } } else diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 529c4f40e9..9f4d254c95 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -214,7 +214,7 @@ static void module_push_unload_trace( const LDR_DATA_TABLE_ENTRY *ldr ) RTL_UNLOAD_EVENT_TRACE *ptr = &unload_traces[unload_trace_seq]; unsigned int len = min(sizeof(ptr->ImageName) - sizeof(WCHAR), ldr->BaseDllName.Length);
- ptr->BaseAddress = ldr->BaseAddress; + ptr->BaseAddress = ldr->DllBase; ptr->SizeOfImage = ldr->SizeOfImage; ptr->Sequence = unload_trace_seq; ptr->TimeDateStamp = ldr->TimeDateStamp; @@ -447,7 +447,7 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) data.Loaded.Flags = 0; data.Loaded.FullDllName = &module->FullDllName; data.Loaded.BaseDllName = &module->BaseDllName; - data.Loaded.DllBase = module->BaseAddress; + data.Loaded.DllBase = module->DllBase; data.Loaded.SizeOfImage = module->SizeOfImage;
LIST_FOR_EACH_ENTRY_SAFE( notify, notify_next, &ldr_notifications, struct ldr_notification, entry ) @@ -473,13 +473,13 @@ static WINE_MODREF *get_modref( HMODULE hmod ) PLIST_ENTRY mark, entry; PLDR_DATA_TABLE_ENTRY mod;
- if (cached_modref && cached_modref->ldr.BaseAddress == hmod) return cached_modref; + if (cached_modref && cached_modref->ldr.DllBase == hmod) return cached_modref;
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); - if (mod->BaseAddress == hmod) + if (mod->DllBase == hmod) return cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); } return NULL; @@ -658,7 +658,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS } else if (process_attach( wm, NULL ) != STATUS_SUCCESS) { - LdrUnloadDll( wm->ldr.BaseAddress ); + LdrUnloadDll( wm->ldr.DllBase ); wm = NULL; } } @@ -670,14 +670,14 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS return NULL; } } - if ((exports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE, + if ((exports = RtlImageDirectoryEntryToData( wm->ldr.DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ))) { const char *name = end + 1; if (*name == '#') /* ordinal */ - proc = find_ordinal_export( wm->ldr.BaseAddress, exports, exp_size, atoi(name+1), load_path ); + proc = find_ordinal_export( wm->ldr.DllBase, exports, exp_size, atoi(name+1), load_path ); else - proc = find_named_export( wm->ldr.BaseAddress, exports, exp_size, name, -1, load_path ); + proc = find_named_export( wm->ldr.DllBase, exports, exp_size, name, -1, load_path ); }
if (!proc) @@ -840,7 +840,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP NtProtectVirtualMemory( NtCurrentProcess(), &protect_base, &protect_size, PAGE_READWRITE, &protect_old );
- imp_mod = wmImp->ldr.BaseAddress; + imp_mod = wmImp->ldr.DllBase; exports = RtlImageDirectoryEntryToData( imp_mod, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size );
if (!exports) @@ -927,13 +927,13 @@ static NTSTATUS create_module_activation_context( LDR_DATA_TABLE_ENTRY *module ) info.Type = RT_MANIFEST; info.Name = ISOLATIONAWARE_MANIFEST_RESOURCE_ID; info.Language = 0; - if (!(status = LdrFindResource_U( module->BaseAddress, &info, 3, &entry ))) + if (!(status = LdrFindResource_U( module->DllBase, &info, 3, &entry ))) { ACTCTXW ctx; ctx.cbSize = sizeof(ctx); ctx.lpSource = NULL; ctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID; - ctx.hModule = module->BaseAddress; + ctx.hModule = module->DllBase; ctx.lpResourceName = (LPCWSTR)ISOLATIONAWARE_MANIFEST_RESOURCE_ID; status = RtlCreateActivationContext( &module->ActivationContext, &ctx ); } @@ -960,12 +960,12 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H if (nt->OptionalHeader.SectionAlignment < page_size) return TRUE; if (mod->Flags & LDR_WINE_INTERNAL) return TRUE;
- if ((imports = RtlImageDirectoryEntryToData( mod->BaseAddress, TRUE, + if ((imports = RtlImageDirectoryEntryToData( mod->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size ))) { for (i = 0; imports[i].Name; i++) { - const char *name = get_rva( mod->BaseAddress, imports[i].Name ); + const char *name = get_rva( mod->DllBase, imports[i].Name ); DWORD len = strlen(name); if (len * sizeof(WCHAR) >= sizeof(buffer)) continue; ascii_to_unicode( buffer, name, len + 1 ); @@ -992,7 +992,7 @@ static SHORT alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) void *new_ptr; LIST_ENTRY *entry;
- if (!(dir = RtlImageDirectoryEntryToData( mod->BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_TLS, &size ))) + if (!(dir = RtlImageDirectoryEntryToData( mod->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_TLS, &size ))) return -1;
size = dir->EndAddressOfRawData - dir->StartAddressOfRawData; @@ -1005,7 +1005,7 @@ static SHORT alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod ) break; }
- TRACE( "module %p data %p-%p zerofill %u index %p callback %p flags %x -> slot %u\n", mod->BaseAddress, + TRACE( "module %p data %p-%p zerofill %u index %p callback %p flags %x -> slot %u\n", mod->DllBase, (void *)dir->StartAddressOfRawData, (void *)dir->EndAddressOfRawData, dir->SizeOfZeroFill, (void *)dir->AddressOfIndex, (void *)dir->AddressOfCallBacks, dir->Characteristics, i );
@@ -1114,11 +1114,11 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void *
TRACE( "loaded mscoree for %s\n", debugstr_w(wm->ldr.FullDllName.Buffer) );
- if ((exports = RtlImageDirectoryEntryToData( imp->ldr.BaseAddress, TRUE, + if ((exports = RtlImageDirectoryEntryToData( imp->ldr.DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ))) { const char *name = (wm->ldr.Flags & LDR_IMAGE_IS_DLL) ? "_CorDllMain" : "_CorExeMain"; - proc = find_named_export( imp->ldr.BaseAddress, exports, exp_size, name, -1, load_path ); + proc = find_named_export( imp->ldr.DllBase, exports, exp_size, name, -1, load_path ); } if (!proc) return STATUS_PROCEDURE_NOT_FOUND; *entry = proc; @@ -1146,7 +1146,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
wm->ldr.TlsIndex = alloc_tls_slot( &wm->ldr );
- if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.BaseAddress, TRUE, + if (!(imports = RtlImageDirectoryEntryToData( wm->ldr.DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size ))) return STATUS_SUCCESS;
@@ -1169,7 +1169,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path ) { dep = wm->nDeps++;
- if (!import_dll( wm->ldr.BaseAddress, &imports[i], load_path, &imp )) + if (!import_dll( wm->ldr.DllBase, &imports[i], load_path, &imp )) { imp = NULL; status = STATUS_DLL_NOT_FOUND; @@ -1197,7 +1197,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
if (!(wm = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wm) ))) return NULL;
- wm->ldr.BaseAddress = hModule; + wm->ldr.DllBase = hModule; wm->ldr.SizeOfImage = nt->OptionalHeader.SizeOfImage; wm->ldr.Flags = LDR_DONT_RESOLVE_REFS | (builtin ? LDR_WINE_INTERNAL : 0); wm->ldr.TlsIndex = -1; @@ -1368,13 +1368,13 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved WCHAR mod_name[32]; NTSTATUS status = STATUS_SUCCESS; DLLENTRYPROC entry = wm->ldr.EntryPoint; - void *module = wm->ldr.BaseAddress; + void *module = wm->ldr.DllBase; BOOL retv = FALSE;
/* Skip calls for modules loaded with special load flags */
if (wm->ldr.Flags & LDR_DONT_RESOLVE_REFS) return STATUS_SUCCESS; - if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason ); + if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, reason ); if (wm->so_handle && reason == DLL_PROCESS_ATTACH) call_constructors( wm ); if (!entry) return STATUS_SUCCESS;
@@ -1639,8 +1639,8 @@ NTSTATUS WINAPI LdrFindEntryForAddress( const void *addr, PLDR_DATA_TABLE_ENTRY for (entry = mark->Flink; entry != mark; entry = entry->Flink) { mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); - if (mod->BaseAddress <= addr && - (const char *)addr < (char*)mod->BaseAddress + mod->SizeOfImage) + if (mod->DllBase <= addr && + (const char *)addr < (char*)mod->DllBase + mod->SizeOfImage) { *pmod = mod; return STATUS_SUCCESS; @@ -2491,7 +2491,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, if ((*pwm = find_fileid_module( st ))) { TRACE( "%s is the same file as existing module %p %s\n", debugstr_w( nt_name->Buffer ), - (*pwm)->ldr.BaseAddress, debugstr_w( (*pwm)->ldr.FullDllName.Buffer )); + (*pwm)->ldr.DllBase, debugstr_w( (*pwm)->ldr.FullDllName.Buffer )); NtClose( handle ); NtUnmapViewOfSection( NtCurrentProcess(), *module ); *module = NULL; @@ -2842,7 +2842,7 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, if ((info.wm = get_modref( module ))) /* already loaded */ { TRACE( "Found %s at %p for builtin %s\n", - debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.BaseAddress, + debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.DllBase, debugstr_us(nt_name) ); if (info.wm->ldr.LoadCount != -1) info.wm->ldr.LoadCount++; dlclose( handle ); @@ -2853,7 +2853,7 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, if ((info.status = build_so_dll_module( load_path, &win_name, module, flags, &info.wm ))) goto failed; TRACE_(loaddll)( "Loaded %s at %p: builtin\n", - debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.BaseAddress ); + debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.DllBase ); info.wm->ldr.LoadCount = 1; info.wm->so_handle = handle; } @@ -2869,14 +2869,14 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, goto failed; } TRACE( "Found %s at %p for builtin %s\n", - debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.BaseAddress, + debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.DllBase, debugstr_us(nt_name) ); if (info.wm->ldr.LoadCount != -1) info.wm->ldr.LoadCount++; dlclose( handle ); /* release the libdl refcount */ } else { - TRACE_(loaddll)( "Loaded %s at %p: builtin\n", debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.BaseAddress ); + TRACE_(loaddll)( "Loaded %s at %p: builtin\n", debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.DllBase ); info.wm->ldr.LoadCount = 1; info.wm->so_handle = handle; } @@ -2920,7 +2920,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na if ((*pwm)->ldr.LoadCount != -1) (*pwm)->ldr.LoadCount++; TRACE( "Found %s for %s at %p, count=%d\n", debugstr_w((*pwm)->ldr.FullDllName.Buffer), debugstr_w(name), - (*pwm)->ldr.BaseAddress, (*pwm)->ldr.LoadCount); + (*pwm)->ldr.DllBase, (*pwm)->ldr.LoadCount); return STATUS_SUCCESS; }
@@ -3191,7 +3191,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
TRACE("Found %s for %s at %p, count=%d\n", debugstr_w((*pwm)->ldr.FullDllName.Buffer), debugstr_w(libname), - (*pwm)->ldr.BaseAddress, (*pwm)->ldr.LoadCount); + (*pwm)->ldr.DllBase, (*pwm)->ldr.LoadCount); RtlFreeUnicodeString( &nt_name ); return STATUS_SUCCESS; } @@ -3258,7 +3258,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC { /* stub-only dll, try native */ TRACE( "%s pre-attach returned FALSE, preferring native\n", debugstr_us(&nt_name) ); - LdrUnloadDll( (*pwm)->ldr.BaseAddress ); + LdrUnloadDll( (*pwm)->ldr.DllBase ); nts = STATUS_DLL_NOT_FOUND; /* map the dll again if it was unmapped */ if (!module && open_dll_file( &nt_name, pwm, &module, &image_info, &st )) break; @@ -3295,7 +3295,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
done: if (nts == STATUS_SUCCESS) - TRACE("Loaded module %s at %p\n", debugstr_us(&nt_name), (*pwm)->ldr.BaseAddress); + TRACE("Loaded module %s at %p\n", debugstr_us(&nt_name), (*pwm)->ldr.DllBase); else WARN("Failed to load module %s; status=%x\n", debugstr_w(libname), nts);
@@ -3322,11 +3322,11 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags, nts = process_attach( wm, NULL ); if (nts != STATUS_SUCCESS) { - LdrUnloadDll(wm->ldr.BaseAddress); + LdrUnloadDll(wm->ldr.DllBase); wm = NULL; } } - *hModule = (wm) ? wm->ldr.BaseAddress : NULL; + *hModule = (wm) ? wm->ldr.DllBase : NULL;
RtlLeaveCriticalSection( &loader_section ); return nts; @@ -3351,7 +3351,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S
status = find_dll_file( load_path, name->Buffer, dllW, &nt_name, &wm, &module, &image_info, &st );
- if (wm) *base = wm->ldr.BaseAddress; + if (wm) *base = wm->ldr.DllBase; else { if (status == STATUS_SUCCESS) NtUnmapViewOfSection( NtCurrentProcess(), module ); @@ -3497,8 +3497,8 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(PSYSTEM_MODULE_INFORMATION smi, if (size <= buf_size) { sm->Section = 0; /* FIXME */ - sm->MappedBaseAddress = mod->BaseAddress; - sm->ImageBaseAddress = mod->BaseAddress; + sm->MappedBaseAddress = mod->DllBase; + sm->ImageBaseAddress = mod->DllBase; sm->ImageSize = mod->SizeOfImage; sm->Flags = mod->Flags; sm->LoadOrderIndex = id++; @@ -3802,7 +3802,7 @@ static void free_modref( WINE_MODREF *wm )
SERVER_START_REQ( unload_dll ) { - req->base = wine_server_client_ptr( wm->ldr.BaseAddress ); + req->base = wine_server_client_ptr( wm->ldr.DllBase ); wine_server_call( req ); } SERVER_END_REQ; @@ -3810,7 +3810,7 @@ static void free_modref( WINE_MODREF *wm ) free_tls_slot( &wm->ldr ); RtlReleaseActivationContext( wm->ldr.ActivationContext ); if (wm->so_handle) dlclose( wm->so_handle ); - NtUnmapViewOfSection( NtCurrentProcess(), wm->ldr.BaseAddress ); + NtUnmapViewOfSection( NtCurrentProcess(), wm->ldr.DllBase ); if (cached_modref == wm) cached_modref = NULL; RtlFreeUnicodeString( &wm->ldr.FullDllName ); RtlFreeHeap( GetProcessHeap(), 0, wm->deps ); @@ -4028,7 +4028,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow } attach_implicitly_loaded_dlls( context ); virtual_release_address_space(); - if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, DLL_PROCESS_ATTACH ); + if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, DLL_PROCESS_ATTACH ); if (wm->so_handle) call_constructors( wm ); if (wm->ldr.ActivationContext) RtlDeactivateActivationContext( 0, cookie ); } @@ -4193,7 +4193,7 @@ PVOID WINAPI RtlPcToFileHeader( PVOID pc, PVOID *address ) PVOID ret = NULL;
RtlEnterCriticalSection( &loader_section ); - if (!LdrFindEntryForAddress( pc, &module )) ret = module->BaseAddress; + if (!LdrFindEntryForAddress( pc, &module )) ret = module->DllBase; RtlLeaveCriticalSection( &loader_section ); *address = ret; return ret; @@ -4525,19 +4525,19 @@ void __wine_process_init(void) exit(1); } RtlInitAnsiString( &func_name, "__wine_start_process" ); - if ((status = LdrGetProcedureAddress( wm->ldr.BaseAddress, &func_name, + if ((status = LdrGetProcedureAddress( wm->ldr.DllBase, &func_name, 0, (void **)&kernel32_start_process )) != STATUS_SUCCESS) { MESSAGE( "wine: could not find __wine_start_process in kernel32.dll, status %x\n", status ); exit(1); }
- init_locale( wm->ldr.BaseAddress ); + init_locale( wm->ldr.DllBase );
if (!(status = load_dll( params->DllPath.Buffer, params->ImagePathName.Buffer, NULL, DONT_RESOLVE_DLL_REFERENCES, &wm ))) { - peb->ImageBaseAddress = wm->ldr.BaseAddress; + peb->ImageBaseAddress = wm->ldr.DllBase; TRACE( "main exe loaded %s at %p\n", debugstr_us(¶ms->ImagePathName), peb->ImageBaseAddress ); if (wm->ldr.Flags & LDR_IMAGE_IS_DLL) { diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index f29eca24f0..9d6db9d08d 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3456,8 +3456,8 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT /* expect module to be last module listed in LdrData load order list */ mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); - ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", - data->Loaded.DllBase, mod->BaseAddress); + ok(mod->DllBase == data->Loaded.DllBase, "Expected base address %p, got %p\n", + data->Loaded.DllBase, mod->DllBase); ok(!lstrcmpiW(mod->BaseDllName.Buffer, expected_dll), "Expected %s, got %s\n", wine_dbgstr_w(expected_dll), wine_dbgstr_w(mod->BaseDllName.Buffer));
@@ -3517,9 +3517,9 @@ static void CALLBACK ldr_notify_callback_dll_main(ULONG reason, LDR_DLL_NOTIFICA
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); - ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", - data->Loaded.DllBase, mod->BaseAddress); - if (mod->BaseAddress != data->Loaded.DllBase) + ok(mod->DllBase == data->Loaded.DllBase, "Expected base address %p, got %p\n", + data->Loaded.DllBase, mod->DllBase); + if (mod->DllBase != data->Loaded.DllBase) return;
orig_entry = mod->EntryPoint; @@ -3556,9 +3556,9 @@ static void CALLBACK ldr_notify_callback_fail(ULONG reason, LDR_DLL_NOTIFICATION
mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); - ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", - data->Loaded.DllBase, mod->BaseAddress); - if (mod->BaseAddress != data->Loaded.DllBase) + ok(mod->DllBase == data->Loaded.DllBase, "Expected base address %p, got %p\n", + data->Loaded.DllBase, mod->DllBase); + if (mod->DllBase != data->Loaded.DllBase) return;
orig_entry = mod->EntryPoint; diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 89241d30b4..398f1dacfd 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -825,7 +825,7 @@ static void unload_driver( struct wine_rb_entry *entry, void *context )
TRACE_(relay)( "\1Ret driver unload %p (obj=%p)\n", driver->driver_obj.DriverUnload, &driver->driver_obj );
- FreeLibrary( ldr->BaseAddress ); + FreeLibrary( ldr->DllBase ); IoDeleteDriver( &driver->driver_obj );
set_service_status( service_handle, SERVICE_STOPPED, 0 ); diff --git a/include/winternl.h b/include/winternl.h index b246871f07..096daa3f51 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2322,7 +2322,7 @@ typedef struct _LDR_DATA_TABLE_ENTRY LIST_ENTRY InLoadOrderModuleList; LIST_ENTRY InMemoryOrderLinks; LIST_ENTRY InInitializationOrderModuleList; - void* BaseAddress; + void* DllBase; void* EntryPoint; ULONG SizeOfImage; UNICODE_STRING FullDllName; diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index 6f92362d44..4ec1daa021 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -167,7 +167,7 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base, { if (!dbg_read_memory(CONTAINING_RECORD(current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), &ldr_module, sizeof(ldr_module))) goto tls_error; - if ((DWORD_PTR)ldr_module.BaseAddress == sym->ModBase) + if ((DWORD_PTR)ldr_module.DllBase == sym->ModBase) { tlsindex = ldr_module.TlsIndex; break;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=70405
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ntdll: 18a0:rtl: unhandled exception c0000005 at 77D89D4B
=== w1064v1809_2scr (32 bit report) ===
ntdll: 1968:rtl: unhandled exception c0000005 at 77BA9D4B
=== w1064v1809_ar (32 bit report) ===
ntdll: 1114:rtl: unhandled exception c0000005 at 77219D4B
=== w1064v1809_he (32 bit report) ===
ntdll: 18f0:rtl: unhandled exception c0000005 at 77D39D4B
=== w1064v1809_ja (32 bit report) ===
ntdll: 18d8:rtl: unhandled exception c0000005 at 772B9D4B
=== w1064v1809_zh_CN (32 bit report) ===
ntdll: 1904:rtl: unhandled exception c0000005 at 77979D4B
=== debiant (build log) ===
The task timed out
=== debiant (build log) ===
The task timed out
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/module.c | 6 +++--- dlls/kernel32/tests/loader.c | 2 +- dlls/kernel32/toolhelp.c | 4 ++-- dlls/ntdll/loader.c | 42 ++++++++++++++++++------------------ include/winternl.h | 4 ++-- programs/winedbg/symbol.c | 4 ++-- 6 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 3188e43562..1f9117c8d7 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -488,11 +488,11 @@ static int module_iterator_next(MODULE_ITERATOR *iter) }
if (!ReadProcessMemory(iter->process, - CONTAINING_RECORD(iter->current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), + CONTAINING_RECORD(iter->current, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks), &iter->ldr_module, sizeof(iter->ldr_module), NULL)) return -1;
- iter->current = iter->ldr_module.InLoadOrderModuleList.Flink; + iter->current = iter->ldr_module.InLoadOrderLinks.Flink; return 1; }
@@ -569,7 +569,7 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, while (entry != head) { PLDR_DATA_TABLE_ENTRY table_entry = (PLDR_DATA_TABLE_ENTRY) - ((PBYTE)entry - offsetof(LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList)); + ((PBYTE)entry - offsetof(LDR_DATA_TABLE_ENTRY, InLoadOrderLinks)); if (cb >= sizeof(HMODULE)) { *lphModule++ = table_entry->DllBase; diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 2164440494..5474d54324 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -3815,7 +3815,7 @@ static void test_InMemoryOrderModuleList(void) entry1 != mark1 && entry2 != mark2; entry1 = entry1->Flink, entry2 = entry2->Flink) { - module1 = CONTAINING_RECORD(entry1, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + module1 = CONTAINING_RECORD(entry1, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(module1 == module2, "expected module1 == module2, got %p and %p\n", module1, module2); } diff --git a/dlls/kernel32/toolhelp.c b/dlls/kernel32/toolhelp.c index 77feec64fc..fbac362997 100644 --- a/dlls/kernel32/toolhelp.c +++ b/dlls/kernel32/toolhelp.c @@ -116,11 +116,11 @@ static BOOL fetch_module( DWORD process, DWORD flags, LDR_DATA_TABLE_ENTRY **ldr if (!*ldr_mod) break; if (!ReadProcessMemory( hProcess, CONTAINING_RECORD(curr, LDR_DATA_TABLE_ENTRY, - InLoadOrderModuleList), + InLoadOrderLinks), &(*ldr_mod)[*num], sizeof(LDR_DATA_TABLE_ENTRY), NULL)) break; - curr = (*ldr_mod)[*num].InLoadOrderModuleList.Flink; + curr = (*ldr_mod)[*num].InLoadOrderLinks.Flink; /* if we cannot fetch the strings, then just ignore this LDR_DATA_TABLE_ENTRY * and continue loading the other ones in the list */ diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 9f4d254c95..16024e3549 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -505,7 +505,7 @@ static WINE_MODREF *find_basename_module( LPCWSTR name ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); @@ -537,7 +537,7 @@ static WINE_MODREF *find_fullname_module( const UNICODE_STRING *nt_name ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); if (RtlEqualUnicodeString( &name, &mod->FullDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); @@ -564,7 +564,7 @@ static WINE_MODREF *find_fileid_module( struct stat *st ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList ); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks ); WINE_MODREF *wm = CONTAINING_RECORD( mod, WINE_MODREF, ldr );
if (wm->dev == st->st_dev && wm->ino == st->st_ino) @@ -590,7 +590,7 @@ static WINE_MODREF *find_so_module( void *handle ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList ); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks ); WINE_MODREF *wm = CONTAINING_RECORD( mod, WINE_MODREF, ldr );
if (wm->so_handle == handle) return wm; @@ -1224,7 +1224,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name }
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, - &wm->ldr.InLoadOrderModuleList); + &wm->ldr.InLoadOrderLinks); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks); /* wait until init is called for inserting into InInitializationOrderModuleList */ @@ -1474,9 +1474,9 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved ) if ((status = process_attach( wm->deps[i], lpReserved )) != STATUS_SUCCESS) break; }
- if (!wm->ldr.InInitializationOrderModuleList.Flink) + if (!wm->ldr.InInitializationOrderLinks.Flink) InsertTailList(&NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList, - &wm->ldr.InInitializationOrderModuleList); + &wm->ldr.InInitializationOrderLinks);
/* Call DLL entry point */ if (status == STATUS_SUCCESS) @@ -1526,7 +1526,7 @@ static void attach_implicitly_loaded_dlls( LPVOID reserved ) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
if (!(mod->Flags & LDR_IMAGE_IS_DLL)) continue; if (mod->Flags & (LDR_LOAD_IN_PROGRESS | LDR_PROCESS_ATTACHED)) continue; @@ -1557,7 +1557,7 @@ static void process_detach(void) for (entry = mark->Blink; entry != mark; entry = entry->Blink) { mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, - InInitializationOrderModuleList); + InInitializationOrderLinks); /* Check whether to detach this DLL */ if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) continue; @@ -1593,7 +1593,7 @@ static void thread_attach(void) for (entry = mark->Flink; entry != mark; entry = entry->Flink) { mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, - InInitializationOrderModuleList); + InInitializationOrderLinks); if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) continue; if ( mod->Flags & LDR_NO_DLL_CALLS ) @@ -2028,7 +2028,7 @@ static NTSTATUS build_so_dll_module( const WCHAR *load_path, const UNICODE_STRIN if ((status = fixup_imports( wm, load_path ))) { /* the module has only been inserted in the load & memory order lists */ - RemoveEntryList(&wm->ldr.InLoadOrderModuleList); + RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks); /* FIXME: free the modref */ return status; @@ -2571,7 +2571,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam if (status != STATUS_SUCCESS) { /* the module has only be inserted in the load & memory order lists */ - RemoveEntryList(&wm->ldr.InLoadOrderModuleList); + RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
/* FIXME: there are several more dangling references @@ -3492,7 +3492,7 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(PSYSTEM_MODULE_INFORMATION smi, mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); size += sizeof(*sm); if (size <= buf_size) { @@ -3758,7 +3758,7 @@ void WINAPI LdrShutdownThread(void) for (entry = mark->Blink; entry != mark; entry = entry->Blink) { mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, - InInitializationOrderModuleList); + InInitializationOrderLinks); if ( !(mod->Flags & LDR_PROCESS_ATTACHED) ) continue; if ( mod->Flags & LDR_NO_DLL_CALLS ) @@ -3789,10 +3789,10 @@ void WINAPI LdrShutdownThread(void) */ static void free_modref( WINE_MODREF *wm ) { - RemoveEntryList(&wm->ldr.InLoadOrderModuleList); + RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks); - if (wm->ldr.InInitializationOrderModuleList.Flink) - RemoveEntryList(&wm->ldr.InInitializationOrderModuleList); + if (wm->ldr.InInitializationOrderLinks.Flink) + RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
TRACE(" unloading %s\n", debugstr_w(wm->ldr.FullDllName.Buffer)); if (!TRACE_ON(module)) @@ -3834,7 +3834,7 @@ static void MODULE_FlushModrefs(void) mark = &NtCurrentTeb()->Peb->LdrData->InInitializationOrderModuleList; for (entry = mark->Blink; entry != mark; entry = prev) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks); wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr); prev = entry->Blink; if (!mod->LoadCount) free_modref( wm ); @@ -3844,7 +3844,7 @@ static void MODULE_FlushModrefs(void) mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Blink; entry != mark; entry = prev) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr); prev = entry->Blink; if (!mod->LoadCount) free_modref( wm ); @@ -4576,8 +4576,8 @@ void __wine_process_init(void) virtual_set_large_address_space();
/* the main exe needs to be the first in the load order list */ - RemoveEntryList( &wm->ldr.InLoadOrderModuleList ); - InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList ); + RemoveEntryList( &wm->ldr.InLoadOrderLinks ); + InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks ); RemoveEntryList( &wm->ldr.InMemoryOrderLinks ); InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks );
diff --git a/include/winternl.h b/include/winternl.h index 096daa3f51..87d0bde295 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2319,9 +2319,9 @@ typedef enum _LDR_DLL_LOAD_REASON
typedef struct _LDR_DATA_TABLE_ENTRY { - LIST_ENTRY InLoadOrderModuleList; + LIST_ENTRY InLoadOrderLinks; LIST_ENTRY InMemoryOrderLinks; - LIST_ENTRY InInitializationOrderModuleList; + LIST_ENTRY InInitializationOrderLinks; void* DllBase; void* EntryPoint; ULONG SizeOfImage; diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index 4ec1daa021..bd94123bdb 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -165,14 +165,14 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base, head = &((PEB_LDR_DATA*)peb.LdrData)->InLoadOrderModuleList; do { - if (!dbg_read_memory(CONTAINING_RECORD(current, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList), + if (!dbg_read_memory(CONTAINING_RECORD(current, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks), &ldr_module, sizeof(ldr_module))) goto tls_error; if ((DWORD_PTR)ldr_module.DllBase == sym->ModBase) { tlsindex = ldr_module.TlsIndex; break; } - current = ldr_module.InLoadOrderModuleList.Flink; + current = ldr_module.InLoadOrderLinks.Flink; } while (current != head);
addr += tlsindex * sizeof(DWORD_PTR);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=70406
Your paranoid android.
=== w1064v1809_zh_CN (32 bit report) ===
kernel32: loader.c:3215: Test failed: child process failed to terminate
=== w864 (64 bit report) ===
kernel32: loader.c:696: Test failed: 1172: wrong status c0000130/c000007b loader.c:696: Test failed: 1177: wrong status c0000130/c000007b loader.c:696: Test failed: 1182: wrong status c0000130/c000007b
=== w1064v1809 (64 bit report) ===
kernel32: loader.c:692: Test failed: 1392: got test dll but expected fallback loader.c:692: Test failed: 1398: got test dll but expected fallback loader.c:692: Test failed: 1404: got test dll but expected fallback loader.c:692: Test failed: 1411: got test dll but expected fallback loader.c:692: Test failed: 1438: got test dll but expected fallback
=== debiant (build log) ===
The task timed out
=== debiant (build log) ===
The task timed out
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=70403
Your paranoid android.
=== w1064v1809_ar (32 bit report) ===
kernel32: loader.c:3215: Test failed: child process failed to terminate
=== w1064v1809_he (32 bit report) ===
kernel32: loader.c:3215: Test failed: child process failed to terminate
=== w1064v1809_ja (32 bit report) ===
kernel32: loader.c:3215: Test failed: child process failed to terminate
=== w1064v1809_zh_CN (32 bit report) ===
kernel32: loader.c:3187: Test failed: child process failed to terminate
=== w864 (64 bit report) ===
kernel32: loader.c:696: Test failed: 1172: wrong status c0000130/c000007b loader.c:696: Test failed: 1177: wrong status c0000130/c000007b
=== w1064v1809 (64 bit report) ===
kernel32: loader.c:692: Test failed: 1392: got test dll but expected fallback loader.c:692: Test failed: 1398: got test dll but expected fallback loader.c:692: Test failed: 1404: got test dll but expected fallback loader.c:692: Test failed: 1411: got test dll but expected fallback loader.c:692: Test failed: 1438: got test dll but expected fallback
=== w1064v1809 (32 bit report) ===
ntdll: 1808:rtl: unhandled exception c0000005 at 77D89D4B
=== w1064v1809_2scr (32 bit report) ===
ntdll: 195c:rtl: unhandled exception c0000005 at 77BA9D4B
=== w1064v1809_ar (32 bit report) ===
ntdll: 06f4:rtl: unhandled exception c0000005 at 77219D4B
=== w1064v1809_he (32 bit report) ===
ntdll: 0e64:rtl: unhandled exception c0000005 at 77D39D4B
=== w1064v1809_ja (32 bit report) ===
ntdll: 19b8:rtl: unhandled exception c0000005 at 772B9D4B
=== w1064v1809_zh_CN (32 bit report) ===
ntdll: 1854:rtl: unhandled exception c0000005 at 77979D4B
=== debiant (build log) ===
The task timed out
=== debiant (build log) ===
The task timed out