现在的位置: 首页 > 综合 > 正文

得到线程上下文

2011年06月19日 ⁄ 综合 ⁄ 共 332字 ⁄ 字号 评论关闭
#include <windows.h>
#include <stdio.h>

DWORD WINAPI ThreadProc(
						LPVOID lpParameter   // thread data
						)
{
	for (;;)
	{
	}
	return 0;
}
	
int main()
{
	HANDLE hThread = CreateThread(NULL,0,ThreadProc,NULL,0,NULL);

	SuspendThread(hThread);

	CONTEXT context;
	context.ContextFlags = (CONTEXT_FULL);
	GetThreadContext(hThread,&context);
	printf("context.Eip: %x\n",context.Eip);
	
	return 0;
}

抱歉!评论已关闭.