Kernel32RegisterApplicationRecoveryCallback Method
Registers the active instance of an application for recovery.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", ExactSpelling := true>]
Public Shared Function RegisterApplicationRecoveryCallback (
recoveryCallback As DelegatesApplicationRecoveryCallback,
parameter As IntPtr,
pingInterval As UInteger,
reserved As UInteger
) As HResult
Dim recoveryCallback As DelegatesApplicationRecoveryCallback
Dim parameter As IntPtr
Dim pingInterval As UInteger
Dim reserved As UInteger
Dim returnValue As HResult
returnValue = Kernel32.RegisterApplicationRecoveryCallback(recoveryCallback,
parameter, pingInterval, reserved)
public:
[DllImportAttribute(L"Kernel32.dll", ExactSpelling = true)]
static HResult RegisterApplicationRecoveryCallback(
DelegatesApplicationRecoveryCallback^ recoveryCallback,
IntPtr parameter,
unsigned int pingInterval,
unsigned int reserved
)
[<DllImportAttribute("Kernel32.dll", ExactSpelling = true)>]
static member RegisterApplicationRecoveryCallback :
recoveryCallback : DelegatesApplicationRecoveryCallback *
parameter : IntPtr *
pingInterval : uint32 *
reserved : uint32 -> HResult
No code example is currently available or this language may not be supported.
- 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.
HResult
This function returns
S_OK on success, or an
HResult error code.