dr_call_on_clean_stack

Function dr_call_on_clean_stack 

Source
pub unsafe extern "C" fn dr_call_on_clean_stack(
    drcontext: *mut c_void,
    func: Option<unsafe extern "C" fn() -> *mut c_void>,
    arg1: *mut c_void,
    arg2: *mut c_void,
    arg3: *mut c_void,
    arg4: *mut c_void,
    arg5: *mut c_void,
    arg6: *mut c_void,
    arg7: *mut c_void,
    arg8: *mut c_void,
) -> *mut c_void
Expand description

Calls the specified function \p func after switching to the DR stack for the thread corresponding to \p drcontext. Passes in 8 arguments. Uses the C calling convention, so \p func will work just fine even if if takes fewer than 8 args. Swaps the stack back upon return and returns the value returned by \p func.

On Windows, this routine does swap the TEB stack fields, avoiding issues with fault handling on Windows 8.1. This means there is no need for the callee to use dr_switch_to_dr_state_ex() with DR_STATE_STACK_BOUNDS.