SetProcessDynamicEHContinuationTargets function (processthreadsapi.h)
Sets dynamic exception handling continuation targets for the specified process.
BOOL SetProcessDynamicEHContinuationTargets( HANDLE Process, USHORT NumberOfTargets, PPROCESS_DYNAMIC_EH_CONTINUATION_TARGET Targets );
A handle to the process. This handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Security and Access Rights.
Supplies the number of dynamic exception handling continuation targets to set.
A pointer to an array of dynamic exception handling continuation targets. For more information on this structure, see PROCESS_DYNAMIC_EH_CONTINUATION_TARGET.
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. Note that even if the function fails, a portion of the supplied continuation targets may have been successfully processed. The caller needs to check the flags in each individual continuation target specified via Targets to determine if it was successfully processed.
If user-mode Hardware-enforced Stack Protection is enabled for a process, when calling APIs that modify the execution context of a thread such as
validation is performed on the Instruction Pointer specified in the new execution context.
RtlRestoreContext is used during Structured Exception Handling (SEH)
exception unwinding to unwind to the target frame that contains the
__except block and to start executing code at the continuation target.
Therefore, the operating system needs to know the instruction addresses of all the valid continuation targets in order to allow the unwind operation via RtlRestoreContext.
For compiled binaries, the list of continuation targets is generated by the linker and stored in the binary image.
For dynamic code, the continuation targets need to be specified using SetProcessDynamicEHContinuationTargets.