kernel32: Implement GetThreadId.

This commit is contained in:
Rob Shearman 2007-11-12 20:09:40 +00:00 committed by Alexandre Julliard
parent 93d87ca37f
commit 8296548bb5
3 changed files with 32 additions and 0 deletions

View File

@ -629,6 +629,7 @@
@ stdcall GetTempPathA(long ptr)
@ stdcall GetTempPathW(long ptr)
@ stdcall GetThreadContext(long ptr)
@ stdcall GetThreadId(ptr)
# @ stub GetThreadIOPendingFlag
@ stdcall GetThreadLocale()
@ stdcall GetThreadPriority(long)

View File

@ -518,6 +518,36 @@ BOOL WINAPI GetThreadTimes(
return TRUE;
}
/**********************************************************************
* GetThreadId [KERNEL32.@]
*
* Retrieve the identifier of a thread.
*
* PARAMS
* Thread [I] The thread to retrive the identifier of.
*
* RETURNS
* Success: Identifier of the target thread.
* Failure: 0
*/
DWORD WINAPI GetThreadId(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.UniqueThread);
}
/**********************************************************************
* VWin32_BoostThreadGroup [KERNEL.535]

View File

@ -1682,6 +1682,7 @@ WINBASEAPI UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
WINBASEAPI DWORD WINAPI GetTempPathA(DWORD,LPSTR);
WINBASEAPI DWORD WINAPI GetTempPathW(DWORD,LPWSTR);
#define GetTempPath WINELIB_NAME_AW(GetTempPath)
WINBASEAPI DWORD WINAPI GetThreadId(HANDLE);
WINBASEAPI DWORD WINAPI GetTickCount(void);
WINBASEAPI ULONGLONG WINAPI GetTickCount64(void);
WINBASEAPI DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);