Method GetRetargetBytes
GetRetargetBytes(NativeDetourInfo, NativeDetourInfo, Span<byte>, out IDisposable?, out bool, out bool)
Gets the actual bytes to apply to perform the retarget.
int GetRetargetBytes(NativeDetourInfo original, NativeDetourInfo retarget, Span<byte> buffer, out IDisposable? allocationHandle, out bool needsRepatch, out bool disposeOldAlloc)
Parameters
originalNativeDetourInfo- The original detour being retargeted.
retargetNativeDetourInfo- The NativeDetourInfo returned by ComputeRetargetInfo(NativeDetourInfo, nint, int) for this retarget.
bufferSpan<byte>- The buffer to write the patch data into. This must be at least Size (of
retargetbytes in length. allocationHandleIDisposable- A handle to any allocation which must stay alive with the detour.
needsRepatchbool- true if the data in
buffershould be patched into source location. If this is false, the data should not be patched in. disposeOldAllocbool- true if allocations associated with the old detour should be disposed. If this is false, then the old allocations should not be disposed, but do not necessarily need to be kept alive.
Returns
- int
- The number of bytes written to the buffer.
- See Also