From d7080ec990e4d4059adb2e0035979f997f9d0625 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 22 Jun 2023 14:19:23 +1000 Subject: [PATCH] Rebase against 81859c9af70aa5ed6da3060488d1815a3607c291. --- ...t-HashLinks-field-in-LDR-module-data.patch | 30 +++++++++---------- staging/upstream-commit | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch b/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch index f0785c80..7fd99f33 100644 --- a/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch +++ b/patches/ntdll-HashLinks/0001-ntdll-Implement-HashLinks-field-in-LDR-module-data.patch @@ -1,4 +1,4 @@ -From eb96135501ef2822072e8f774868dd55ab3935ba Mon Sep 17 00:00:00 2001 +From 5f029b7fcffc7b537a02523dc793ec2b4069390a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 3 Apr 2017 05:30:27 +0200 Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data. @@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data. 2 files changed, 117 insertions(+) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 365f4465fc7..aca2b0f24cb 100644 +index 2c9e97d7fc7..9a538edf7ab 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -30,6 +30,7 @@ +@@ -28,6 +28,7 @@ #include "winbase.h" #include "winternl.h" #include "winnls.h" @@ -20,7 +20,7 @@ index 365f4465fc7..aca2b0f24cb 100644 #include "wine/test.h" #include "delayloadhandler.h" -@@ -4056,6 +4057,79 @@ static void test_Wow64Transition(void) +@@ -4205,6 +4206,79 @@ static void test_Wow64Transition(void) debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR))); } @@ -100,7 +100,7 @@ index 365f4465fc7..aca2b0f24cb 100644 START_TEST(loader) { int argc; -@@ -4128,6 +4202,7 @@ START_TEST(loader) +@@ -4286,6 +4360,7 @@ START_TEST(loader) test_InMemoryOrderModuleList(); test_LoadPackagedLibrary(); test_wow64_redirection(); @@ -109,10 +109,10 @@ index 365f4465fc7..aca2b0f24cb 100644 test_dll_file( "kernel32.dll" ); test_dll_file( "advapi32.dll" ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index cbd2fa2d384..693ba94dc71 100644 +index d548ecea944..95ed846dc10 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -129,6 +129,9 @@ struct file_id +@@ -132,6 +132,9 @@ struct file_id BYTE ObjectId[16]; }; @@ -122,7 +122,7 @@ index cbd2fa2d384..693ba94dc71 100644 /* internal representation of loaded modules */ typedef struct _wine_modref { -@@ -498,6 +501,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) +@@ -501,6 +504,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) } } @@ -156,7 +156,7 @@ index cbd2fa2d384..693ba94dc71 100644 /************************************************************************* * get_modref * -@@ -1477,7 +1507,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name +@@ -1475,7 +1505,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name &wm->ldr.InLoadOrderLinks); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks); @@ -169,7 +169,7 @@ index cbd2fa2d384..693ba94dc71 100644 if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) { -@@ -2155,6 +2190,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, +@@ -2153,6 +2188,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); @@ -177,7 +177,7 @@ index cbd2fa2d384..693ba94dc71 100644 /* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the -@@ -3796,6 +3832,7 @@ static void free_modref( WINE_MODREF *wm ) +@@ -3830,6 +3866,7 @@ static void free_modref( WINE_MODREF *wm ) RemoveEntryList(&wm->ldr.InLoadOrderLinks); RemoveEntryList(&wm->ldr.InMemoryOrderLinks); @@ -185,7 +185,7 @@ index cbd2fa2d384..693ba94dc71 100644 if (wm->ldr.InInitializationOrderLinks.Flink) RemoveEntryList(&wm->ldr.InInitializationOrderLinks); -@@ -4167,6 +4204,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR +@@ -4205,6 +4242,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; @@ -193,9 +193,9 @@ index cbd2fa2d384..693ba94dc71 100644 NtQueryVirtualMemory( GetCurrentProcess(), LdrInitializeThunk, MemoryBasicInformation, &meminfo, sizeof(meminfo), NULL ); -@@ -4184,6 +4222,10 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR - /* TLS index 0 is always reserved, and wow64 reserves extra TLS entries */ +@@ -4223,6 +4261,10 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR RtlSetBits( peb->TlsBitmap, 0, NtCurrentTeb()->WowTebOffset ? WOW64_TLS_MAX_NUMBER : 1 ); + RtlSetBits( peb->TlsBitmap, NTDLL_TLS_ERRNO, 1 ); + /* initialize hash table */ + for (i = 0; i < HASH_MAP_SIZE; i++) @@ -205,5 +205,5 @@ index cbd2fa2d384..693ba94dc71 100644 load_global_options(); version_init(); -- -2.39.2 +2.40.1 diff --git a/staging/upstream-commit b/staging/upstream-commit index de37599d..69bbe69c 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -5da3827d863ae43f8367cdafbeba73cec7cdee3d +81859c9af70aa5ed6da3060488d1815a3607c291