windows中别的线程(非当前)的最后错误码怎么得到

mobe 2005-05-06 11:38:39
自己线程的当然可以GetLastError(),但是常见的调试器VC++调试器以及OllyDbg等等都可以看到被调试对象线程的lasterror码,这个是怎么实现的?有没有什么windows未公开的api函数什么的?
...全文
89 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
louifox 2005-05-08
  • 打赏
  • 举报
回复
线程的lasterror码在线程的thread database中,看看《Windows 95 System Programming SECRETS>?>
mobe 2005-05-08
  • 打赏
  • 举报
回复
惭愧啊,《Windows 95 System Programming SECRETS>>里面果然在thread database的内容里面介绍到了,我看这个书已经一年了,竟然一点印象都没有,看来我在csdn上面问的绝大多数问题都是看书方法不对引起的。
另外,这个部分的知识也明确了我的疑问:GetExitCodeThread返回的是48h DWORD TerminationStatus,
GetLastError返回的才是 70h DWORD GetLastErrorCode
这是两个完全不同的概念
谢谢大家,我结帖了
mobe 2005-05-08
  • 打赏
  • 举报
回复
谢谢大家, 不过我再问问,线程结束后调用GetExitCodeThread函数得到的值是目标线程退出时的线程函数的返回值,这是msdn里面的说明,这个和我所说的对于本线程使用GetLastError函数得到的最后API错误码的值不是同一个概念吧
是我把概念搞错了?
就我现在看来,louifox(兰陵笑笑生)的回答可能最符合我的问题的原意,如我理解有错,希望大家指正
oyljerry 2005-05-08
  • 打赏
  • 举报
回复
如上,通过GetExitCodeThread来获得
xuzheng318 2005-05-08
  • 打赏
  • 举报
回复
线程退出的返回代码
GetExitCodeThread
BigFanOfCpp 2005-05-08
  • 打赏
  • 举报
回复
利用线程退出的返回代码就可以得到。
GetExitCodeThread(...);
IloveAzhu 2005-05-07
  • 打赏
  • 举报
回复
GetExitCodeThread确实是一种最好得方法了!
cnwolf 2005-05-07
  • 打赏
  • 举报
回复
GetExitCodeThread
The GetExitCodeThread function retrieves the termination status of the specified thread.

BOOL GetExitCodeThread(
HANDLE hThread, // handle to the thread
LPDWORD lpExitCode // termination status
);

15,467

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