Rebase against 12cfe6826773708e3b15f73b9674ccb959000d8b.

This commit is contained in:
Zebediah Figura
2021-03-24 16:48:35 -05:00
parent a644c49d6d
commit f20c33fa04
10 changed files with 85 additions and 664 deletions

View File

@@ -1,4 +1,4 @@
From 0a07ca826c7991b6c4e2455ff374e6fee4f93b93 Mon Sep 17 00:00:00 2001
From 45940635b59cf3183e26ab3ffd2b8f486161e5ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 3 Apr 2017 05:30:27 +0200
Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
@@ -110,10 +110,10 @@ index 1db68a191a3..bec46088518 100644
test_dll_file( "kernel32.dll" );
test_dll_file( "advapi32.dll" );
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 6c86e6b2e6c..b8d6adaf390 100644
index 01644df7763..8c6d05cb94e 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -114,6 +114,9 @@ struct file_id
@@ -112,6 +112,9 @@ struct file_id
BYTE ObjectId[16];
};
@@ -123,7 +123,7 @@ index 6c86e6b2e6c..b8d6adaf390 100644
/* internal representation of loaded modules */
typedef struct _wine_modref
{
@@ -453,6 +456,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
@@ -450,6 +453,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
}
}
@@ -176,7 +176,7 @@ index 6c86e6b2e6c..b8d6adaf390 100644
/*************************************************************************
* get_modref
*
@@ -1195,7 +1244,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
@@ -1196,7 +1245,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
&wm->ldr.InLoadOrderLinks);
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
&wm->ldr.InMemoryOrderLinks);
@@ -189,7 +189,7 @@ index 6c86e6b2e6c..b8d6adaf390 100644
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
{
@@ -1873,6 +1927,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
@@ -1876,6 +1930,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
/* the module has only be inserted in the load & memory order lists */
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
@@ -197,7 +197,7 @@ index 6c86e6b2e6c..b8d6adaf390 100644
/* FIXME: there are several more dangling references
* left. Including dlls loaded by this dll before the
@@ -3246,6 +3301,7 @@ static void free_modref( WINE_MODREF *wm )
@@ -3277,6 +3332,7 @@ static void free_modref( WINE_MODREF *wm )
{
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
@@ -205,7 +205,7 @@ index 6c86e6b2e6c..b8d6adaf390 100644
if (wm->ldr.InInitializationOrderLinks.Flink)
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
@@ -3973,6 +4029,7 @@ static NTSTATUS process_init(void)
@@ -3979,6 +4035,7 @@ static NTSTATUS process_init(void)
INITIAL_TEB stack;
TEB *teb = NtCurrentTeb();
PEB *peb = teb->Peb;
@@ -213,18 +213,18 @@ index 6c86e6b2e6c..b8d6adaf390 100644
peb->LdrData = &ldr;
peb->FastPebLock = &peb_lock;
@@ -4006,6 +4063,10 @@ static NTSTATUS process_init(void)
load_global_options();
version_init();
@@ -4002,6 +4059,10 @@ static NTSTATUS process_init(void)
InitializeListHead( &ldr.InMemoryOrderModuleList );
InitializeListHead( &ldr.InInitializationOrderModuleList );
+ /* initialize hash table */
+ for (i = 0; i < HASH_MAP_SIZE; i++)
+ InitializeListHead(&hash_table[i]);
+
if (!(status = load_dll( params->DllPath.Buffer, params->ImagePathName.Buffer, NULL,
DONT_RESOLVE_DLL_REFERENCES, &wm )))
{
@@ -4094,6 +4155,10 @@ static NTSTATUS process_init(void)
#ifndef _WIN64
is_wow64 = !!NtCurrentTeb64();
#endif
@@ -4050,6 +4111,10 @@ static NTSTATUS process_init(void)
teb->Tib.StackBase = stack.StackBase;
teb->Tib.StackLimit = stack.StackLimit;
teb->DeallocationStack = stack.DeallocationStack;
@@ -236,10 +236,10 @@ index 6c86e6b2e6c..b8d6adaf390 100644
}
diff --git a/include/winternl.h b/include/winternl.h
index f0ab223ef2e..b6676717436 100644
index fcdedaec8aa..6ea72da54f7 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2794,8 +2794,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY
@@ -3040,8 +3040,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY
ULONG Flags;
SHORT LoadCount;
SHORT TlsIndex;
@@ -250,5 +250,5 @@ index f0ab223ef2e..b6676717436 100644
HANDLE ActivationContext;
void* Lock;
--
2.20.1
2.30.2