Commit 85a3d093 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

kernel32: Implement GetProcessIdOfThread().

parent b861aed2
......@@ -16,7 +16,7 @@
@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
@ stdcall GetProcessId(long) kernel32.GetProcessId
@ stub GetProcessIdOfThread
@ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes
@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion
@ stdcall GetStartupInfoW(ptr) kernel32.GetStartupInfoW
......
......@@ -21,7 +21,7 @@
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
@ stdcall GetProcessHandleCount(long ptr) kernel32.GetProcessHandleCount
@ stdcall GetProcessId(long) kernel32.GetProcessId
@ stub GetProcessIdOfThread
@ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread
@ stub GetProcessMitigationPolicy
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes
@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion
......
......@@ -21,7 +21,7 @@
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass
@ stdcall GetProcessHandleCount(long ptr) kernel32.GetProcessHandleCount
@ stdcall GetProcessId(long) kernel32.GetProcessId
@ stub GetProcessIdOfThread
@ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread
@ stub GetProcessMitigationPolicy
@ stdcall GetProcessPriorityBoost(long ptr) kernel32.GetProcessPriorityBoost
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes
......
......@@ -780,7 +780,7 @@
@ stdcall -norelay GetProcessHeap()
@ stdcall GetProcessHeaps(long ptr)
@ stdcall GetProcessId(long)
# @ stub GetProcessIdOfThread
@ stdcall GetProcessIdOfThread(long)
@ stdcall GetProcessIoCounters(long ptr)
# @ stub GetProcessPreferredUILanguages
@ stdcall GetProcessPriorityBoost(long ptr)
......
......@@ -557,6 +557,35 @@ DWORD WINAPI GetThreadId(HANDLE Thread)
return HandleToULong(tbi.ClientId.UniqueThread);
}
/**********************************************************************
* GetProcessIdOfThread [KERNEL32.@]
*
* Retrieve process identifier given thread belongs to.
*
* PARAMS
* Thread [I] The thread identifier.
*
* RETURNS
* Success: Process identifier
* Failure: 0
*/
DWORD WINAPI GetProcessIdOfThread(HANDLE Thread)
{
THREAD_BASIC_INFORMATION tbi;
NTSTATUS status;
TRACE("(%p)\n", Thread);
status = NtQueryInformationThread(Thread, ThreadBasicInformation, &tbi,
sizeof(tbi), NULL);
if (status)
{
SetLastError( RtlNtStatusToDosError(status) );
return 0;
}
return HandleToULong(tbi.ClientId.UniqueProcess);
}
/***********************************************************************
* GetCurrentThread [KERNEL32.@] Gets pseudohandle for current thread
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment