网站首页  词典首页

请输入您要查询的函数:

 

术语 createwaitabletimerex
释义 CreateWaitableTimerEx
语法:
C++
HANDLE WINAPI CreateWaitableTimerEx(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in_opt LPCTSTR lpTimerName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
CreateWaitableTimerEx功能
创建或打开一个可等待计时器对象,并返回一个对象的句柄。
参数
lpTimerAttributes [中,可选]
一个SECURITY_ATTRIBUTES结构的指针。如果该参数为NULL,则计时器句柄不能被继承的子进程。
如果lpTimerAttributes为NULL,则计时器对象都将获得一个默认的安全描述符和处理不能被继承。在对来自定时器默认安全描述符的ACL或模拟的主要创造者的象征。
lpTimerName [中,可选]
定时器的对象的名称。该名称被限制为MAX_PATH字符。名称比较是区分大小写的。
如果lpTimerName为NULL,则计时器对象创建没有名称。
如果lpTimerName匹配现有的事件,信号量,互斥,工作,或文件映射对象,函数失败并GetLastError返回出现ERROR_INVALID_HANDLE名称。这是因为这些对象共享相同的名称空间。
这个名称可以有一个“全球\\”或“Local \\”前缀明确创建对象的全球或会话名称空间。名称的其余部分可以包含以外的任何字符反斜杠字符(\\)。如需信息见命名内核对象。快速用户切换是使用终端服务会话。内核对象名称必须遵循概述了终端服务,使应用程序能够支持多个用户的指导方针。
该对象可以创建一个私人空间。有关更多信息,请参见对象命名。
dwFlags [in]
此参数可以是0或下面的值。
ValueMeaning
CREATE_WAITABLE_TIMER_MANUAL_RESET
0x00000001The计时器必须手动复位。否则,系统会自动复位后释放一个等待线程计时器。
dwDesiredAccess [in]
为计时器对象访问掩码。如需使用权名单,见同步对象的安全和访问权限。
返回值
如果函数成功,返回值是一个句柄计时器对象。如果计时器对象命名函数调用之前的存在,该函数返回的句柄现有的对象和GetLastError返回ERROR_ALREADY_EXISTS。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
任何调用进程的线程可以指定计时器对象在调用句柄在等待职能之一。
多个进程可以处理同一个计时器对象,从而能够为进程间同步对象的使用。
由CreateProcess函数创建一个进程可以继承的句柄计时器对象如果CreateWaitableTimerEx lpTimerAttributes参数使继承。
一个进程可以指定计时器对象在调用句柄DuplicateHandle函数。由此产生的手柄可以使用另一个进程。
一个进程可以指定在调用一个计时器对象的名称的OpenWaitableTimer或CreateWaitableTimerEx功能。
使用CloseHandle函数关闭处理。该系统关闭时自动处理过程终止。计时器对象被销毁时,其最后处理已关闭。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesCreateWaitableTimerExW(Unicode)和CreateWaitableTimerExA(ANSI)的
参见
CloseHandle
同步功能
可等待定时器对象
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==CreateWaitableTimerEx Function
Creates or opens a waitable timer object and returns a handle to the object.
Syntax
C++
HANDLE WINAPI CreateWaitableTimerEx(
__in_opt LPSECURITY_ATTRIBUTES lpTimerAttributes,
__in_opt LPCTSTR lpTimerName,
__in DWORD dwFlags,
__in DWORD dwDesiredAccess
);
Parameters
lpTimerAttributes [in, optional]
A pointer to a SECURITY_ATTRIBUTES structure. If this parameter is NULL, the timer handle cannot be inherited by child processes.
If lpTimerAttributes is NULL, the timer object gets a default security descriptor and the handle cannot be inherited. The ACLs in the default security descriptor for a timer come from the primary or impersonation token of the creator.
lpTimerName [in, optional]
The name of the timer object. The name is limited to MAX_PATH characters. Name comparison is case sensitive.
If lpTimerName is NULL, the timer object is created without a name.
If lpTimerName matches the name of an existing event, semaphore, mutex, job, or file-mapping object, the function fails and GetLastError returns ERROR_INVALID_HANDLE. This occurs because these objects share the same name space.
The name can have a "Global\\" or "Local\\" prefix to explicitly create the object in the global or session name space. The remainder of the name can contain any character except the backslash character (\\). For more information, see Kernel Object Namespaces . Fast user switching is implemented using Terminal Services sessions. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users.
The object can be created in a private namespace. For more information, see Object Namespaces .
dwFlags [in]
This parameter can be 0 or the following value.
ValueMeaning
CREATE_WAITABLE_TIMER_MANUAL_RESET
0x00000001The timer must be manually reset. Otherwise, the system automatically resets the timer after releasing a single waiting thread.

dwDesiredAccess [in]
The access mask for the timer object. For a list of access rights, see Synchronization Object Security and Access Rights .
Return Value
If the function succeeds, the return value is a handle to the timer object. If the named timer object exists before the function call, the function returns a handle to the existing object and GetLastError returns ERROR_ALREADY_EXISTS.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Remarks
Any thread of the calling process can specify the timer object handle in a call to one of the wait functions .
Multiple processes can have handles to the same timer object, enabling use of the object for interprocess synchronization.
A process created by the CreateProcess function can inherit a handle to a timer object if the lpTimerAttributes parameter of CreateWaitableTimerEx enables inheritance.
A process can specify the timer object handle in a call to the DuplicateHandle function. The resulting handle can be used by another process.
A process can specify the name of a timer object in a call to the OpenWaitableTimer or CreateWaitableTimerEx function.
Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The timer object is destroyed when its last handle has been closed.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesCreateWaitableTimerExW (Unicode) and CreateWaitableTimerExA (ANSI)
See Also
CloseHandle
Synchronization Functions
Waitable Timer Objects
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682494(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:25:26