Win32Hid.cs
author StephaneLenclud
Sun, 15 Feb 2015 22:13:33 +0100
changeset 64 8c2380995bb7
parent 59 89dfad9633b2
child 68 bbe61b1021bb
permissions -rw-r--r--
Adding input capabilities description to device list.
sl@17
     1
using System;
sl@17
     2
using System.Runtime.InteropServices;
sl@23
     3
using Microsoft.Win32.SafeHandles;
sl@23
     4
using System.Text;
sl@17
     5
sl@17
     6
namespace Win32
sl@17
     7
{
sl@17
     8
sl@17
     9
    static partial class Function
sl@17
    10
    {
sl@17
    11
        [DllImport("hid.dll", CharSet = CharSet.Unicode)]
sl@17
    12
        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);
sl@23
    13
sl@23
    14
        [DllImport("hid.dll", CharSet = CharSet.Auto, SetLastError = true)]
sl@24
    15
        public static extern Boolean HidD_GetManufacturerString(SafeFileHandle HidDeviceObject, StringBuilder Buffer, Int32 BufferLength);
sl@24
    16
sl@24
    17
        [DllImport("hid.dll", CharSet = CharSet.Auto, SetLastError = true)]
sl@24
    18
        public static extern Boolean HidD_GetProductString(SafeFileHandle HidDeviceObject, StringBuilder Buffer, Int32 BufferLength);
sl@23
    19
sl@25
    20
        [DllImport("hid.dll", CharSet = CharSet.Auto, SetLastError = true)]
sl@25
    21
        public static extern Boolean HidD_GetAttributes(SafeFileHandle HidDeviceObject, ref HIDD_ATTRIBUTES Attributes);
StephaneLenclud@50
    22
StephaneLenclud@51
    23
        /// Return Type: NTSTATUS->LONG->int
StephaneLenclud@51
    24
        ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA*
StephaneLenclud@51
    25
        ///Capabilities: PHIDP_CAPS->_HIDP_CAPS*
StephaneLenclud@51
    26
        [DllImportAttribute("hid.dll", EntryPoint = "HidP_GetCaps", CallingConvention = CallingConvention.StdCall)]
StephaneLenclud@56
    27
        public static extern HidStatus HidP_GetCaps(System.IntPtr PreparsedData, ref HIDP_CAPS Capabilities);
StephaneLenclud@50
    28
StephaneLenclud@51
    29
        /// Return Type: NTSTATUS->LONG->int
StephaneLenclud@51
    30
        ///ReportType: HIDP_REPORT_TYPE->_HIDP_REPORT_TYPE
StephaneLenclud@51
    31
        ///ButtonCaps: PHIDP_BUTTON_CAPS->_HIDP_BUTTON_CAPS*
StephaneLenclud@51
    32
        ///ButtonCapsLength: PUSHORT->USHORT*
StephaneLenclud@51
    33
        ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA*
StephaneLenclud@56
    34
        [System.Runtime.InteropServices.DllImportAttribute("hid.dll", EntryPoint = "HidP_GetButtonCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
StephaneLenclud@56
    35
        public static extern HidStatus HidP_GetButtonCaps(HIDP_REPORT_TYPE ReportType, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] HIDP_BUTTON_CAPS[] ButtonCaps, ref ushort ButtonCapsLength, System.IntPtr PreparsedData);
StephaneLenclud@50
    36
StephaneLenclud@51
    37
        /// Return Type: NTSTATUS->LONG->int
StephaneLenclud@51
    38
        ///ReportType: HIDP_REPORT_TYPE->_HIDP_REPORT_TYPE
StephaneLenclud@51
    39
        ///ValueCaps: PHIDP_VALUE_CAPS->_HIDP_VALUE_CAPS*
StephaneLenclud@51
    40
        ///ValueCapsLength: PUSHORT->USHORT*
StephaneLenclud@51
    41
        ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA*
StephaneLenclud@56
    42
        [System.Runtime.InteropServices.DllImportAttribute("hid.dll", EntryPoint = "HidP_GetValueCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
StephaneLenclud@58
    43
        public static extern HidStatus HidP_GetValueCaps(HIDP_REPORT_TYPE ReportType, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] HIDP_VALUE_CAPS[] ValueCaps, ref ushort ValueCapsLength, System.IntPtr PreparsedData);
StephaneLenclud@50
    44
sl@17
    45
    }
sl@17
    46
sl@17
    47
sl@17
    48
    static partial class Macro
sl@17
    49
    {
sl@17
    50
sl@17
    51
sl@17
    52
    }
sl@17
    53
sl@17
    54
sl@17
    55
    static partial class Const
sl@17
    56
    {
sl@17
    57
sl@17
    58
sl@17
    59
    }
sl@17
    60
sl@17
    61
sl@17
    62
    public enum HIDP_REPORT_TYPE : ushort
sl@17
    63
    {
sl@17
    64
        HidP_Input = 0,
sl@17
    65
        HidP_Output,
sl@17
    66
        HidP_Feature
sl@17
    67
    }
sl@17
    68
sl@17
    69
sl@17
    70
    public enum HidStatus : uint
sl@17
    71
    {
sl@17
    72
        HIDP_STATUS_SUCCESS = 0x110000,
sl@17
    73
        HIDP_STATUS_NULL = 0x80110001,
sl@17
    74
        HIDP_STATUS_INVALID_PREPARSED_DATA = 0xc0110001,
sl@17
    75
        HIDP_STATUS_INVALID_REPORT_TYPE = 0xc0110002,
sl@17
    76
        HIDP_STATUS_INVALID_REPORT_LENGTH = 0xc0110003,
sl@17
    77
        HIDP_STATUS_USAGE_NOT_FOUND = 0xc0110004,
sl@17
    78
        HIDP_STATUS_VALUE_OUT_OF_RANGE = 0xc0110005,
sl@17
    79
        HIDP_STATUS_BAD_LOG_PHY_VALUES = 0xc0110006,
sl@17
    80
        HIDP_STATUS_BUFFER_TOO_SMALL = 0xc0110007,
sl@17
    81
        HIDP_STATUS_INTERNAL_ERROR = 0xc0110008,
sl@17
    82
        HIDP_STATUS_I8042_TRANS_UNKNOWN = 0xc0110009,
sl@17
    83
        HIDP_STATUS_INCOMPATIBLE_REPORT_ID = 0xc011000a,
sl@17
    84
        HIDP_STATUS_NOT_VALUE_ARRAY = 0xc011000b,
sl@17
    85
        HIDP_STATUS_IS_VALUE_ARRAY = 0xc011000c,
sl@17
    86
        HIDP_STATUS_DATA_INDEX_NOT_FOUND = 0xc011000d,
sl@17
    87
        HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE = 0xc011000e,
sl@17
    88
        HIDP_STATUS_BUTTON_NOT_PRESSED = 0xc011000f,
sl@17
    89
        HIDP_STATUS_REPORT_DOES_NOT_EXIST = 0xc0110010,
sl@17
    90
        HIDP_STATUS_NOT_IMPLEMENTED = 0xc0110020,
sl@17
    91
        HIDP_STATUS_I8242_TRANS_UNKNOWN = 0xc0110009
sl@17
    92
    }
sl@17
    93
sl@17
    94
sl@17
    95
    [StructLayout(LayoutKind.Sequential)]
sl@17
    96
    public struct USAGE_AND_PAGE
sl@17
    97
    {
sl@17
    98
        public ushort Usage;
sl@17
    99
        public ushort UsagePage;
sl@17
   100
    };
sl@17
   101
sl@25
   102
    [StructLayout(LayoutKind.Sequential)]
sl@25
   103
    public struct HIDD_ATTRIBUTES
sl@25
   104
    {
sl@25
   105
        public uint Size;
sl@25
   106
        public ushort VendorID;
sl@25
   107
        public ushort ProductID;
sl@25
   108
        public ushort VersionNumber;
sl@25
   109
    }
sl@25
   110
sl@17
   111
StephaneLenclud@51
   112
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   113
    public struct HIDP_CAPS
StephaneLenclud@51
   114
    {
StephaneLenclud@51
   115
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   116
        public ushort Usage;
StephaneLenclud@50
   117
StephaneLenclud@51
   118
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   119
        public ushort UsagePage;
StephaneLenclud@50
   120
StephaneLenclud@51
   121
        /// USHORT->unsigned short
StephaneLenclud@51
   122
        public ushort InputReportByteLength;
StephaneLenclud@50
   123
StephaneLenclud@51
   124
        /// USHORT->unsigned short
StephaneLenclud@51
   125
        public ushort OutputReportByteLength;
StephaneLenclud@50
   126
StephaneLenclud@51
   127
        /// USHORT->unsigned short
StephaneLenclud@51
   128
        public ushort FeatureReportByteLength;
StephaneLenclud@50
   129
StephaneLenclud@51
   130
        /// USHORT[17]
StephaneLenclud@51
   131
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 17, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)]
StephaneLenclud@51
   132
        public ushort[] Reserved;
StephaneLenclud@50
   133
StephaneLenclud@51
   134
        /// USHORT->unsigned short
StephaneLenclud@51
   135
        public ushort NumberLinkCollectionNodes;
StephaneLenclud@50
   136
StephaneLenclud@51
   137
        /// USHORT->unsigned short
StephaneLenclud@51
   138
        public ushort NumberInputButtonCaps;
StephaneLenclud@50
   139
StephaneLenclud@51
   140
        /// USHORT->unsigned short
StephaneLenclud@51
   141
        public ushort NumberInputValueCaps;
StephaneLenclud@50
   142
StephaneLenclud@51
   143
        /// USHORT->unsigned short
StephaneLenclud@51
   144
        public ushort NumberInputDataIndices;
StephaneLenclud@50
   145
StephaneLenclud@51
   146
        /// USHORT->unsigned short
StephaneLenclud@51
   147
        public ushort NumberOutputButtonCaps;
StephaneLenclud@50
   148
StephaneLenclud@51
   149
        /// USHORT->unsigned short
StephaneLenclud@51
   150
        public ushort NumberOutputValueCaps;
StephaneLenclud@50
   151
StephaneLenclud@51
   152
        /// USHORT->unsigned short
StephaneLenclud@51
   153
        public ushort NumberOutputDataIndices;
StephaneLenclud@50
   154
StephaneLenclud@51
   155
        /// USHORT->unsigned short
StephaneLenclud@51
   156
        public ushort NumberFeatureButtonCaps;
StephaneLenclud@50
   157
StephaneLenclud@51
   158
        /// USHORT->unsigned short
StephaneLenclud@51
   159
        public ushort NumberFeatureValueCaps;
StephaneLenclud@50
   160
StephaneLenclud@51
   161
        /// USHORT->unsigned short
StephaneLenclud@51
   162
        public ushort NumberFeatureDataIndices;
StephaneLenclud@51
   163
    }
