Thread Functions for Debugging

原文链接:http://msdn.microsoft.com/en-us/library/windows/desktop/ms681395%28v=vs.85%29.aspx

本文链接:http://blog.csdn.net/wlsgzl/article/details/18627549

The CreateThread function creates a new thread for a process.CreateThread函数为进程创建新的线程。 Debuggers typically need to examine or change the contents of a thread's registers.调试器通常需要检测或者更改线程寄存器上下文。 To accomplish this, a debugger must obtain a handle to the thread by using the DuplicateHandle function and specifying the appropriate access to the thread (THREAD_GET_CONTEXT, THREAD_SET_CONTEXT, or both). 要实现这个,调试器必须通过DuplicateHandle函数获得线程的句柄,并且指定适当的访问线程权限(指的是线程的THREAD_GET_CONTEXT或者THREAD_SET_CONTEXT,或者两者同时)。The OpenThread function enables a debugger to obtain the identifier of an existing thread.OpenThread函数允许调试器获得一个已经存在的线程的ID。

A process with appropriate access to a thread can examine the thread's registers by using the GetThreadContext function and set the contents of the thread's registers by using the SetThreadContext function.具有适当访问线程权限的进程能够通过GetThreadContext检测线程的寄存器,通过SetThreadContext函数设置线程寄存器的上下文。

A process can also obtain THREAD_SUSPEND_RESUME access to a thread.一个进程可以获得线程的THREAD_SUSPEND_RESUME权限。 This type of access enables a debugger to control a thread's execution with the SuspendThread and ResumeThread functions.这种类型的权限允许一个调试器通过SuspendThread和ResumeThread函数控制线程的执行。 For more information about threads, see Processes and Threads. 更多关于线程的信息,参见Processes and Threads。

你可能感兴趣的:(functions)