Files
codeql/csharp/ql/src/Bad Practices/CallsUnmanagedCode.cs
2018-08-02 17:53:23 +01:00

15 lines
375 B
C#

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public partial class UnmanagedCodeExample : Form
{
[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
private void btnSayHello_Click(object sender, EventArgs e)
{
MessageBox(0, "Hello World", "Title", 0); // BAD
}
}