diff --git a/patches/advapi32-Token_Integrity_Level/0008-ntdll-Implement-process-token-elevation-through-mani.patch b/patches/advapi32-Token_Integrity_Level/0008-ntdll-Implement-process-token-elevation-through-mani.patch index 1eace01e..e5e57657 100644 --- a/patches/advapi32-Token_Integrity_Level/0008-ntdll-Implement-process-token-elevation-through-mani.patch +++ b/patches/advapi32-Token_Integrity_Level/0008-ntdll-Implement-process-token-elevation-through-mani.patch @@ -1,4 +1,4 @@ -From 6a09d34647aa517e45bc0bb20a92d0d94a1da888 Mon Sep 17 00:00:00 2001 +From 2f03ded51b6f537ac6a4f3bfb51e1d0998a27c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 5 Aug 2017 03:39:55 +0200 Subject: [PATCH] ntdll: Implement process token elevation through manifests. @@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Implement process token elevation through manifests. 5 files changed, 67 insertions(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 2f203447e..7c5dd308b 100644 +index 38c893e3eb4..d32b57612d5 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -3804,6 +3804,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -4045,6 +4045,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow } @@ -48,7 +48,7 @@ index 2f203447e..7c5dd308b 100644 /*********************************************************************** * load_global_options */ -@@ -4233,6 +4259,7 @@ void __wine_process_init(void) +@@ -4478,6 +4504,7 @@ void __wine_process_init(void) 's','y','s','t','e','m','3','2','\\', 'k','e','r','n','e','l','3','2','.','d','l','l',0}; RTL_USER_PROCESS_PARAMETERS *params; @@ -56,7 +56,7 @@ index 2f203447e..7c5dd308b 100644 WINE_MODREF *wm; NTSTATUS status; ANSI_STRING func_name; -@@ -4324,6 +4351,16 @@ void __wine_process_init(void) +@@ -4575,6 +4602,16 @@ void __wine_process_init(void) virtual_set_large_address_space(); @@ -71,10 +71,10 @@ index 2f203447e..7c5dd308b 100644 + } + /* 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 ); diff --git a/server/process.c b/server/process.c -index 4c7da9223..d6f71a774 100644 +index 4c7da9223c1..d6f71a774f3 100644 --- a/server/process.c +++ b/server/process.c @@ -1107,6 +1107,14 @@ struct process_snapshot *process_snap( int *count ) @@ -93,7 +93,7 @@ index 4c7da9223..d6f71a774 100644 DECL_HANDLER(new_process) { diff --git a/server/process.h b/server/process.h -index 5b83e111a..dfe5c4e52 100644 +index 5b83e111a6f..dfe5c4e52d8 100644 --- a/server/process.h +++ b/server/process.h @@ -139,6 +139,7 @@ extern void kill_debugged_processes( struct thread *debugger, int exit_code ); @@ -105,10 +105,10 @@ index 5b83e111a..dfe5c4e52 100644 /* console functions */ extern void inherit_console( struct thread *parent_thread, struct process *parent, diff --git a/server/protocol.def b/server/protocol.def -index 6022e1715..45ab670ea 100644 +index 68c66bc2fcb..55c821ac1e2 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3755,6 +3755,13 @@ struct handle_info +@@ -3762,6 +3762,13 @@ struct handle_info @END @@ -123,10 +123,10 @@ index 6022e1715..45ab670ea 100644 @REQ(create_completion) unsigned int access; /* desired access to a port */ diff --git a/server/token.c b/server/token.c -index fcab79955..181219d21 100644 +index 970ed1838da..1c1d49989b3 100644 --- a/server/token.c +++ b/server/token.c -@@ -1806,3 +1806,17 @@ DECL_HANDLER(create_token) +@@ -1804,3 +1804,17 @@ DECL_HANDLER(create_token) release_object( token ); } } @@ -145,5 +145,5 @@ index fcab79955..181219d21 100644 + } +} -- -2.24.0 +2.26.0 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 72b94b63..543be2d6 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 36780c821f4ea99a93920625a6f6106a84883eb9 Mon Sep 17 00:00:00 2001 +From d2813193e018878f99328e6a1a84a484f1ff6ac4 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. @@ -10,7 +10,7 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data. 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 35c6b3c0996..17d742daaa7 100644 +index 5474d543248..2d382d4f326 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -30,6 +30,7 @@ @@ -60,13 +60,13 @@ index 35c6b3c0996..17d742daaa7 100644 + static WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0}; + + LIST_ENTRY *hash_map, *entry, *mark; -+ LDR_MODULE *module; ++ LDR_DATA_TABLE_ENTRY *module; + BOOL found; + + entry = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; + entry = entry->Flink; + -+ module = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); ++ module = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + entry = module->HashLinks.Blink; + + hash_map = entry - hash_basename(module->BaseDllName.Buffer); @@ -75,7 +75,7 @@ index 35c6b3c0996..17d742daaa7 100644 + found = FALSE; + for (entry = mark->Flink; entry != mark; entry = entry->Flink) + { -+ module = CONTAINING_RECORD(entry, LDR_MODULE, HashLinks); ++ module = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, HashLinks); + if (!lstrcmpiW(module->BaseDllName.Buffer, ntdllW)) + { + found = TRUE; @@ -88,7 +88,7 @@ index 35c6b3c0996..17d742daaa7 100644 + found = FALSE; + for (entry = mark->Flink; entry != mark; entry = entry->Flink) + { -+ module = CONTAINING_RECORD(entry, LDR_MODULE, HashLinks); ++ module = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, HashLinks); + if (!lstrcmpiW(module->BaseDllName.Buffer, kernel32W)) + { + found = TRUE; @@ -115,7 +115,7 @@ index 35c6b3c0996..17d742daaa7 100644 test_Loader(); } diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 04ea7ea121a..2a8b4b3ad97 100644 +index 38c893e3eb4..c226c467cd2 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -122,6 +122,9 @@ static const char * const reason_names[] = @@ -128,7 +128,7 @@ index 04ea7ea121a..2a8b4b3ad97 100644 /* internal representation of 32bit modules. per process. */ typedef struct _wine_modref { -@@ -462,6 +465,52 @@ static void call_ldr_notifications( ULONG reason, LDR_MODULE *module ) +@@ -462,6 +465,52 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module ) } } @@ -166,13 +166,13 @@ index 04ea7ea121a..2a8b4b3ad97 100644 + */ +static void recompute_hash_map(void) +{ -+ PLIST_ENTRY mark, entry; -+ PLDR_MODULE mod; ++ LIST_ENTRY *mark, *entry; ++ LDR_DATA_TABLE_ENTRY *mod; + + 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, InLoadOrderLinks); + RemoveEntryList( &mod->HashLinks ); + InsertTailList( &hash_table[hash_basename(mod->BaseDllName.Buffer)], &mod->HashLinks ); + } @@ -182,41 +182,41 @@ index 04ea7ea121a..2a8b4b3ad97 100644 * get_modref * @@ -1227,7 +1276,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name - &wm->ldr.InLoadOrderModuleList); + &wm->ldr.InLoadOrderLinks); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, - &wm->ldr.InMemoryOrderModuleList); + &wm->ldr.InMemoryOrderLinks); + InsertTailList(&hash_table[hash_basename(wm->ldr.BaseDllName.Buffer)], + &wm->ldr.HashLinks); + /* wait until init is called for inserting into InInitializationOrderModuleList */ -+ wm->ldr.InInitializationOrderModuleList.Flink = NULL; -+ wm->ldr.InInitializationOrderModuleList.Blink = NULL; ++ wm->ldr.InInitializationOrderLinks.Flink = NULL; ++ wm->ldr.InInitializationOrderLinks.Blink = NULL; if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) { @@ -2030,6 +2084,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.InLoadOrderLinks); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); + RemoveEntryList(&wm->ldr.HashLinks); /* FIXME: free the modref */ return status; } @@ -2573,6 +2628,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.InLoadOrderLinks); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); + RemoveEntryList(&wm->ldr.HashLinks); /* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the @@ -3791,6 +3847,7 @@ static void free_modref( WINE_MODREF *wm ) { - RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InLoadOrderLinks); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); + RemoveEntryList(&wm->ldr.HashLinks); - if (wm->ldr.InInitializationOrderModuleList.Flink) - RemoveEntryList(&wm->ldr.InInitializationOrderModuleList); + if (wm->ldr.InInitializationOrderLinks.Flink) + RemoveEntryList(&wm->ldr.InInitializationOrderLinks); @@ -4488,6 +4545,7 @@ void __wine_process_init(void) SIZE_T info_size; @@ -247,10 +247,10 @@ index 04ea7ea121a..2a8b4b3ad97 100644 server_init_process_done(); } diff --git a/include/winternl.h b/include/winternl.h -index f36419da782..20b267cd294 100644 +index 87d0bde2955..a6039dc2d40 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -2330,8 +2330,8 @@ typedef struct _LDR_MODULE +@@ -2330,8 +2330,8 @@ typedef struct _LDR_DATA_TABLE_ENTRY ULONG Flags; SHORT LoadCount; SHORT TlsIndex; diff --git a/patches/ntdll-HashLinks/0002-ntdll-Use-HashLinks-when-searching-for-a-dll-using-t.patch b/patches/ntdll-HashLinks/0002-ntdll-Use-HashLinks-when-searching-for-a-dll-using-t.patch index 9120c6b4..2bb141be 100644 --- a/patches/ntdll-HashLinks/0002-ntdll-Use-HashLinks-when-searching-for-a-dll-using-t.patch +++ b/patches/ntdll-HashLinks/0002-ntdll-Use-HashLinks-when-searching-for-a-dll-using-t.patch @@ -1,17 +1,18 @@ -From 6e41aeac02672253805dbadf694965cd1fb925bf Mon Sep 17 00:00:00 2001 +From f462fb516150f5f8cd7403e19217311987f6ba5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 3 Apr 2017 05:56:19 +0200 -Subject: ntdll: Use HashLinks when searching for a dll using the basename. +Subject: [PATCH] ntdll: Use HashLinks when searching for a dll using the + basename. --- dlls/ntdll/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 289c15a7be3..88fd86ce2be 100644 +index c226c467cd2..c7d590c32dc 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -541,10 +541,10 @@ static WINE_MODREF *find_basename_module( LPCWSTR name ) +@@ -551,10 +551,10 @@ static WINE_MODREF *find_basename_module( LPCWSTR name ) if (cached_modref && RtlEqualUnicodeString( &name_str, &cached_modref->ldr.BaseDllName, TRUE )) return cached_modref; @@ -19,11 +20,11 @@ index 289c15a7be3..88fd86ce2be 100644 + mark = &hash_table[hash_basename(name)]; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { -- LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); -+ LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, HashLinks); +- LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); ++ LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, HashLinks); if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); -- -2.25.1 +2.26.0 diff --git a/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch b/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch index 3ea4579f..dba4a4a4 100644 --- a/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch +++ b/patches/ntdll-SystemModuleInformation/0002-ntdll-Return-ntdll.dll-as-the-first-entry-for-System.patch @@ -1,4 +1,4 @@ -From fb0f6b366765e5cd7cf236d660a974541e85b100 Mon Sep 17 00:00:00 2001 +From 223c2c82eba0aacee744f6d9fcf9189cff2fd1e7 Mon Sep 17 00:00:00 2001 From: Andrew Wesie Date: Fri, 12 Apr 2019 20:04:03 -0500 Subject: [PATCH] ntdll: Return ntdll.dll as the first entry for @@ -9,10 +9,10 @@ Subject: [PATCH] ntdll: Return ntdll.dll as the first entry for 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index a9cec53e0b6..c7d4c804e2c 100644 +index f44c232f4e9..ebb8c94bd11 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c -@@ -2454,6 +2454,33 @@ BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +@@ -2546,6 +2546,33 @@ BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; } @@ -21,15 +21,15 @@ index a9cec53e0b6..c7d4c804e2c 100644 + char *ptr; + ANSI_STRING str; + PLIST_ENTRY entry; -+ PLDR_MODULE mod; ++ LDR_DATA_TABLE_ENTRY *mod; + + /* The first entry must be ntdll. */ + entry = NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList.Flink; -+ mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); ++ mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + + sm->Section = 0; + sm->MappedBaseAddress = 0; -+ sm->ImageBaseAddress = mod->BaseAddress; ++ sm->ImageBaseAddress = mod->DllBase; + sm->ImageSize = mod->SizeOfImage; + sm->Flags = mod->Flags; + sm->LoadOrderIndex = 0; @@ -46,7 +46,7 @@ index a9cec53e0b6..c7d4c804e2c 100644 /****************************************************************************** * NtQuerySystemInformation [NTDLL.@] * ZwQuerySystemInformation [NTDLL.@] -@@ -2853,7 +2880,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( +@@ -2882,7 +2909,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( FIXME("returning fake driver list\n"); smi->ModulesCount = 1; @@ -56,5 +56,5 @@ index a9cec53e0b6..c7d4c804e2c 100644 } break; -- -2.17.1 +2.26.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4bf21c87..e2f6b7f2 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "28bc1bb463eb4075c6a113ba5c279a0506c6daea" + echo "c44e0cf60ad1a967d80fafb427974332b35a0071" } # Show version information diff --git a/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch b/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch index d6a7dc4d..b292dc3a 100644 --- a/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch +++ b/patches/winedevice-Default_Drivers/0004-programs-winedevice-Load-some-common-drivers-and-fix.patch @@ -1,4 +1,4 @@ -From 024ec37f4c46f08e09b38d05ff9d4ebd5e9346e5 Mon Sep 17 00:00:00 2001 +From e8ef6d3182cde841e5a6a3f0dccece58b6210ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 8 Jun 2017 23:50:03 +0200 Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr @@ -10,18 +10,18 @@ Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr 2 files changed, 76 insertions(+) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c -index 0506011ce56..9b42605a2a9 100644 +index 10f38655150..63c81d64e8f 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -44,6 +44,7 @@ static const WCHAR driver_link[] = {'\\','D','o','s','D','e','v','i','c','e','s' static DRIVER_OBJECT *driver_obj; static DEVICE_OBJECT *lower_device, *upper_device; -+static LDR_MODULE *ldr_module; ++static LDR_DATA_TABLE_ENTRY *ldr_module; static HANDLE okfile; static LONG successes; -@@ -1506,6 +1507,7 @@ static void test_resource(void) +@@ -1504,6 +1505,7 @@ static void test_resource(void) ok(status == STATUS_SUCCESS, "got status %#x\n", status); } @@ -29,7 +29,7 @@ index 0506011ce56..9b42605a2a9 100644 static void test_lookup_thread(void) { NTSTATUS status; -@@ -1712,6 +1714,52 @@ static void test_executable_pool(void) +@@ -1710,6 +1712,52 @@ static void test_executable_pool(void) } #endif @@ -38,24 +38,24 @@ index 0506011ce56..9b42605a2a9 100644 + BOOL win32k = FALSE, dxgkrnl = FALSE, dxgmms1 = FALSE; + LIST_ENTRY *start, *entry; + ANSI_STRING name_a; -+ LDR_MODULE *mod; ++ LDR_DATA_TABLE_ENTRY *mod; + NTSTATUS status; + + /* Try to find start of the InLoadOrderModuleList list */ -+ for (start = ldr_module->InLoadOrderModuleList.Flink; ; start = start->Flink) ++ for (start = ldr_module->InLoadOrderLinks.Flink; ; start = start->Flink) + { -+ mod = CONTAINING_RECORD(start, LDR_MODULE, InLoadOrderModuleList); ++ mod = CONTAINING_RECORD(start, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + -+ if (!MmIsAddressValid(&mod->BaseAddress) || !mod->BaseAddress) break; ++ if (!MmIsAddressValid(&mod->DllBase) || !mod->DllBase) break; + if (!MmIsAddressValid(&mod->LoadCount) || !mod->LoadCount) break; + if (!MmIsAddressValid(&mod->SizeOfImage) || !mod->SizeOfImage) break; -+ if (!MmIsAddressValid(&mod->EntryPoint) || mod->EntryPoint < mod->BaseAddress || -+ (DWORD_PTR)mod->EntryPoint > (DWORD_PTR)mod->BaseAddress + mod->SizeOfImage) break; ++ if (!MmIsAddressValid(&mod->EntryPoint) || mod->EntryPoint < mod->DllBase || ++ (DWORD_PTR)mod->EntryPoint > (DWORD_PTR)mod->DllBase + mod->SizeOfImage) break; + } + + for (entry = start->Flink; entry != start; entry = entry->Flink) + { -+ mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); ++ mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + + status = RtlUnicodeStringToAnsiString(&name_a, &mod->BaseDllName, TRUE); + ok(!status, "RtlUnicodeStringToAnsiString failed with %08x\n", status); @@ -82,7 +82,7 @@ index 0506011ce56..9b42605a2a9 100644 static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) { ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength; -@@ -1758,6 +1806,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st +@@ -1756,6 +1804,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st test_stack_callout(); test_lookaside_list(); test_ob_reference(test_input->path); @@ -90,16 +90,16 @@ index 0506011ce56..9b42605a2a9 100644 test_resource(); test_lookup_thread(); test_IoAttachDeviceToDeviceStack(); -@@ -1981,6 +2030,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry) +@@ -2006,6 +2055,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry) DbgPrint("loading driver\n"); driver_obj = driver; -+ ldr_module = (LDR_MODULE *)driver->DriverSection; ++ ldr_module = (LDR_DATA_TABLE_ENTRY *)driver->DriverSection; /* Allow unloading of the driver */ driver->DriverUnload = driver_Unload; diff --git a/programs/winedevice/device.c b/programs/winedevice/device.c -index f4ebad2f2d0..b8ed745cb64 100644 +index 0755caaafb0..6595788053e 100644 --- a/programs/winedevice/device.c +++ b/programs/winedevice/device.c @@ -120,7 +120,33 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_ @@ -112,7 +112,7 @@ index f4ebad2f2d0..b8ed745cb64 100644 + static const WCHAR dxgmms1W[] = {'d','x','g','m','m','s','1','.','s','y','s',0}; + static const WCHAR *stubs[] = { win32kW, dxgkrnlW, dxgmms1W }; const WCHAR *service_group = (argc >= 2) ? argv[1] : argv[0]; -+ LDR_MODULE *ldr; ++ LDR_DATA_TABLE_ENTRY *ldr; + ULONG_PTR magic; + int i; + @@ -127,15 +127,15 @@ index f4ebad2f2d0..b8ed745cb64 100644 + LdrLockLoaderLock( 0, NULL, &magic ); + if (!LdrFindEntryForAddress( GetModuleHandleW( ntoskrnlW ), &ldr )) + { -+ RemoveEntryList( &ldr->InLoadOrderModuleList ); -+ InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, &ldr->InLoadOrderModuleList ); -+ RemoveEntryList( &ldr->InMemoryOrderModuleList); -+ InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &ldr->InMemoryOrderModuleList ); ++ RemoveEntryList( &ldr->InLoadOrderLinks ); ++ InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, &ldr->InLoadOrderLinks ); ++ RemoveEntryList( &ldr->InMemoryOrderLinks ); ++ InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &ldr->InMemoryOrderLinks ); + } + LdrUnlockLoaderLock( 0, magic ); if (!(stop_event = CreateEventW( NULL, TRUE, FALSE, NULL ))) return; -- -2.17.1 +2.26.0 diff --git a/patches/wow64cpu-Wow64Transition/0002-ntdll-Add-a-stub-implementation-of-Wow64Transition.patch b/patches/wow64cpu-Wow64Transition/0002-ntdll-Add-a-stub-implementation-of-Wow64Transition.patch index 0005e1c7..1416842a 100644 --- a/patches/wow64cpu-Wow64Transition/0002-ntdll-Add-a-stub-implementation-of-Wow64Transition.patch +++ b/patches/wow64cpu-Wow64Transition/0002-ntdll-Add-a-stub-implementation-of-Wow64Transition.patch @@ -1,18 +1,18 @@ -From 32184e71ba797fc987bbdc848b2ebd9dd2e14d59 Mon Sep 17 00:00:00 2001 +From aea7b0a4493b0f7cf8a9074197b3aa9a46fa4dee Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 8 Aug 2018 20:00:15 -0500 Subject: [PATCH] ntdll: Add a stub implementation of Wow64Transition. --- - dlls/ntdll/loader.c | 12 +++++++++++- + dlls/ntdll/loader.c | 11 ++++++++++- dlls/ntdll/ntdll.spec | 1 + - 2 files changed, 12 insertions(+), 1 deletion(-) + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 59398955b51..1973548362d 100644 +index d32b57612d5..e2c7a3bd14f 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -4681,6 +4681,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +@@ -4490,6 +4490,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) return TRUE; } @@ -20,7 +20,7 @@ index 59398955b51..1973548362d 100644 /*********************************************************************** * __wine_process_init -@@ -4691,12 +4692,13 @@ void __wine_process_init(void) +@@ -4500,12 +4501,13 @@ void __wine_process_init(void) static const WCHAR ntdllW[] = {'\\','?','?','\\','C',':','\\','w','i','n','d','o','w','s','\\', 's','y','s','t','e','m','3','2','\\', 'n','t','d','l','l','.','d','l','l',0}; @@ -35,24 +35,22 @@ index 59398955b51..1973548362d 100644 NTSTATUS status; ANSI_STRING func_name; UNICODE_STRING nt_name; -@@ -4753,7 +4755,15 @@ void __wine_process_init(void) +@@ -4551,6 +4553,13 @@ void __wine_process_init(void) MESSAGE( "wine: could not load kernel32.dll, status %x\n", status ); exit(1); } + + RtlInitUnicodeString( &nt_name, wow64cpuW ); + if ((status = load_builtin_dll( NULL, &nt_name, 0, 0, &wow64cpu_wm )) == STATUS_SUCCESS) -+ Wow64Transition = wow64cpu_wm->ldr.BaseAddress; ++ Wow64Transition = wow64cpu_wm->ldr.DllBase; + else + WARN( "could not load wow64cpu.dll, status %#x\n", status ); + 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) - { diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index 39a2407e5bd..dc70320653b 100644 +index c50e83b5aa7..6d9cb826624 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1100,6 +1100,7 @@ @@ -64,5 +62,5 @@ index 39a2407e5bd..dc70320653b 100644 @ stdcall -private ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck @ stdcall -private ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm -- -2.26.1 +2.26.0