网站首页  词典首页

请输入您要查询的函数:

 

术语 getcurrentthread
释义 GetCurrentThread
语法:
C++
HANDLE WINAPI GetCurrentThread(void);
GetCurrentThread函数
检索一个伪句柄调用线程。
参数
这个函数没有参数。
返回值
返回值是一个伪句柄当前线程。
备注
伪句柄是一个特殊的常量,它是为当前线程句柄解释。调用线程可以使用此处理指定自己当线程处理是必要的。伪句柄的子进程不继承。
这把手到线程对象THREAD_ALL_ACCESS访问的权利。有关更多信息,请参见线程安全和访问权限。
Windows Server 2003和Windows XP/2000操作系统:这把手访问的最大的线程安全描述符允许的首要进程令牌。
该函数不能使用一个线程创建一个可以处理其他线程用来指第一个线程。句柄总是指线程使用它解释。一个线程可以创建一个“真正的”手柄本身可以使用其他线程,或由其他进程继承通过指定的伪句柄作为源在调用句柄DuplicateHandle函数。
伪句柄不必关闭时,不再需要。调用此句柄无效CloseHandle函数。如果伪句柄是由DuplicateHandle重复,重复的处理必须关闭。
不要创建一个线程,而假冒的安全上下文。电话会议将自身成功,但新创建的线程将减少访问权限当调用GetCurrentThread。访问权限授予此线程将访问权限从用户的模拟过程中产生的。一些访问权限,包括THREAD_SET_THREAD_TOKEN和THREAD_GET_CONTEXT可能不存在,导致意想不到的失败。
实例
有关示例,请参阅检查客户端访问。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CloseHandle
DuplicateHandle
GetCurrentProcess
GetCurrentThreadId
OpenThread
进程和线程函数
主题
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetCurrentThread Function
Retrieves a pseudo handle for the calling thread.
Syntax
C++
HANDLE WINAPI GetCurrentThread(void);
Parameters
This function has no parameters.
Return Value
The return value is a pseudo handle for the current thread.
Remarks
A pseudo handle is a special constant that is interpreted as the current thread handle. The calling thread can use this handle to specify itself whenever a thread handle is required. Pseudo handles are not inherited by child processes.
This handle has the THREAD_ALL_ACCESS access right to the thread object. For more information, see Thread Security and Access Rights .
Windows Server 2003 and Windows XP/2000: This handle has the maximum access allowed by the security descriptor of the thread to the primary token of the process.
The function cannot be used by one thread to create a handle that can be used by other threads to refer to the first thread. The handle is always interpreted as referring to the thread that is using it. A thread can create a "real" handle to itself that can be used by other threads, or inherited by other processes, by specifying the pseudo handle as the source handle in a call to the DuplicateHandle function.
The pseudo handle need not be closed when it is no longer needed. Calling the CloseHandle function with this handle has no effect. If the pseudo handle is duplicated by DuplicateHandle, the duplicate handle must be closed.
Do not create a thread while impersonating a security context. The call will succeed, however the newly created thread will have reduced access rights to itself when calling GetCurrentThread. The access rights granted this thread will be derived from the access rights the impersonated user has to the process. Some access rights including THREAD_SET_THREAD_TOKEN and THREAD_GET_CONTEXT may not be present, leading to unexpected failures.
Examples
For an example, see Checking Client Access .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CloseHandle
DuplicateHandle
GetCurrentProcess
GetCurrentThreadId
OpenThread
Process and Thread Functions
Threads
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683182(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 11:22:24