网站首页  词典首页

请输入您要查询的函数:

 

术语 setthreadcontext
释义 SetThreadContext
语法:
C++
BOOL WINAPI SetThreadContext(
__in HANDLE hThread,
__in const CONTEXT *lpContext
);
SetThreadContext功能
设置指定线程上下文。
64位应用程序可以设置一个WOW64的使用Wow64SetThreadContext函数线程上下文。
参数
hThread [in]
句柄到线程的上下文被设置。句柄必须有THREAD_SET_CONTEXT访问权的线程。有关更多信息,请参见线程安全和访问权限。
lpContext [in]
甲到一个上下文结构,包含要在指定的范围内设置的线程指针。在这个结构ContextFlags成员值指定一个线程的上下文哪些部分设置。在上下文结构不能指定有些值是默默设置为正确的值。这包括CPU状态寄存器位指定的特权处理器模式,在调试寄存器全球扶持位,必须由操作系统控制的其他国家。
返回值
如果上下文成立,则返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该函数设置线程上下文的上下文结构ContextFlags成员的值为基础。由hThread参数确定的线程通常是进行调试,但也能操作的功能即使在没有线程调试。
不要试图为正在运行的线程上下文,结果难以预料。使用SuspendThread函数之前调用SetThreadContext暂停线程。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
背景
调试功能
GetThreadContext
SuspendThread
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==SetThreadContext Function
Sets the context for the specified thread.
A 64-bit application can set the context of a WOW64 thread using the Wow64SetThreadContext function.
Syntax
C++
BOOL WINAPI SetThreadContext(
__in HANDLE hThread,
__in const CONTEXT *lpContext
);
Parameters
hThread [in]
A handle to the thread whose context is to be set. The handle must have the THREAD_SET_CONTEXT access right to the thread. For more information, see Thread Security and Access Rights .
lpContext [in]
A pointer to a CONTEXT structure that contains the context to be set in the specified thread. The value of the ContextFlags member of this structure specifies which portions of a thread's context to set. Some values in the CONTEXT structure that cannot be specified are silently set to the correct value. This includes bits in the CPU status register that specify the privileged processor mode, global enabling bits in the debugging register, and other states that must be controlled by the operating system.
Return Value
If the context was set, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The function sets the thread context based on the value of the ContextFlags member of the context structure. The thread identified by the hThread parameter is typically being debugged, but the function can also operate even when the thread is not being debugged.
Do not try to set the context for a running thread; the results are unpredictable. Use the SuspendThread function to suspend the thread before calling SetThreadContext.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CONTEXT
Debugging Functions
GetThreadContext
SuspendThread
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms680632(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:07