Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com> --- dlls/ntoskrnl.exe/ntoskrnl.c | 6 +++++- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 9f1298a51e..80e53b4f72 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -91,7 +91,7 @@ static const WCHAR servicesW[] = {'\\','R','e','g','i','s','t','r','y', #define MAX_SERVICE_NAME 260 /* tid of the thread running client request */ -static DWORD request_thread; +static DWORD request_thread = 0; /* tid of the client thread */ static DWORD client_tid; @@ -940,6 +940,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) */ @@ -953,6 +955,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 08de49e760..f948c6befe 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -905,7 +905,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 -- 2.20.1