网站首页  词典首页

请输入您要查询的函数:

 

术语 initoncebegininitialize
释义 InitOnceBeginInitialize
语法:
C++
BOOL WINAPI InitOnceBeginInitialize(
__inout LPINIT_ONCE lpInitOnce,
__in DWORD dwFlags,
__out PBOOL fPending,
__out LPVOID *lpContext
);
InitOnceBeginInitialize功能
一开始时初始化。
参数
lpInitOnce [ in , out ]
对一个时初始化结构的指针。
dwFlags [in]
此参数可以是一个或多个以下标志。
ValueMeaning
INIT_ONCE_ASYNC
0x00000002ULEnables多个初始化尝试并行执行。如果使用此标志,这一职能后续调用将失败,除非这个标志也指定。
INIT_ONCE_CHECK_ONLY
0x00000001ULThis函数调用不进行初始化。返回值指示是否初始化已完成。如果该函数返回TRUE,则lpContext参数接收数据。
fPending [out]
如果函数成功,此参数表明了目前的初始化状态。
If this parameter is TRUE and dwFlags contains INIT_ONCE_CHECK_ONLY, the initialization is pending and the context data is invalid.
如果此参数为FALSE,初始化已完成和调用可以检索从lpContext参数范围内的数据。
如果此参数为true和dwFlags不包含INIT_ONCE_CHECK_ONLY,初始化已经开始,并调用者可以执行初始化任务。
lpContext [out]
可选参数,接收数据的存储与一经成功时初始化结构。
返回值
如果没有指定INIT_ONCE_CHECK_ONLY和函数成功,返回值为TRUE。
如果INIT_ONCE_CHECK_ONLY指定和初始化完成后,返回值为TRUE。
否则,返回值为FALSE。为了获得更多错误信息,调用GetLastError。
备注
此功能可用于同步或异步一次性初始化。异步一次性初始化,使用INIT_ONCE_ASYNC标志。要指定一个回调函数同步期间一次性初始化,执行看到InitOnceExecuteOnce功能。
If this function succeeds, the thread can create a synchronization object and specify in the lpContext parameter of the InitOnceComplete function.
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0600或更高版本。有关详细信息,请参阅使用Windows头。
实例
举例说,使用此功能,请参阅使用一次性初始化。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
InitOnceComplete
InitOnceExecuteOnce
一次性初始化
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==InitOnceBeginInitialize Function
Begins one-time initialization.
Syntax
C++
BOOL WINAPI InitOnceBeginInitialize(
__inout LPINIT_ONCE lpInitOnce,
__in DWORD dwFlags,
__out PBOOL fPending,
__out LPVOID *lpContext
);
Parameters
lpInitOnce [in, out]
A pointer to the one-time initialization structure.
dwFlags [in]
This parameter can be one or more of the following flags.
ValueMeaning
INIT_ONCE_ASYNC
0x00000002ULEnables multiple initialization attempts to execute in parallel. If this flag is used, subsequent calls to this function will fail unless this flag is also specified.
INIT_ONCE_CHECK_ONLY
0x00000001ULThis function call does not begin initialization. The return value indicates whether initialization has already completed. If the function returns TRUE, the lpContext parameter receives the data.

fPending [out]
If the function succeeds, this parameter indicates the current initialization status.
If this parameter is TRUE and dwFlags contains INIT_ONCE_CHECK_ONLY, the initialization is pending and the context data is invalid.
If this parameter is FALSE, initialization has already completed and the caller can retrieve the context data from the lpContext parameter.
If this parameter is TRUE and dwFlags does not contain INIT_ONCE_CHECK_ONLY, initialization has been started and the caller can perform the initialization tasks.
lpContext [out]
An optional parameter that receives the data stored with the one-time initialization structure upon success.
Return Value
If INIT_ONCE_CHECK_ONLY is not specified and the function succeeds, the return value is TRUE.
If INIT_ONCE_CHECK_ONLY is specified and initialization has completed, the return value is TRUE.
Otherwise, the return value is FALSE. To get extended error information, call GetLastError .
Remarks
This function can be used for either synchronous or asynchronous one-time initialization. For asynchronous one-time initialization, use the INIT_ONCE_ASYNC flag. To specify a callback function to execute during synchronous one-time initialization, see the InitOnceExecuteOnce function.
If this function succeeds, the thread can create a synchronization object and specify in the lpContext parameter of the InitOnceComplete function.
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
InitOnceComplete
InitOnceExecuteOnce
One-Time Initialization
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683487(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:17:04