StephaneLenclud@50
   164
StephaneLenclud@51
   165
    /// <summary>
StephaneLenclud@51
   166
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   167
    /// </summary>
StephaneLenclud@51
   168
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   169
    public struct HIDP_BUTTON_CAPS_RANGE
StephaneLenclud@51
   170
    {
StephaneLenclud@50
   171
StephaneLenclud@51
   172
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   173
        public ushort UsageMin;
StephaneLenclud@50
   174
StephaneLenclud@51
   175
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   176
        public ushort UsageMax;
StephaneLenclud@50
   177
StephaneLenclud@51
   178
        /// USHORT->unsigned short
StephaneLenclud@51
   179
        public ushort StringMin;
StephaneLenclud@50
   180
StephaneLenclud@51
   181
        /// USHORT->unsigned short
StephaneLenclud@51
   182
        public ushort StringMax;
StephaneLenclud@50
   183
StephaneLenclud@51
   184
        /// USHORT->unsigned short
StephaneLenclud@51
   185
        public ushort DesignatorMin;
StephaneLenclud@50
   186
StephaneLenclud@51
   187
        /// USHORT->unsigned short
StephaneLenclud@51
   188
        public ushort DesignatorMax;
StephaneLenclud@50
   189
StephaneLenclud@51
   190
        /// USHORT->unsigned short
StephaneLenclud@51
   191
        public ushort DataIndexMin;
StephaneLenclud@50
   192
StephaneLenclud@51
   193
        /// USHORT->unsigned short
StephaneLenclud@51
   194
        public ushort DataIndexMax;
StephaneLenclud@51
   195
    }
