ntoskrnl.exe: Implement PsGetThreadId.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-04-29 16:01:45 +02:00 committed by Alexandre Julliard
parent eb1146a500
commit 82860424bf
4 changed files with 11 additions and 1 deletions

View File

@ -2598,6 +2598,14 @@ NTSTATUS WINAPI PsLookupThreadByThreadId( HANDLE threadid, PETHREAD *thread )
return status;
}
/*********************************************************************
* PsGetThreadId (NTOSKRNL.@)
*/
HANDLE WINAPI PsGetThreadId(PETHREAD thread)
{
TRACE( "%p -> %p\n", thread, thread->kthread.id.UniqueThread );
return thread->kthread.id.UniqueThread;
}
/***********************************************************************
* KeInsertQueue (NTOSKRNL.EXE.@)

View File

@ -898,7 +898,7 @@
@ stdcall -arch=x86_64 PsGetProcessWow64Process(ptr)
@ stub PsGetThreadFreezeCount
@ stub PsGetThreadHardErrorsAreDisabled
@ stub PsGetThreadId
@ stdcall PsGetThreadId(ptr)
@ stub PsGetThreadProcess
@ stub PsGetThreadProcessId
@ stub PsGetThreadSessionId

View File

@ -340,6 +340,7 @@ static void test_currentprocess(void)
ret = wait_single( thread, 0 );
ok(ret == STATUS_TIMEOUT, "got %#x\n", ret);
ok(PsGetThreadId((PETHREAD)KeGetCurrentThread()) == PsGetCurrentThreadId(), "thread IDs don't match\n");
ok(!PsIsSystemThread((PETHREAD)KeGetCurrentThread()), "unexpected system thread\n");
}

View File

@ -217,6 +217,7 @@ NTSTATUS WINAPI KeExpandKernelStackAndCallout(PEXPAND_STACK_CALLOUT,void*,SIZE_
void WINAPI KeSetTargetProcessorDpc(PRKDPC,CCHAR);
BOOLEAN WINAPI MmIsAddressValid(void *);
HANDLE WINAPI PsGetProcessId(PEPROCESS);
HANDLE WINAPI PsGetThreadId(PETHREAD);
NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE);
void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *);
void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*);