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 1cfc1e1712..24a4d9455b 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2480,8 +2480,7 @@ static void *create_process_object( HANDLE handle ) */ PEPROCESS WINAPI IoGetCurrentProcess(void) { - FIXME("() stub\n"); - return NULL; + return KeGetCurrentThread()->process; }
@@ -2511,6 +2510,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 fe89625d4c..7ddbd002d7 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 75bf934445..79923b9852 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -320,7 +320,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();