StephaneLenclud@50
   196
StephaneLenclud@51
   197
    /// <summary>
StephaneLenclud@51
   198
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   199
    /// </summary>
StephaneLenclud@51
   200
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   201
    public struct HIDP_BUTTON_CAPS_NOT_RANGE
StephaneLenclud@51
   202
    {
StephaneLenclud@50
   203
StephaneLenclud@51
   204
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   205
        public ushort Usage;
StephaneLenclud@50
   206
StephaneLenclud@51
   207
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   208
        public ushort Reserved1;
StephaneLenclud@50
   209
StephaneLenclud@51
   210
        /// USHORT->unsigned short
StephaneLenclud@51
   211
        public ushort StringIndex;
StephaneLenclud@50
   212
StephaneLenclud@51
   213
        /// USHORT->unsigned short
StephaneLenclud@51
   214
        public ushort Reserved2;
StephaneLenclud@50
   215
StephaneLenclud@51
   216
        /// USHORT->unsigned short
StephaneLenclud@51
   217
        public ushort DesignatorIndex;
StephaneLenclud@50
   218
StephaneLenclud@51
   219
        /// USHORT->unsigned short
StephaneLenclud@51
   220
        public ushort Reserved3;
StephaneLenclud@50
   221
StephaneLenclud@51
   222
        /// USHORT->unsigned short
StephaneLenclud@51
   223
        public ushort DataIndex;
StephaneLenclud@50
   224
StephaneLenclud@51
   225
        /// USHORT->unsigned short
StephaneLenclud@51
   226
        public ushort Reserved4;
StephaneLenclud@51
   227
    }
