mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
chore: warnings pass
This commit is contained in:
parent
505e37fd28
commit
b093323acc
49 changed files with 352 additions and 254 deletions
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Dalamud.Memory;
|
||||
|
||||
namespace Dalamud.Hooking.Internal
|
||||
|
|
@ -96,8 +97,7 @@ namespace Dalamud.Hooking.Internal
|
|||
{
|
||||
lock (HookManager.HookEnableSyncRoot)
|
||||
{
|
||||
if (!NativeFunctions.VirtualProtect(this.Address, (UIntPtr)Marshal.SizeOf<IntPtr>(),
|
||||
MemoryProtection.ExecuteReadWrite, out var oldProtect))
|
||||
if (!NativeFunctions.VirtualProtect(this.Address, (UIntPtr)Marshal.SizeOf<IntPtr>(), MemoryProtection.ExecuteReadWrite, out var oldProtect))
|
||||
throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||
|
||||
Marshal.WriteIntPtr(this.Address, Marshal.GetFunctionPointerForDelegate(this.detourDelegate));
|
||||
|
|
@ -115,8 +115,7 @@ namespace Dalamud.Hooking.Internal
|
|||
{
|
||||
lock (HookManager.HookEnableSyncRoot)
|
||||
{
|
||||
if (!NativeFunctions.VirtualProtect(this.Address, (UIntPtr)Marshal.SizeOf<IntPtr>(),
|
||||
MemoryProtection.ExecuteReadWrite, out var oldProtect))
|
||||
if (!NativeFunctions.VirtualProtect(this.Address, (UIntPtr)Marshal.SizeOf<IntPtr>(), MemoryProtection.ExecuteReadWrite, out var oldProtect))
|
||||
throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||
|
||||
Marshal.WriteIntPtr(this.Address, this.pfnOriginal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue