Permalink
Browse files

Fixed CA1060 warning.

  • Loading branch information...
1 parent b680b3f commit e40bbbc7f5fb82f8b31d9d04bcfe5b6a998fb045 polyethene committed Oct 29, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 IronAHK/Debug.cs
View
@@ -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";

0 comments on commit e40bbbc

Please sign in to comment.