StephaneLenclud@50
   228
StephaneLenclud@57
   229
    /// <summary>
StephaneLenclud@57
   230
    /// 
StephaneLenclud@57
   231
    /// </summary>
StephaneLenclud@57
   232
    [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)]
StephaneLenclud@51
   233
    public struct HIDP_BUTTON_CAPS
StephaneLenclud@51
   234
    {
StephaneLenclud@51
   235
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   236
        [FieldOffset(0)]
StephaneLenclud@51
   237
        public ushort UsagePage;
StephaneLenclud@50
   238
StephaneLenclud@51
   239
        /// UCHAR->unsigned char
StephaneLenclud@57
   240
        [FieldOffset(2)]
StephaneLenclud@51
   241
        public byte ReportID;
StephaneLenclud@50
   242
StephaneLenclud@51
   243
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   244
        [FieldOffset(3)]
StephaneLenclud@59
   245
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   246
        public bool IsAlias;
StephaneLenclud@50
   247
StephaneLenclud@51
   248
        /// USHORT->unsigned short
StephaneLenclud@57
   249
        [FieldOffset(4)]
StephaneLenclud@51
   250
        public ushort BitField;
StephaneLenclud@50
   251
StephaneLenclud@51
   252
        /// USHORT->unsigned short
StephaneLenclud@57
   253
        [FieldOffset(6)]
StephaneLenclud@51
   254
        public ushort LinkCollection;
StephaneLenclud@50
   255
StephaneLenclud@51
   256
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   257
        [FieldOffset(8)]
StephaneLenclud@51
   258
        public ushort LinkUsage;
StephaneLenclud@50
   259
StephaneLenclud@51
   260
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   261
        [FieldOffset(10)]
StephaneLenclud@51
   262
        public ushort LinkUsagePage;
StephaneLenclud@50
   263
StephaneLenclud@51
   264
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   265
        [FieldOffset(12)]
StephaneLenclud@59
   266
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   267
        public bool IsRange;
StephaneLenclud@50
   268
StephaneLenclud@51
   269
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   270
        [FieldOffset(13)]
StephaneLenclud@59
   271
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   272
        public bool IsStringRange;
StephaneLenclud@50
   273
StephaneLenclud@51
   274
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   275
        [FieldOffset(14)]
StephaneLenclud@59
   276
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   277
        public bool IsDesignatorRange;
StephaneLenclud@50
   278
StephaneLenclud@51
   279
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   280
        [FieldOffset(15)]
StephaneLenclud@59
   281
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   282
        public bool IsAbsolute;
StephaneLenclud@50
   283
StephaneLenclud@51
   284
        /// ULONG[10]
StephaneLenclud@57
   285
        [FieldOffset(16)]
StephaneLenclud@57
   286
        [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.U4)]
StephaneLenclud@51
   287
        public uint[] Reserved;
StephaneLenclud@50
   288
StephaneLenclud@57
   289
        /// Union Range/NotRange
StephaneLenclud@57
   290
        [FieldOffset(56)]
StephaneLenclud@57
   291
        HIDP_BUTTON_CAPS_RANGE Range;
StephaneLenclud@57
   292
StephaneLenclud@57
   293
        [FieldOffset(56)]
StephaneLenclud@57
   294
        HIDP_BUTTON_CAPS_NOT_RANGE NotRange;       
StephaneLenclud@51
   295
    }
StephaneLenclud@50
   296
StephaneLenclud@51
   297
    /// <summary>
StephaneLenclud@51
   298
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   299
    /// </summary>
StephaneLenclud@51
   300
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   301
    public struct HIDP_VALUE_CAPS_RANGE
StephaneLenclud@51
   302
    {
StephaneLenclud@50
   303
StephaneLenclud@51
   304
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   305
        public ushort UsageMin;
StephaneLenclud@50
   306
StephaneLenclud@51
   307
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   308
        public ushort UsageMax;
StephaneLenclud@50
   309
StephaneLenclud@51
   310
        /// USHORT->unsigned short
StephaneLenclud@51
   311
        public ushort StringMin;
StephaneLenclud@50
   312
StephaneLenclud@51
   313
        /// USHORT->unsigned short
StephaneLenclud@51
   314
        public ushort StringMax;
StephaneLenclud@50
   315
StephaneLenclud@51
   316
        /// USHORT->unsigned short
StephaneLenclud@51
   317
        public ushort DesignatorMin;
StephaneLenclud@50
   318
StephaneLenclud@51
   319
        /// USHORT->unsigned short
StephaneLenclud@51
   320
        public ushort DesignatorMax;
StephaneLenclud@50
   321
StephaneLenclud@51
   322
        /// USHORT->unsigned short
StephaneLenclud@51
   323
        public ushort DataIndexMin;
StephaneLenclud@50
   324
StephaneLenclud@51
   325
        /// USHORT->unsigned short
StephaneLenclud@51
   326
        public ushort DataIndexMax;
StephaneLenclud@51
   327
    }
StephaneLenclud@50
   328
StephaneLenclud@51
   329
    /// <summary>
StephaneLenclud@51
   330
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   331
    /// </summary>
StephaneLenclud@51
   332
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   333
    public struct HIDP_VALUE_CAPS_NOT_RANGE
