#ifndef _NTRTL_H
#if (PHNT_VERSION >= PHNT_WINDOWS_11)
NTSYSAPI
VOID
STDAPIVCALLTYPE
RtlRestoreContext(
_In_ PCONTEXT ContextRecord,
_In_opt_ struct _EXCEPTION_RECORD* ExceptionRecord
);
View code on GitHub// winnt.h
NTSYSAPI VOID __cdecl RtlRestoreContext(
PCONTEXT ContextRecord,
_EXCEPTION_RECORD *ExceptionRecord
);
View the official Win32 API referenceNo description available.
Restores the context of the caller to the specified context record.
ContextRecord [in]A pointer to a CONTEXT structure.
ExceptionRecord [in]A pointer to an EXCEPTION_RECORD structure. This parameter is optional and should typically be NULL.
An exception record is used primarily with long jump and C++ catch-throw support. If the ExceptionCode member is STATUS_LONGJUMP, the ExceptionInformation member contains a pointer to a jump buffer. RtlRestoreContext will copy the non-volatile state from the jump buffer in to the context record before the context record is restored.
If the ExceptionCode member is STATUS_UNWIND_CONSOLIDATE, the ExceptionInformation member contains a pointer to a callback function, such as a catch handler. RtlRestoreContext consolidates the call frames between its frame and the frame specified in the context record before calling the callback function. This hides frames from any exception handling that might occur in the callback function. The difference between this and a typical unwind is that the data on the stack is still present, so frame data such as a throw object is still available. The callback function returns a new program counter to update in the context record, which is then used in a normal restore context.
This function does not return a value.
NTSYSAPI VOID __cdecl RtlRestoreContext(
PCONTEXT ContextRecord,
_EXCEPTION_RECORD *ExceptionRecord
);