Rebase against 3c2db20f66806074b047b0b3c76aa86ad79e3175.

This commit is contained in:
Zebediah Figura
2021-03-01 16:31:44 -06:00
parent 15f4220e49
commit 6b24c39d32
12 changed files with 78 additions and 288 deletions

View File

@@ -1,4 +1,4 @@
From 676ef7076ef33a21649a07acdc5e6e7fee761165 Mon Sep 17 00:00:00 2001
From 0a07ca826c7991b6c4e2455ff374e6fee4f93b93 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.
@@ -10,7 +10,7 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
3 files changed, 141 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 861fc321729..28b0edacd0a 100644
index 1db68a191a3..bec46088518 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -30,6 +30,7 @@
@@ -21,8 +21,8 @@ index 861fc321729..28b0edacd0a 100644
#include "wine/test.h"
#include "delayloadhandler.h"
@@ -4003,6 +4004,79 @@ static void test_LoadPackagedLibrary(void)
h, GetLastError());
@@ -4031,6 +4032,79 @@ static void test_Wow64Transition(void)
debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR)));
}
+static inline WCHAR toupperW(WCHAR c)
@@ -101,7 +101,7 @@ index 861fc321729..28b0edacd0a 100644
START_TEST(loader)
{
int argc;
@@ -4075,6 +4149,7 @@ START_TEST(loader)
@@ -4103,6 +4177,7 @@ START_TEST(loader)
test_InMemoryOrderModuleList();
test_LoadPackagedLibrary();
test_wow64_redirection();
@@ -110,10 +110,10 @@ index 861fc321729..28b0edacd0a 100644
test_dll_file( "kernel32.dll" );
test_dll_file( "advapi32.dll" );
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index dad7bae6ccf..0727d4d15f5 100644
index 6c86e6b2e6c..b8d6adaf390 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -115,6 +115,9 @@ struct file_id
@@ -114,6 +114,9 @@ struct file_id
BYTE ObjectId[16];
};
@@ -123,7 +123,7 @@ index dad7bae6ccf..0727d4d15f5 100644
/* internal representation of loaded modules */
typedef struct _wine_modref
{
@@ -455,6 +458,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
@@ -453,6 +456,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
}
}
@@ -176,7 +176,7 @@ index dad7bae6ccf..0727d4d15f5 100644
/*************************************************************************
* get_modref
*
@@ -1197,7 +1246,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
@@ -1195,7 +1244,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 dad7bae6ccf..0727d4d15f5 100644
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
{
@@ -1904,6 +1958,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
@@ -1873,6 +1927,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 dad7bae6ccf..0727d4d15f5 100644
/* FIXME: there are several more dangling references
* left. Including dlls loaded by this dll before the
@@ -3291,6 +3346,7 @@ static void free_modref( WINE_MODREF *wm )
@@ -3246,6 +3301,7 @@ static void free_modref( WINE_MODREF *wm )
{
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
@@ -205,7 +205,7 @@ index dad7bae6ccf..0727d4d15f5 100644
if (wm->ldr.InInitializationOrderLinks.Flink)
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
@@ -4010,6 +4066,7 @@ static NTSTATUS process_init(void)
@@ -3973,6 +4029,7 @@ static NTSTATUS process_init(void)
INITIAL_TEB stack;
TEB *teb = NtCurrentTeb();
PEB *peb = teb->Peb;
@@ -213,7 +213,7 @@ index dad7bae6ccf..0727d4d15f5 100644
peb->LdrData = &ldr;
peb->FastPebLock = &peb_lock;
@@ -4046,6 +4103,10 @@ static NTSTATUS process_init(void)
@@ -4006,6 +4063,10 @@ static NTSTATUS process_init(void)
load_global_options();
version_init();
@@ -224,7 +224,7 @@ index dad7bae6ccf..0727d4d15f5 100644
if (!(status = load_dll( params->DllPath.Buffer, params->ImagePathName.Buffer, NULL,
DONT_RESOLVE_DLL_REFERENCES, &wm )))
{
@@ -4133,6 +4194,10 @@ static NTSTATUS process_init(void)
@@ -4094,6 +4155,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 dad7bae6ccf..0727d4d15f5 100644
}
diff --git a/include/winternl.h b/include/winternl.h
index 2ff60a35004..8cc8a166608 100644
index f0ab223ef2e..b6676717436 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2731,8 +2731,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY
@@ -2794,8 +2794,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY
ULONG Flags;
SHORT LoadCount;
SHORT TlsIndex;
@@ -250,5 +250,5 @@ index 2ff60a35004..8cc8a166608 100644
HANDLE ActivationContext;
void* Lock;
--
2.29.2
2.20.1