mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 12:44:16 +01:00
Fix chained ctor confusing callingAssembly value
This commit is contained in:
parent
067ffc9fd2
commit
9c27212d37
1 changed files with 7 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ namespace Dalamud.Hooking
|
||||||
/// <param name="address">A memory address to install a hook.</param>
|
/// <param name="address">A memory address to install a hook.</param>
|
||||||
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
|
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
|
||||||
public Hook(IntPtr address, T detour)
|
public Hook(IntPtr address, T detour)
|
||||||
: this(address, detour, false)
|
: this(address, detour, false, Assembly.GetCallingAssembly())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,6 +40,11 @@ namespace Dalamud.Hooking
|
||||||
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
|
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
|
||||||
/// <param name="useMinHook">Use the MinHook hooking library instead of Reloaded.</param>
|
/// <param name="useMinHook">Use the MinHook hooking library instead of Reloaded.</param>
|
||||||
public Hook(IntPtr address, T detour, bool useMinHook)
|
public Hook(IntPtr address, T detour, bool useMinHook)
|
||||||
|
: this(address, detour, useMinHook, Assembly.GetCallingAssembly())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private Hook(IntPtr address, T detour, bool useMinHook, Assembly callingAssembly)
|
||||||
{
|
{
|
||||||
address = HookManager.FollowJmp(address);
|
address = HookManager.FollowJmp(address);
|
||||||
this.isMinHook = EnvironmentConfiguration.DalamudForceMinHook || useMinHook;
|
this.isMinHook = EnvironmentConfiguration.DalamudForceMinHook || useMinHook;
|
||||||
|
|
@ -69,7 +74,7 @@ namespace Dalamud.Hooking
|
||||||
this.hookImpl = ReloadedHooks.Instance.CreateHook<T>(detour, address.ToInt64());
|
this.hookImpl = ReloadedHooks.Instance.CreateHook<T>(detour, address.ToInt64());
|
||||||
}
|
}
|
||||||
|
|
||||||
HookManager.TrackedHooks.Add(new HookInfo(this, detour, Assembly.GetCallingAssembly()));
|
HookManager.TrackedHooks.Add(new HookInfo(this, detour, callingAssembly));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue