https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5645f7cf8f5b9f41de782…
commit 5645f7cf8f5b9f41de782535081983db0a7cfb35
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Aug 14 22:03:00 2023 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Wed Aug 16 22:03:05 2023 +0300
[KERNEL32] Fix startup context of initial thread
When creating a new process the monster function CreateProcessInternalW calls
BaseInitializeContext to set up the context for the initial thread. One of the parameters
is the PEB pointer. Instead of passing the pointer to the newly created process' PEB,
the function was passing it's own PEB address, leading to test failures. How this is
not an issue otherwise is a mystery to be resolved by someone else.
Also remove ros_skip_flaky marks in kernel32_winetest:process (yes, flaky, because
sometimes the PEB addresses actually match)
---
dll/win32/kernel32/client/proc.c | 2 +-
modules/rostests/winetests/kernel32/process.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c
index 5a8c78c1364..fdfd390395e 100644
--- a/dll/win32/kernel32/client/proc.c
+++ b/dll/win32/kernel32/client/proc.c
@@ -4181,7 +4181,7 @@ StartScan:
/* Create the Thread's Context */
BaseInitializeContext(&Context,
- Peb,
+ RemotePeb,
ImageInformation.TransferAddress,
InitialTeb.StackBase,
0);
diff --git a/modules/rostests/winetests/kernel32/process.c
b/modules/rostests/winetests/kernel32/process.c
index 2944c9bf4cb..9a9a583ff53 100644
--- a/modules/rostests/winetests/kernel32/process.c
+++ b/modules/rostests/winetests/kernel32/process.c
@@ -3439,9 +3439,7 @@ static void test_SuspendProcessState(void)
#endif
ret = ReadProcessMemory( pi.hProcess, peb_ptr, &child_peb, sizeof(child_peb),
NULL );
- ros_skip_flaky
ok( ret, "Failed to read PEB (%u)\n", GetLastError() );
- ros_skip_flaky
ok( child_peb.ImageBaseAddress == exe_base, "wrong base %p/%p\n",
child_peb.ImageBaseAddress, exe_base );
ok( entry_ptr == (char *)exe_base + nt_header.OptionalHeader.AddressOfEntryPoint,