StephaneLenclud@51
   334
    {
StephaneLenclud@50
   335
StephaneLenclud@51
   336
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   337
        public ushort Usage;
StephaneLenclud@50
   338
StephaneLenclud@51
   339
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   340
        public ushort Reserved1;
StephaneLenclud@50
   341
StephaneLenclud@51
   342
        /// USHORT->unsigned short
StephaneLenclud@51
   343
        public ushort StringIndex;
StephaneLenclud@50
   344
StephaneLenclud@51
   345
        /// USHORT->unsigned short
StephaneLenclud@51
   346
        public ushort Reserved2;
StephaneLenclud@50
   347
StephaneLenclud@51
   348
        /// USHORT->unsigned short
StephaneLenclud@51
   349
        public ushort DesignatorIndex;
StephaneLenclud@50
   350
StephaneLenclud@51
   351
        /// USHORT->unsigned short
StephaneLenclud@51
   352
        public ushort Reserved3;
StephaneLenclud@50
   353
StephaneLenclud@51
   354
        /// USHORT->unsigned short
StephaneLenclud@51
   355
        public ushort DataIndex;
StephaneLenclud@50
   356
StephaneLenclud@51
   357
        /// USHORT->unsigned short
StephaneLenclud@51
   358
        public ushort Reserved4;
StephaneLenclud@51
   359
    }
StephaneLenclud@50
   360
StephaneLenclud@50
   361
StephaneLenclud@59
   362
    /// <summary>
StephaneLenclud@59
   363
    /// 
StephaneLenclud@59
   364
    /// </summary>
StephaneLenclud@59
   365
    [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)]
StephaneLenclud@51
   366
    public struct HIDP_VALUE_CAPS
