网站首页  词典首页

请输入您要查询的函数:

 

术语 initonceexecuteonce
释义 InitOnceExecuteOnce
语法:
C++
BOOL WINAPI InitOnceExecuteOnce(
__inout PINIT_ONCE InitOnce,
__in PINIT_ONCE_FN InitFn,
__inout_opt PVOID Parameter,
__out_opt LPVOID *Context
);
InitOnceExecuteOnce功能
执行指定函数成功一次。没有其他线程指定相同的一次性初始化结构可以执行这个虽然是由当前线程执行的函数。
参数
InitOnce [ in , out ]
对一个时初始化结构的指针。
InitFn [in]
对一个应用程序的指针定义InitOnceCallback功能。
参数[中,指出,可选]
可选参数传递给回调函数。
上下文[指出,可选]
阿指针的数据存储在一个成功时初始化后的结构。在低位INIT_ONCE_CTX_RESERVED_BITS数据位必须为零。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
此功能用于同步一次性初始化。异步一次性初始化,使用与INIT_ONCE_ASYNC旗InitOnceBeginInitialize功能。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0600或更高版本。有关详细信息,请参阅使用Windows头。
实例
举例说,使用此功能,请参阅使用一次性初始化。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
InitOnceCallback
InitOnceInitialize
一次性初始化
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==InitOnceExecuteOnce Function
Executes the specified function successfully one time. No other threads that specify the same one-time initialization structure can execute this function while it is being executed by the current thread.
Syntax
C++
BOOL WINAPI InitOnceExecuteOnce(
__inout PINIT_ONCE InitOnce,
__in PINIT_ONCE_FN InitFn,
__inout_opt PVOID Parameter,
__out_opt LPVOID *Context
);
Parameters
InitOnce [in, out]
A pointer to the one-time initialization structure.
InitFn [in]
A pointer to an application-defined InitOnceCallback function.
Parameter [in, out, optional]
An optional parameter to be passed to the callback function.
Context [out, optional]
A pointer to the data stored with the one-time initialization structure upon success. The low-order INIT_ONCE_CTX_RESERVED_BITS bits of the data must be zero.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
This function is used for synchronous one-time initialization. For asynchronous one-time initialization, use the InitOnceBeginInitialize function with the INIT_ONCE_ASYNC flag.
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers .
Examples
For an example that uses this function, see Using One-Time Initialization .
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
InitOnceCallback
InitOnceInitialize
One-Time Initialization
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683493(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:18:19