mirror of
https://github.com/Microsoft/Detours
synced 2026-06-08 11:44:51 +00:00
Page:
DetourAttachEx
Pages
DetourAllocateRegionWithinJumpBounds
DetourAttach
DetourAttachEx
DetourBinaryBywayCallback
DetourBinaryClose
DetourBinaryCommitCallback
DetourBinaryDeletePayload
DetourBinaryEditImports
DetourBinaryEnumeratePayloads
DetourBinaryFileCallback
DetourBinaryFindPayload
DetourBinaryOpen
DetourBinaryPurgePayloads
DetourBinaryResetImports
DetourBinarySetPayload
DetourBinarySymbolCallback
DetourBinaryWrite
DetourCodeFromPointer
DetourCopyPayloadToProcess
DetourCopyPayloadToProcessEx
DetourCreateProcessWithDll
DetourCreateProcessWithDllEx
DetourCreateProcessWithDlls
DetourDetach
DetourEnumerateExportCallback
DetourEnumerateExports
DetourEnumerateImports
DetourEnumerateImportsEx
DetourEnumerateModules
DetourFindFunction
DetourFindPayload
DetourFindPayloadEx
DetourFindRemotePayload
DetourFinishHelperProcess
DetourGetContainingModule
DetourGetEntryPoint
DetourGetModuleSize
DetourGetSizeOfPayloads
DetourImportFileCallback
DetourImportFuncCallback
DetourImportFuncCallbackEx
DetourIsHelperProcess
DetourRestoreAfterWith
DetourSetIgnoreTooSmall
DetourSetRetainRegions
DetourSetSystemRegionLowerBound
DetourSetSystemRegionUpperBound
DetourTransactionAbort
DetourTransactionBegin
DetourTransactionCommit
DetourTransactionCommitEx
DetourUpdateThread
FAQ
Home
OverviewHelpers
OverviewInterception
OverviewPayloads
Reference
SampleCommem
SampleCping
SampleDisas
SampleDtest
SampleDumpe
SampleDumpi
SampleDynamicAlloc
SampleEinst
SampleExcep
SampleFindFunc
SampleImpmunge
SampleMember
SamplePayload
SampleRegion
SampleSetdll
SampleSimple
SampleSlept
SampleSyelog
SampleTraceapi
SampleTracebld
SampleTracelnk
SampleTracemem
SampleTracereg
SampleTraceser
SampleTracetcp
SampleTryman
SampleWithdll
Samples
Using Detours
Clone
6
DetourAttachEx
Brian Gianforcaro edited this page 2021-07-21 14:59:46 -07:00
Table of Contents
DetourAttachEx
Attach a detour to a target function and retrieve additional detail about the ultimate target.
Definition
LONG DetourAttachEx(
_Inout_ PVOID * ppPointer,
_In_ PVOID pDetour,
_Out_opt_ PDETOUR_TRAMPOLINE * ppRealTrampoline
_Out_opt_ PVOID * ppRealTarget
_Out_opt_ PVOID * ppRealDetour
);
Parameters
- ppPointer
- Pointer to the target pointer to which the detour will be attached. See the remarks section below for additional considerations.
- pDetour
- Pointer to the detour function.
- ppRealTrampoline
- Variable to optionally receive the address of the trampoline.
- ppRealTarget
- Variable to optionally receive the final address of the target function.
- ppRealDetour
- Variable to optionally receive the final address of the detour function.
Return value
Returns NO_ERROR if successful; otherwise, returns an error code.
Error codes
- ERROR_INVALID_BLOCK
- The function referenced is too small to be detoured.
- ERROR_INVALID_HANDLE
- The
ppPointerparameter isNULL or points to aNULL` pointer. - ERROR_INVALID_OPERATION
- No pending transaction exists.
- ERROR_NOT_ENOUGH_MEMORY
- Not enough memory exists to complete the operation.
Remarks
Warning: The variable pointed to by the ppPointer argument must remain alive for the duration of the transaction, that is until DetourTransactionCommit, DetourTransactionCommitEx or DetourTransactionAbort is called.
DetourAttachEx attaches a detour to a target function and retrieves
additional detail about the ultimate target as part of the current
transaction opened by the DetourTransactionBegin
API.
For more information on using Detours to intercept function calls, see Interception of Binary Functions or Using Detours in the Detours Overview.