Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29460
Signed-off-by: Derek Lesho dereklesho52@Gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 6 ++++-- dlls/ntoskrnl.exe/ntoskrnl_private.h | 1 + dlls/ntoskrnl.exe/tests/driver.c | 1 - 3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 03f6d78759..11dd41f90e 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2493,8 +2493,7 @@ static void *create_process_object( HANDLE handle ) */ PEPROCESS WINAPI IoGetCurrentProcess(void) { - FIXME("() stub\n"); - return NULL; + return KeGetCurrentThread()->process; }
@@ -2524,6 +2523,9 @@ static void *create_thread_object( HANDLE handle ) NtClose( info_handle ); }
+ PsLookupProcessByProcessId( thread->id.UniqueProcess, &thread->process ); + ObDereferenceObject( thread->process ); + thread->critical_region = FALSE;
return thread; diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h index b4601a9f83..940ff526f9 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl_private.h +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -36,6 +36,7 @@ struct _KTHREAD { DISPATCHER_HEADER header; CLIENT_ID id; + PEPROCESS process; BOOLEAN critical_region; };
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index 70831adede..1c12b9d9f0 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -314,7 +314,6 @@ static void test_currentprocess(void) NTSTATUS ret;
current = IoGetCurrentProcess(); -todo_wine ok(current != NULL, "Expected current process to be non-NULL\n");
thread = PsGetCurrentThread();