Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed CA1060 warning.

  • Loading branch information...
commit e40bbbc7f5fb82f8b31d9d04bcfe5b6a998fb045 1 parent b680b3f
@polyethene authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 IronAHK/Debug.cs
View
11 IronAHK/Debug.cs
@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
+using System.Security;
namespace IronAHK
{
@@ -15,14 +16,18 @@ partial class Program
#endif
;
- [Conditional("DEBUG"), DllImport("kernel32.dll")]
- static extern void AllocConsole();
+ [SuppressUnmanagedCodeSecurityAttribute]
+ internal static class SafeNativeMethods
+ {
+ [DllImport("kernel32.dll")]
+ internal static extern bool AllocConsole();
+ }
[Conditional("DEBUG")]
static void Start(ref string[] args)
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
- AllocConsole();
+ SafeNativeMethods.AllocConsole();
const string source = "..{0}..{0}..{0}Tests{0}Code{0}isolated.ahk";
const string binary = "test.exe";
Please sign in to comment.
Something went wrong with that request. Please try again.