VirtualBox

Changeset 97866 in vbox for trunk/src/VBox/Runtime/include


Ignore:
Timestamp:
Dec 26, 2022 2:14:08 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Added an exception handler to rtVccEh4DoLocalUnwind and implemented rtVccValidateExceptionContextRecord. bugref:10261 ticketref:21303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/compiler-vcc.h

    r96588 r97866  
    108108void rtVccTermRunAtExit(void) RT_NOEXCEPT;
    109109
     110struct _CONTEXT;
     111void rtVccCheckContextFailed(struct _CONTEXT *pCpuCtx);
     112
     113#ifdef _CONTROL_FLOW_GUARD
     114DECLASM(void)     __guard_check_icall_nop(uintptr_t); /**< nocrt-guard-win.asm */
     115#endif
     116extern uintptr_t  __guard_check_icall_fptr;           /**< nocrt-guard-win.asm */
    110117
    111118RT_C_DECLS_END
    112119
    113120
     121/**
     122 * Checks if CFG is currently active.
     123 *
     124 * This requires CFG to be enabled at compile time, supported by the host OS
     125 * version and activated by the module loader.
     126 *
     127 * @returns true if CFG is active, false if not.
     128 */
     129DECLINLINE(bool) rtVccIsGuardICallChecksActive(void)
     130{
     131#ifdef _CONTROL_FLOW_GUARD
     132    return __guard_check_icall_fptr != (uintptr_t)__guard_check_icall_nop;
     133#else
     134    return false;
     135#endif
     136}
     137
     138
     139#ifdef IPRT_INCLUDED_nt_nt_h
     140/**
     141 * Checks if a pointer is on the officially registered stack or not.
     142 *
     143 * @returns true if on the official stack, false if not.
     144 * @param   uStackPtr           The pointer to check.
     145 */
     146DECLINLINE(bool) rtVccIsPointerOnTheStack(uintptr_t uStackPtr)
     147{
     148    PNT_TIB const pTib = (PNT_TIB)RTNtCurrentTeb();
     149    return uStackPtr <= (uintptr_t)pTib->StackBase
     150        && uStackPtr >= (uintptr_t)pTib->StackLimit;
     151}
     152#endif
     153
    114154#endif /* !IPRT_INCLUDED_INTERNAL_compiler_vcc_h */
    115155
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette