Win32Hid.cs
changeset 23 743cadfacda0
parent 17 8f7e35c3bfd1
child 24 974f5fdaebfb
     1.1 --- a/Win32Hid.cs	Sat Dec 06 02:46:46 2014 +0100
     1.2 +++ b/Win32Hid.cs	Sat Dec 06 03:26:27 2014 +0100
     1.3 @@ -1,5 +1,7 @@
     1.4  using System;
     1.5  using System.Runtime.InteropServices;
     1.6 +using Microsoft.Win32.SafeHandles;
     1.7 +using System.Text;
     1.8  
     1.9  namespace Win32
    1.10  {
    1.11 @@ -8,6 +10,10 @@
    1.12      {
    1.13          [DllImport("hid.dll", CharSet = CharSet.Unicode)]
    1.14          public static extern HidStatus HidP_GetUsagesEx(HIDP_REPORT_TYPE ReportType, ushort LinkCollection, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] USAGE_AND_PAGE[] ButtonList, ref uint UsageLength, IntPtr PreparsedData, [MarshalAs(UnmanagedType.LPArray)] byte[] Report, uint ReportLength);
    1.15 +
    1.16 +        [DllImport("hid.dll", CharSet = CharSet.Auto, SetLastError = true)]
    1.17 +        public static extern Boolean HidD_GetManufacturerString(/*SafeFileHandle*/ IntPtr HidDeviceObject, StringBuilder Buffer, Int32 BufferLength);
    1.18 +
    1.19      }
    1.20  
    1.21