Enable

Last Updated2022-02-01
Created At2021-11-17

Enable the detour of the function described in this detour setup. If you need to read the return value of the function, choose a post hook.

native bool Enable(HookMode mode, DHookCallback callback)

Parameters

The desired hook mode - pre or post. A pre hook calls your callback BEFORE the original function is called. You can access the parameters, set the return value, and skip the original function. A post hook calls your callback AFTER the original function executed. You can access the parameters and get/set the return value.
DHookCallback callback
Callback function.

Return Value

bool true if detour was enabled, false otherwise.

Error

Hook handle is not setup for a detour.