From 1064e20a3f7a70b5662ff59d1aa21bdb1576c30e Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Mon, 29 Apr 2019 16:00:40 +0200 Subject: [PATCH] ntoskrnl.exe: Export and set PsInitialSystemProcess. Signed-off-by: Derek Lesho Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/ntoskrnl.exe/ntoskrnl.c | 4 ++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 53a1bcdd22b..d7f57bad206 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -939,6 +939,8 @@ static void unload_driver( struct wine_rb_entry *entry, void *context ) CloseServiceHandle( (void *)service_handle ); } +PEPROCESS PsInitialSystemProcess = NULL; + /*********************************************************************** * wine_ntoskrnl_main_loop (Not a Windows API) */ @@ -952,6 +954,8 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ) void *in_buff = NULL; HANDLE handles[2]; + /* Set the system process global before setting up the request thread trickery */ + PsInitialSystemProcess = IoGetCurrentProcess(); request_thread = GetCurrentThreadId(); handles[0] = stop_event; diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 633a8c4b6c3..7a802068a1a 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -906,7 +906,7 @@ @ stub PsGetThreadWin32Thread @ stdcall PsGetVersion(ptr ptr ptr ptr) @ stdcall PsImpersonateClient(ptr ptr long long long) -@ stub PsInitialSystemProcess +@ extern PsInitialSystemProcess @ stub PsIsProcessBeingDebugged @ stub PsIsSystemThread @ stub PsIsThreadImpersonating