using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace DS4Library { internal class NativeMethods { [StructLayout(LayoutKind.Sequential)] internal struct BLUETOOTH_FIND_RADIO_PARAMS { [MarshalAs(UnmanagedType.U4)] public int dwSize; } [DllImport("bthprops.cpl", CharSet = CharSet.Auto)] internal extern static IntPtr BluetoothFindFirstRadio(ref BLUETOOTH_FIND_RADIO_PARAMS pbtfrp, ref IntPtr phRadio); [DllImport("bthprops.cpl", CharSet = CharSet.Auto)] internal extern static bool BluetoothFindNextRadio(IntPtr hFind, ref IntPtr phRadio); [DllImport("bthprops.cpl", CharSet = CharSet.Auto)] internal extern static bool BluetoothFindRadioClose(IntPtr hFind); [DllImport("kernel32.dll", SetLastError = true)] internal static extern Boolean DeviceIoControl(IntPtr DeviceHandle, Int32 IoControlCode, ref long InBuffer, Int32 InBufferSize, IntPtr OutBuffer, Int32 OutBufferSize, ref Int32 BytesReturned, IntPtr Overlapped); [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)] internal static extern bool CloseHandle(IntPtr hObject); } }