IN HANDLE ThreadHandle,
IN THREAD_INFORMATION_CLASS ThreadInformationClass,
OUT PVOID ThreadInformation,
IN ULONG ThreadInformationLength,
OUT PULONG ReturnLength OPTIONAL );
谢谢1楼。
下面补充函数使用例子
typedef long (__stdcall *NtQueryInformationThread_PROC)(HANDLE thread,
int infoclass, void *buf, long size, long *used);
typedef struct _THREAD_BASIC_INFORMATION {
unsigned long ExitStatus;
void *TebBaseAddress;
ULONG UniqueProcessId;
ULONG UniqueThreadId;
unsigned long AffinityMask;
unsigned long BasePriority;
unsigned long DiffProcessPriority;
} THREAD_BASIC_INFORMATION;
//-----------------------------------------------------------------------------
unsigned long GetThreadId(HANDLE hThread)
{
unsigned long nThId = 0;
THREAD_BASIC_INFORMATION tbi;
HMODULE hLib = 0L;
NtQueryInformationThread_PROC hProc = 0L;
long used = 0, ret = 0;