Kernel32RegisterApplicationRecoveryCallback Method

Registers the active instance of an application for recovery.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true)]
public static HResult RegisterApplicationRecoveryCallback(
	DelegatesApplicationRecoveryCallback recoveryCallback,
	IntPtr parameter,
	uint pingInterval,
	uint reserved
)

Parameters

recoveryCallback  DelegatesApplicationRecoveryCallback
A pointer to the recovery callback function.
parameter  IntPtr
A pointer to a variable to be passed to the callback function. Can be NULL.
pingInterval  UInt32
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(Boolean) function within the specified interval to indicate to ARR that you are still actively recovering; otherwise, Windows Error Reporting (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(Boolean).

Since you also use ApplicationRecoveryInProgress(Boolean) 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.

reserved  UInt32
Reserved for future use. Set to zero.

Return Value

HResult
This function returns S_OK on success, or an HResult error code.

Remarks

See Also