prefix methods with Hook to improve clarity

This commit is contained in:
goat 2023-09-21 22:09:38 +02:00
parent 173e9a3144
commit e31234ffec
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 11 additions and 11 deletions

View file

@ -47,7 +47,7 @@ internal class GameInteropProviderPluginScoped : IGameInteropProvider, IServiceT
}
/// <inheritdoc/>
public Hook<T> FromFunctionPointerVariable<T>(IntPtr address, T detour) where T : Delegate
public Hook<T> HookFromFunctionPointerVariable<T>(IntPtr address, T detour) where T : Delegate
{
var hook = Hook<T>.FromFunctionPointerVariable(address, detour);
this.trackedHooks.Add(hook);
@ -55,7 +55,7 @@ internal class GameInteropProviderPluginScoped : IGameInteropProvider, IServiceT
}
/// <inheritdoc/>
public Hook<T> FromImport<T>(ProcessModule? module, string moduleName, string functionName, uint hintOrOrdinal, T detour) where T : Delegate
public Hook<T> HookFromImport<T>(ProcessModule? module, string moduleName, string functionName, uint hintOrOrdinal, T detour) where T : Delegate
{
var hook = Hook<T>.FromImport(module, moduleName, functionName, hintOrOrdinal, detour);
this.trackedHooks.Add(hook);
@ -63,7 +63,7 @@ internal class GameInteropProviderPluginScoped : IGameInteropProvider, IServiceT
}
/// <inheritdoc/>
public Hook<T> FromSymbol<T>(string moduleName, string exportName, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
public Hook<T> HookFromSymbol<T>(string moduleName, string exportName, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
{
var hook = Hook<T>.FromSymbol(moduleName, exportName, detour, backend == IGameInteropProvider.HookBackend.MinHook);
this.trackedHooks.Add(hook);
@ -71,7 +71,7 @@ internal class GameInteropProviderPluginScoped : IGameInteropProvider, IServiceT
}
/// <inheritdoc/>
public Hook<T> FromAddress<T>(IntPtr procAddress, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
public Hook<T> HookFromAddress<T>(IntPtr procAddress, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
{
var hook = Hook<T>.FromAddress(procAddress, detour, backend == IGameInteropProvider.HookBackend.MinHook);
this.trackedHooks.Add(hook);
@ -79,8 +79,8 @@ internal class GameInteropProviderPluginScoped : IGameInteropProvider, IServiceT
}
/// <inheritdoc/>
public Hook<T> FromSignature<T>(string signature, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
=> this.FromAddress(this.scanner.ScanText(signature), detour, backend);
public Hook<T> HookFromSignature<T>(string signature, T detour, IGameInteropProvider.HookBackend backend = IGameInteropProvider.HookBackend.Automatic) where T : Delegate
=> this.HookFromAddress(this.scanner.ScanText(signature), detour, backend);
/// <inheritdoc/>
public void Dispose()

View file

@ -46,7 +46,7 @@ public interface IGameInteropProvider
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
/// <returns>The hook with the supplied parameters.</returns>
/// <typeparam name="T">Delegate of detour.</typeparam>
public Hook<T> FromFunctionPointerVariable<T>(IntPtr address, T detour) where T : Delegate;
public Hook<T> HookFromFunctionPointerVariable<T>(IntPtr address, T detour) where T : Delegate;
/// <summary>
/// Creates a hook by rewriting import table address.
@ -58,7 +58,7 @@ public interface IGameInteropProvider
/// <param name="detour">Callback function. Delegate must have a same original function prototype.</param>
/// <returns>The hook with the supplied parameters.</returns>
/// <typeparam name="T">Delegate of detour.</typeparam>
public Hook<T> FromImport<T>(ProcessModule? module, string moduleName, string functionName, uint hintOrOrdinal, T detour) where T : Delegate;
public Hook<T> HookFromImport<T>(ProcessModule? module, string moduleName, string functionName, uint hintOrOrdinal, T detour) where T : Delegate;
/// <summary>
/// Creates a hook. Hooking address is inferred by calling to GetProcAddress() function.
@ -71,7 +71,7 @@ public interface IGameInteropProvider
/// <param name="backend">Hooking library to use.</param>
/// <returns>The hook with the supplied parameters.</returns>
/// <typeparam name="T">Delegate of detour.</typeparam>
Hook<T> FromSymbol<T>(string moduleName, string exportName, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
Hook<T> HookFromSymbol<T>(string moduleName, string exportName, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
/// <summary>
/// Creates a hook. Hooking address is inferred by calling to GetProcAddress() function.
@ -83,7 +83,7 @@ public interface IGameInteropProvider
/// <param name="backend">Hooking library to use.</param>
/// <returns>The hook with the supplied parameters.</returns>
/// <typeparam name="T">Delegate of detour.</typeparam>
Hook<T> FromAddress<T>(IntPtr procAddress, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
Hook<T> HookFromAddress<T>(IntPtr procAddress, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
/// <summary>
/// Creates a hook from a signature into the Dalamud target module.
@ -93,5 +93,5 @@ public interface IGameInteropProvider
/// <param name="backend">Hooking library to use.</param>
/// <returns>The hook with the supplied parameters.</returns>
/// <typeparam name="T">Delegate of detour.</typeparam>
Hook<T> FromSignature<T>(string signature, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
Hook<T> HookFromSignature<T>(string signature, T detour, HookBackend backend = HookBackend.Automatic) where T : Delegate;
}