File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
Il2CppInterop.HarmonySupport
Il2CppInterop.Runtime/Injection Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,8 @@ public override MethodBase DetourTo(MethodBase replacement)
143143
144144 DelegateCache [ Original ] = unmanagedDelegate ;
145145
146- var detourPtr =
147- Marshal . GetFunctionPointerForDelegate ( unmanagedDelegate ) ;
148146 nativeDetour =
149- Il2CppInteropRuntime . Instance . DetourProvider . Create ( originalNativeMethodInfo . MethodPointer , detourPtr ) ;
147+ Il2CppInteropRuntime . Instance . DetourProvider . Create ( originalNativeMethodInfo . MethodPointer , unmanagedDelegate ) ;
150148 nativeDetour . Apply ( ) ;
151149 modifiedNativeMethodInfo . MethodPointer = nativeDetour . OriginalTrampoline ;
152150
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public interface IDetour : IDisposable
1515
1616public interface IDetourProvider
1717{
18- IDetour Create < TDelegate > ( nint original , TDelegate target ) ;
18+ IDetour Create < TDelegate > ( nint original , TDelegate target ) where TDelegate : Delegate ;
1919}
2020
2121internal static class Detour
You can’t perform that action at this time.
0 commit comments