ntoskrnl.exe: Implement PsGetThreadProcessId.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-05-21 12:11:44 +02:00 committed by Alexandre Julliard
parent c483201993
commit 2f7e7863e0
4 changed files with 12 additions and 1 deletions

View File

@ -2688,6 +2688,15 @@ HANDLE WINAPI PsGetThreadId(PETHREAD thread)
return thread->kthread.id.UniqueThread;
}
/*********************************************************************
* PsGetThreadProcessId (NTOSKRNL.@)
*/
HANDLE WINAPI PsGetThreadProcessId( PETHREAD thread )
{
TRACE( "%p -> %p\n", thread, thread->kthread.id.UniqueProcess );
return thread->kthread.id.UniqueProcess;
}
/***********************************************************************
* KeInsertQueue (NTOSKRNL.EXE.@)
*/

View File

@ -902,7 +902,7 @@
@ stub PsGetThreadHardErrorsAreDisabled
@ stdcall PsGetThreadId(ptr)
@ stub PsGetThreadProcess
@ stub PsGetThreadProcessId
@ stdcall PsGetThreadProcessId(ptr)
@ stub PsGetThreadSessionId
@ stub PsGetThreadTeb
@ stub PsGetThreadWin32Thread

View File

@ -346,6 +346,7 @@ static void test_current_thread(BOOL is_system)
ok(current != *pPsInitialSystemProcess, "current == PsInitialSystemProcess\n");
ok(PsGetProcessId(current) == PsGetCurrentProcessId(), "process IDs don't match\n");
ok(PsGetThreadProcessId((PETHREAD)KeGetCurrentThread()) == PsGetCurrentProcessId(), "process IDs don't match\n");
thread = PsGetCurrentThread();
ret = wait_single( thread, 0 );

View File

@ -221,6 +221,7 @@ void WINAPI KeSetTargetProcessorDpc(PRKDPC,CCHAR);
BOOLEAN WINAPI MmIsAddressValid(void *);
HANDLE WINAPI PsGetProcessId(PEPROCESS);
HANDLE WINAPI PsGetThreadId(PETHREAD);
HANDLE WINAPI PsGetThreadProcessId(PETHREAD);
NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine(PCREATE_PROCESS_NOTIFY_ROUTINE,BOOLEAN);
NTSTATUS WINAPI PsSetCreateProcessNotifyRoutineEx(PCREATE_PROCESS_NOTIFY_ROUTINE_EX,BOOLEAN);
NTSTATUS WINAPI PsSetCreateThreadNotifyRoutine(PCREATE_THREAD_NOTIFY_ROUTINE);