Commit 8296548b authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

kernel32: Implement GetThreadId.

parent 93d87ca3
...@@ -629,6 +629,7 @@ ...@@ -629,6 +629,7 @@
@ stdcall GetTempPathA(long ptr) @ stdcall GetTempPathA(long ptr)
@ stdcall GetTempPathW(long ptr) @ stdcall GetTempPathW(long ptr)
@ stdcall GetThreadContext(long ptr) @ stdcall GetThreadContext(long ptr)
@ stdcall GetThreadId(ptr)
# @ stub GetThreadIOPendingFlag # @ stub GetThreadIOPendingFlag
@ stdcall GetThreadLocale() @ stdcall GetThreadLocale()
@ stdcall GetThreadPriority(long) @ stdcall GetThreadPriority(long)
......
...@@ -518,6 +518,36 @@ BOOL WINAPI GetThreadTimes( ...@@ -518,6 +518,36 @@ BOOL WINAPI GetThreadTimes(
return TRUE; 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] * VWin32_BoostThreadGroup [KERNEL.535]
......
...@@ -1682,6 +1682,7 @@ WINBASEAPI UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR); ...@@ -1682,6 +1682,7 @@ WINBASEAPI UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
WINBASEAPI DWORD WINAPI GetTempPathA(DWORD,LPSTR); WINBASEAPI DWORD WINAPI GetTempPathA(DWORD,LPSTR);
WINBASEAPI DWORD WINAPI GetTempPathW(DWORD,LPWSTR); WINBASEAPI DWORD WINAPI GetTempPathW(DWORD,LPWSTR);
#define GetTempPath WINELIB_NAME_AW(GetTempPath) #define GetTempPath WINELIB_NAME_AW(GetTempPath)
WINBASEAPI DWORD WINAPI GetThreadId(HANDLE);
WINBASEAPI DWORD WINAPI GetTickCount(void); WINBASEAPI DWORD WINAPI GetTickCount(void);
WINBASEAPI ULONGLONG WINAPI GetTickCount64(void); WINBASEAPI ULONGLONG WINAPI GetTickCount64(void);
WINBASEAPI DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION); WINBASEAPI DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
......
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