chore: warnings pass

This commit is contained in:
goat 2022-10-29 15:19:52 +02:00
parent 505e37fd28
commit b093323acc
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
49 changed files with 352 additions and 254 deletions

View file

@ -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);