Retrieves the process identifier of the process associated with the specified thread.
DWORD GetProcessIdOfThread(
HANDLE Thread
)
Thread
Type: HANDLE
[in] A handle to the thread. The handle must have the THREAD_QUERY_INFORMATION or THREAD_QUERY_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights.
Note
The handle must have the THREAD_QUERY_INFORMATION access right.
Type: DWORD
If the function succeeds, the return value is the process identifier of the process associated with the specified thread.If the function fails, the return value is zero. To get extended error information, call GetLastError.
Until a process terminates, its process identifier uniquely identifies it on the system. For more information about access rights, see Thread Security and Access Rights.
Header: Declared in processthreadsapi.h.
Library: Use kernelx.lib.