Rebase against f712a98d12d091c5437159a291857dfb9f0cea7c.

This commit is contained in:
Alistair Leslie-Hughes
2021-10-21 09:41:51 +11:00
parent 164b361be6
commit feb91195ff
31 changed files with 88 additions and 6498 deletions

View File

@@ -1,4 +1,4 @@
From 2849190768a826d888577c820c52a593b660b64e Mon Sep 17 00:00:00 2001
From 187108be05dcf7521646c22f637627147d9bbdb3 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.
@@ -6,11 +6,10 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
---
dlls/kernel32/tests/loader.c | 75 ++++++++++++++++++++++++++++++++++++
dlls/ntdll/loader.c | 41 ++++++++++++++++++++
include/winternl.h | 2 +-
3 files changed, 117 insertions(+), 1 deletion(-)
2 files changed, 116 insertions(+)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 1db68a191a3..bec46088518 100644
index 4f1b11338a6..56cd5a88e20 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -30,6 +30,7 @@
@@ -21,7 +20,7 @@ index 1db68a191a3..bec46088518 100644
#include "wine/test.h"
#include "delayloadhandler.h"
@@ -4031,6 +4032,79 @@ static void test_Wow64Transition(void)
@@ -4036,6 +4037,79 @@ static void test_Wow64Transition(void)
debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR)));
}
@@ -101,7 +100,7 @@ index 1db68a191a3..bec46088518 100644
START_TEST(loader)
{
int argc;
@@ -4103,6 +4177,7 @@ START_TEST(loader)
@@ -4108,6 +4182,7 @@ START_TEST(loader)
test_InMemoryOrderModuleList();
test_LoadPackagedLibrary();
test_wow64_redirection();
@@ -110,10 +109,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 f3a37d4e8a6..eb0f3f8741c 100644
index 65d684e555c..644d531d8f8 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -124,6 +124,9 @@ struct file_id
@@ -129,6 +129,9 @@ struct file_id
BYTE ObjectId[16];
};
@@ -123,7 +122,7 @@ index f3a37d4e8a6..eb0f3f8741c 100644
/* internal representation of loaded modules */
typedef struct _wine_modref
{
@@ -469,6 +472,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
@@ -477,6 +480,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
}
}
@@ -157,7 +156,7 @@ index f3a37d4e8a6..eb0f3f8741c 100644
/*************************************************************************
* get_modref
*
@@ -1245,7 +1275,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
@@ -1253,7 +1283,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
&wm->ldr.InLoadOrderLinks);
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
&wm->ldr.InMemoryOrderLinks);
@@ -170,7 +169,7 @@ index f3a37d4e8a6..eb0f3f8741c 100644
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
{
@@ -1925,6 +1960,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
@@ -1933,6 +1968,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);
@@ -178,7 +177,7 @@ index f3a37d4e8a6..eb0f3f8741c 100644
/* FIXME: there are several more dangling references
* left. Including dlls loaded by this dll before the
@@ -3427,6 +3463,7 @@ static void free_modref( WINE_MODREF *wm )
@@ -3518,6 +3554,7 @@ static void free_modref( WINE_MODREF *wm )
{
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
@@ -186,7 +185,7 @@ index f3a37d4e8a6..eb0f3f8741c 100644
if (wm->ldr.InInitializationOrderLinks.Flink)
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
@@ -3751,6 +3788,10 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
@@ -3881,6 +3918,10 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
sizeof(peb->TlsExpansionBitmapBits) * 8 );
RtlSetBits( peb->TlsBitmap, 0, 1 ); /* TLS index 0 is reserved and should be initialized to NULL. */
@@ -197,20 +196,6 @@ index f3a37d4e8a6..eb0f3f8741c 100644
init_user_process_params();
load_global_options();
version_init();
diff --git a/include/winternl.h b/include/winternl.h
index 7221c0632b0..b8227b4583f 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -3310,8 +3310,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY
ULONG Flags;
SHORT LoadCount;
SHORT TlsIndex;
- HANDLE SectionHandle;
ULONG CheckSum;
+ LIST_ENTRY HashLinks;
ULONG TimeDateStamp;
HANDLE ActivationContext;
void* Lock;
--
2.30.2
2.33.0