网站首页  词典首页

请输入您要查询的函数:

 

术语 registerapplicationrecoverycallback
释义 RegisterApplicationRecoveryCallback
语法:
C++
HRESULT WINAPI RegisterApplicationRecoveryCallback(
__in APPLICATION_RECOVERY_CALLBACK pRecoveryCallback,
__in_opt PVOID pvParameter,
__in DWORD dwPingInterval,
__in DWORD dwFlags
);
RegisterApplicationRecoveryCallback功能
登记册上的一个积极回收中的应用实例。
参数
pRecoveryCallback [in]
阿以恢复回调函数的指针。有关更多信息,请参阅ApplicationRecoveryCallback。
pvParameter [中,可选]
对变量的指针传递给回调函数。可以为NULL。
dwPingInterval [in]
平的恢复时间间隔,以毫秒为单位。默认情况下,间隔为5秒(RECOVERY_DEFAULT_PING_INTERVAL)。最高间隔为5分钟。如果指定为零,则使用默认的间隔。
您必须拨打指定的时间间隔内的ApplicationRecoveryInProgress功能,以示发射站,您仍然在积极恢复,否则,流行病学周报终止复苏。通常,在您执行,每次长达并不比平相隔时间较长的迭代循环恢复。每个迭代执行的复原工作,以阻止ApplicationRecoveryInProgress调用。既然您还可以使用ApplicationRecoveryInProgress来确定用户是否要取消的恢复,您应该考虑较小的间隔,所以您不执行了大量的工作是不必要的。
dwFlags [in]
保留供将来使用。设置为零。
返回值
这个函数返回S_OK在成功或下面的错误代码之一。
返回codeDescription
E_FAILInternal错误,注册失败。
E_INVALIDARGThe平间隔不能超过5分钟。
备注
如果应用程序遇到未处理的异常或没有响应,Windows错误报告(WER)调用指定的回收回调。您应该使用回调来保存数据和状态信息。您可以使用这些信息,如果您还调用RegisterApplicationRestart函数请求疫情周报重新启动应用程序。
疫情周报不会请您的恢复回调如果安装要更新您的应用程序组件。为了节省数据和状态信息更新的情况,您应该处理WM_QUERYENDSESSION和WM_ENDSESSION消息。有关详细信息,请参阅每条消息。为应对这些邮件超时为5秒。可用的恢复时间大多是在WM_CLOSE消息的,您还有30秒。
一个控制台应用程序可以更新使用CTRL_C_EVENT通知开始复苏(详见该HandlerRoutine回调函数)。为处理程序完成超时为30秒。
应用程序应该考虑定期ls 基础上的数据和状态信息,以缩短复原所需的时间。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
ApplicationRecoveryCallback
ApplicationRecoveryInProgress
RegisterApplicationRestart
UnregisterApplicationRecoveryCallback
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==RegisterApplicationRecoveryCallback Function
Registers the active instance of an application for recovery.
Syntax
C++
HRESULT WINAPI RegisterApplicationRecoveryCallback(
__in APPLICATION_RECOVERY_CALLBACK pRecoveryCallback,
__in_opt PVOID pvParameter,
__in DWORD dwPingInterval,
__in DWORD dwFlags
);
Parameters
pRecoveryCallback [in]
A pointer to the recovery callback function. For more information, see ApplicationRecoveryCallback .
pvParameter [in, optional]
A pointer to a variable to be passed to the callback function. Can be NULL.
dwPingInterval [in]
The recovery ping interval, in milliseconds. By default, the interval is 5 seconds (RECOVERY_DEFAULT_PING_INTERVAL). The maximum interval is 5 minutes. If you specify zero, the default interval is used.
You must call the ApplicationRecoveryInProgress function within the specified interval to indicate to ARR that you are still actively recovering; otherwise, WER terminates recovery. Typically, you perform recovery in a loop with each iteration lasting no longer than the ping interval. Each iteration performs a block of recovery work followed by a call to ApplicationRecoveryInProgress. Since you also use ApplicationRecoveryInProgress to determine if the user wants to cancel recovery, you should consider a smaller interval, so you do not perform a lot of work unnecessarily.
dwFlags [in]
Reserved for future use. Set to zero.
Return Value
This function returns S_OK on success or one of the following error codes.
Return codeDescription
E_FAILInternal error; the registration failed.
E_INVALIDARGThe ping interval cannot be more than five minutes.

Remarks
If the application encounters an unhandled exception or becomes unresponsive, Windows Error Reporting (WER) calls the specified recovery callback. You should use the callback to save data and state information. You can use the information if you also call the RegisterApplicationRestart function to request that WER restart the application.
WER will not call your recovery callback if an installer wants to update a component of your application. To save data and state information in the update case, you should handle the WM_QUERYENDSESSION and WM_ENDSESSION messages. For details, see each message. The timeout for responding to these messages is five seconds. Most of the available recovery time is in the WM_CLOSE message for which you have 30 seconds.
A console application that can be updated uses the CTRL_C_EVENT notification to initiate recovery (for details, see the HandlerRoutine callback function). The timeout for the handler to complete is 30 seconds.
Applications should consider saving data and state information on a periodic bases to shorten the amount of time required for recovery.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
ApplicationRecoveryCallback
ApplicationRecoveryInProgress
RegisterApplicationRestart
UnregisterApplicationRecoveryCallback
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa373345(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:29:50