StephaneLenclud@51
   367
    {
StephaneLenclud@50
   368
StephaneLenclud@51
   369
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   370
        [FieldOffset(0)]
StephaneLenclud@51
   371
        public ushort UsagePage;
StephaneLenclud@50
   372
StephaneLenclud@51
   373
        /// UCHAR->unsigned char
StephaneLenclud@59
   374
        [FieldOffset(2)]
StephaneLenclud@51
   375
        public byte ReportID;
StephaneLenclud@50
   376
StephaneLenclud@51
   377
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   378
        [FieldOffset(3)]
StephaneLenclud@59
   379
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   380
        public bool IsAlias;
StephaneLenclud@50
   381
StephaneLenclud@51
   382
        /// USHORT->unsigned short
StephaneLenclud@59
   383
        [FieldOffset(4)]
StephaneLenclud@51
   384
        public ushort BitField;
StephaneLenclud@50
   385
StephaneLenclud@51
   386
        /// USHORT->unsigned short
StephaneLenclud@59
   387
        [FieldOffset(6)]
StephaneLenclud@51
   388
        public ushort LinkCollection;
StephaneLenclud@50
   389
StephaneLenclud@51
   390
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   391
        [FieldOffset(8)]
StephaneLenclud@51
   392
        public ushort LinkUsage;
StephaneLenclud@50
   393
StephaneLenclud@51
   394
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   395
        [FieldOffset(10)]
StephaneLenclud@51
   396
        public ushort LinkUsagePage;
StephaneLenclud@50
   397
StephaneLenclud@51
   398
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   399
        [FieldOffset(12)]
StephaneLenclud@59
   400
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   401
        public bool IsRange;
StephaneLenclud@50
   402
StephaneLenclud@51
   403
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   404
        [FieldOffset(13)]
StephaneLenclud@59
   405
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   406
        public bool IsStringRange;
StephaneLenclud@50
   407
StephaneLenclud@51
   408
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   409
        [FieldOffset(14)]
StephaneLenclud@59
   410
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   411
        public bool IsDesignatorRange;
StephaneLenclud@50
   412
StephaneLenclud@51
   413
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   414
        [FieldOffset(15)]
StephaneLenclud@59
   415
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   416
        public bool IsAbsolute;
StephaneLenclud@50
   417
StephaneLenclud@51
   418
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   419
        [FieldOffset(16)]
StephaneLenclud@59
   420
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   421
        public bool HasNull;
StephaneLenclud@50
   422
StephaneLenclud@51
   423
        /// UCHAR->unsigned char
StephaneLenclud@59
   424
        [FieldOffset(17)]
StephaneLenclud@51
   425
        public byte Reserved;
StephaneLenclud@50
   426
StephaneLenclud@51
   427
        /// USHORT->unsigned short
StephaneLenclud@59
   428
        [FieldOffset(18)]
StephaneLenclud@51
   429
        public ushort BitSize;
StephaneLenclud@50
   430
StephaneLenclud@51
   431
        /// USHORT->unsigned short
StephaneLenclud@59
   432
        [FieldOffset(20)]
StephaneLenclud@51
   433
        public ushort ReportCount;
StephaneLenclud@50
   434
StephaneLenclud@51
   435
        /// USHORT[5]
StephaneLenclud@59
   436
        /// We had to use 5 ushorts instead of an array to avoid alignment exception issues.
StephaneLenclud@59
   437
        [FieldOffset(22)]
StephaneLenclud@59
   438
        public ushort Reserved21;
StephaneLenclud@59
   439
        [FieldOffset(24)]
StephaneLenclud@59
   440
        public ushort Reserved22;
StephaneLenclud@59
   441
        [FieldOffset(26)]
StephaneLenclud@59
   442
        public ushort Reserved23;
StephaneLenclud@59
   443
        [FieldOffset(28)]
StephaneLenclud@59
   444
        public ushort Reserved24;
StephaneLenclud@59
   445
        [FieldOffset(30)]
StephaneLenclud@59
   446
        public ushort Reserved25;
StephaneLenclud@50
   447
StephaneLenclud@51
   448
        /// ULONG->unsigned int
StephaneLenclud@59
   449
        [FieldOffset(32)]
StephaneLenclud@51
   450
        public uint UnitsExp;
StephaneLenclud@50
   451
StephaneLenclud@51
   452
        /// ULONG->unsigned int
StephaneLenclud@59
   453
        [FieldOffset(36)]
StephaneLenclud@51
   454
        public uint Units;
StephaneLenclud@50
   455
StephaneLenclud@51
   456
        /// LONG->int
StephaneLenclud@59
   457
        [FieldOffset(40)]
StephaneLenclud@51
   458
        public int LogicalMin;
StephaneLenclud@50
   459
StephaneLenclud@51
   460
        /// LONG->int
StephaneLenclud@59
   461
        [FieldOffset(44)]
StephaneLenclud@51
   462
        public int LogicalMax;
StephaneLenclud@50
   463
StephaneLenclud@51
   464
        /// LONG->int
StephaneLenclud@59
   465
        [FieldOffset(48)]
StephaneLenclud@51
   466
        public int PhysicalMin;
StephaneLenclud@50
   467
StephaneLenclud@51
   468
        /// LONG->int
StephaneLenclud@59
   469
        [FieldOffset(52)]
StephaneLenclud@51
   470
        public int PhysicalMax;
StephaneLenclud@50
   471
StephaneLenclud@59
   472
        /// Union Range/NotRange
StephaneLenclud@59
   473
        [FieldOffset(56)]
StephaneLenclud@59
   474
        public HIDP_VALUE_CAPS_RANGE Range;
StephaneLenclud@59
   475
StephaneLenclud@59
   476
        [FieldOffset(56)]
StephaneLenclud@59
   477
        public HIDP_VALUE_CAPS_NOT_RANGE NotRange;
StephaneLenclud@51
   478
    }
StephaneLenclud@59
   479
    
StephaneLenclud@51
   480
}
StephaneLenclud@50
   481
StephaneLenclud@51
   482