Skip to content
Concord

Interface IForeignPatchObserver

Namespace
Concord.Detour
Assembly
Concord.Detour.dll

Receives notice from a foreign patch host that a method is about to be rebuilt, so Concord can move a target it already detoured onto the host before the host takes the entry point.

public interface IForeignPatchObserver

Methods

OnForeignPatchPending(MethodBase, object)

Called just before the host rebuilds target, while the host holds its own lock. Implementations must not throw: an exception here escapes into the foreign library and breaks an unrelated caller's patch.

void OnForeignPatchPending(MethodBase target, object hostPatchState)

Parameters

target MethodBase

The method the host is about to rebuild.

hostPatchState object

The host's own patch record for this rebuild, opaque to Concord. Concord must contribute through this object rather than by calling back into the host: the host applies and stores this record after the rebuild returns, so anything registered by a nested call is overwritten.