MemoryProtectionException.cs
1 using System; 2 using System.Runtime.InteropServices; 3 4 namespace Ryujinx.Memory 5 { 6 class MemoryProtectionException : Exception 7 { 8 public MemoryProtectionException() 9 { 10 } 11 12 public MemoryProtectionException(MemoryPermission permission) : base($"Failed to set memory protection to \"{permission}\": {Marshal.GetLastPInvokeErrorMessage()}") 13 { 14 } 15 16 public MemoryProtectionException(string message) : base(message) 17 { 18 } 19 20 public MemoryProtectionException(string message, Exception innerException) : base(message, innerException) 21 { 22 } 23 } 24 }