using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Threading;

namespace Sasa.QualityTools.DrFx.Tests.Violation.CSharp.Microsoft.Interoperability
{
    public class Rule1415
    {
        public IntPtr File { get; set; }

        // このメソッドは CA1415 に違反しています。
        [SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
        [DllImport("kernel32.dll", SetLastError = true)]
        internal extern static uint ReadFile(IntPtr hFile, IntPtr lpBuffer, int nNumberOfBytesToRead, IntPtr lpNumberOfBytesRead, IntPtr overlapped);

        public uint ReadFile(IntPtr buffer, int number, IntPtr bytes, IntPtr overlapped)
        {
            return ReadFile(File, buffer, number, bytes, overlapped);
        }
    }
}
