Win32Hid.cs
author StephaneLenclud
Sun, 15 Feb 2015 21:48:07 +0100
changeset 63 4b8b058de215
parent 58 7ef0f9dc229c
child 64 8c2380995bb7
permissions -rw-r--r--
HidDevice: Adding friendly name property.
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@50
   115
StephaneLenclud@51
   116
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   117
        public ushort Usage;
StephaneLenclud@50
   118
StephaneLenclud@51
   119
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   120
        public ushort UsagePage;
StephaneLenclud@50
   121
StephaneLenclud@51
   122
        /// USHORT->unsigned short
StephaneLenclud@51
   123
        public ushort InputReportByteLength;
StephaneLenclud@50
   124
StephaneLenclud@51
   125
        /// USHORT->unsigned short
StephaneLenclud@51
   126
        public ushort OutputReportByteLength;
StephaneLenclud@50
   127
StephaneLenclud@51
   128
        /// USHORT->unsigned short
StephaneLenclud@51
   129
        public ushort FeatureReportByteLength;
StephaneLenclud@50
   130
StephaneLenclud@51
   131
        /// USHORT[17]
StephaneLenclud@51
   132
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 17, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)]
StephaneLenclud@51
   133
        public ushort[] Reserved;
StephaneLenclud@50
   134
StephaneLenclud@51
   135
        /// USHORT->unsigned short
StephaneLenclud@51
   136
        public ushort NumberLinkCollectionNodes;
StephaneLenclud@50
   137
StephaneLenclud@51
   138
        /// USHORT->unsigned short
StephaneLenclud@51
   139
        public ushort NumberInputButtonCaps;
StephaneLenclud@50
   140
StephaneLenclud@51
   141
        /// USHORT->unsigned short
StephaneLenclud@51
   142
        public ushort NumberInputValueCaps;
StephaneLenclud@50
   143
StephaneLenclud@51
   144
        /// USHORT->unsigned short
StephaneLenclud@51
   145
        public ushort NumberInputDataIndices;
StephaneLenclud@50
   146
StephaneLenclud@51
   147
        /// USHORT->unsigned short
StephaneLenclud@51
   148
        public ushort NumberOutputButtonCaps;
StephaneLenclud@50
   149
StephaneLenclud@51
   150
        /// USHORT->unsigned short
StephaneLenclud@51
   151
        public ushort NumberOutputValueCaps;
StephaneLenclud@50
   152
StephaneLenclud@51
   153
        /// USHORT->unsigned short
StephaneLenclud@51
   154
        public ushort NumberOutputDataIndices;
StephaneLenclud@50
   155
StephaneLenclud@51
   156
        /// USHORT->unsigned short
StephaneLenclud@51
   157
        public ushort NumberFeatureButtonCaps;
StephaneLenclud@50
   158
StephaneLenclud@51
   159
        /// USHORT->unsigned short
StephaneLenclud@51
   160
        public ushort NumberFeatureValueCaps;
StephaneLenclud@50
   161
StephaneLenclud@51
   162
        /// USHORT->unsigned short
StephaneLenclud@51
   163
        public ushort NumberFeatureDataIndices;
StephaneLenclud@51
   164
    }
StephaneLenclud@50
   165
StephaneLenclud@51
   166
    /// <summary>
StephaneLenclud@51
   167
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   168
    /// </summary>
StephaneLenclud@51
   169
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   170
    public struct HIDP_BUTTON_CAPS_RANGE
StephaneLenclud@51
   171
    {
StephaneLenclud@50
   172
StephaneLenclud@51
   173
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   174
        public ushort UsageMin;
StephaneLenclud@50
   175
StephaneLenclud@51
   176
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   177
        public ushort UsageMax;
StephaneLenclud@50
   178
StephaneLenclud@51
   179
        /// USHORT->unsigned short
StephaneLenclud@51
   180
        public ushort StringMin;
StephaneLenclud@50
   181
StephaneLenclud@51
   182
        /// USHORT->unsigned short
StephaneLenclud@51
   183
        public ushort StringMax;
StephaneLenclud@50
   184
StephaneLenclud@51
   185
        /// USHORT->unsigned short
StephaneLenclud@51
   186
        public ushort DesignatorMin;
StephaneLenclud@50
   187
StephaneLenclud@51
   188
        /// USHORT->unsigned short
StephaneLenclud@51
   189
        public ushort DesignatorMax;
StephaneLenclud@50
   190
StephaneLenclud@51
   191
        /// USHORT->unsigned short
StephaneLenclud@51
   192
        public ushort DataIndexMin;
StephaneLenclud@50
   193
StephaneLenclud@51
   194
        /// USHORT->unsigned short
StephaneLenclud@51
   195
        public ushort DataIndexMax;
StephaneLenclud@51
   196
    }
StephaneLenclud@50
   197
StephaneLenclud@51
   198
    /// <summary>
StephaneLenclud@51
   199
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   200
    /// </summary>
StephaneLenclud@51
   201
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   202
    public struct HIDP_BUTTON_CAPS_NOT_RANGE
StephaneLenclud@51
   203
    {
StephaneLenclud@50
   204
StephaneLenclud@51
   205
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   206
        public ushort Usage;
StephaneLenclud@50
   207
StephaneLenclud@51
   208
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   209
        public ushort Reserved1;
StephaneLenclud@50
   210
StephaneLenclud@51
   211
        /// USHORT->unsigned short
StephaneLenclud@51
   212
        public ushort StringIndex;
StephaneLenclud@50
   213
StephaneLenclud@51
   214
        /// USHORT->unsigned short
StephaneLenclud@51
   215
        public ushort Reserved2;
StephaneLenclud@50
   216
StephaneLenclud@51
   217
        /// USHORT->unsigned short
StephaneLenclud@51
   218
        public ushort DesignatorIndex;
StephaneLenclud@50
   219
StephaneLenclud@51
   220
        /// USHORT->unsigned short
StephaneLenclud@51
   221
        public ushort Reserved3;
StephaneLenclud@50
   222
StephaneLenclud@51
   223
        /// USHORT->unsigned short
StephaneLenclud@51
   224
        public ushort DataIndex;
StephaneLenclud@50
   225
StephaneLenclud@51
   226
        /// USHORT->unsigned short
StephaneLenclud@51
   227
        public ushort Reserved4;
StephaneLenclud@51
   228
    }
StephaneLenclud@50
   229
StephaneLenclud@57
   230
    /// <summary>
StephaneLenclud@57
   231
    /// 
StephaneLenclud@57
   232
    /// </summary>
StephaneLenclud@57
   233
    [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)]
StephaneLenclud@51
   234
    public struct HIDP_BUTTON_CAPS
StephaneLenclud@51
   235
    {
StephaneLenclud@51
   236
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   237
        [FieldOffset(0)]
StephaneLenclud@51
   238
        public ushort UsagePage;
StephaneLenclud@50
   239
StephaneLenclud@51
   240
        /// UCHAR->unsigned char
StephaneLenclud@57
   241
        [FieldOffset(2)]
StephaneLenclud@51
   242
        public byte ReportID;
StephaneLenclud@50
   243
StephaneLenclud@51
   244
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   245
        [FieldOffset(3)]
StephaneLenclud@59
   246
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   247
        public bool IsAlias;
StephaneLenclud@50
   248
StephaneLenclud@51
   249
        /// USHORT->unsigned short
StephaneLenclud@57
   250
        [FieldOffset(4)]
StephaneLenclud@51
   251
        public ushort BitField;
StephaneLenclud@50
   252
StephaneLenclud@51
   253
        /// USHORT->unsigned short
StephaneLenclud@57
   254
        [FieldOffset(6)]
StephaneLenclud@51
   255
        public ushort LinkCollection;
StephaneLenclud@50
   256
StephaneLenclud@51
   257
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   258
        [FieldOffset(8)]
StephaneLenclud@51
   259
        public ushort LinkUsage;
StephaneLenclud@50
   260
StephaneLenclud@51
   261
        /// USAGE->USHORT->unsigned short
StephaneLenclud@57
   262
        [FieldOffset(10)]
StephaneLenclud@51
   263
        public ushort LinkUsagePage;
StephaneLenclud@50
   264
StephaneLenclud@51
   265
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   266
        [FieldOffset(12)]
StephaneLenclud@59
   267
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   268
        public bool IsRange;
StephaneLenclud@50
   269
StephaneLenclud@51
   270
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   271
        [FieldOffset(13)]
StephaneLenclud@59
   272
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   273
        public bool IsStringRange;
StephaneLenclud@50
   274
StephaneLenclud@51
   275
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   276
        [FieldOffset(14)]
StephaneLenclud@59
   277
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   278
        public bool IsDesignatorRange;
StephaneLenclud@50
   279
StephaneLenclud@51
   280
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@57
   281
        [FieldOffset(15)]
StephaneLenclud@59
   282
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@57
   283
        public bool IsAbsolute;
StephaneLenclud@50
   284
StephaneLenclud@51
   285
        /// ULONG[10]
StephaneLenclud@57
   286
        [FieldOffset(16)]
StephaneLenclud@57
   287
        [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.U4)]
StephaneLenclud@51
   288
        public uint[] Reserved;
StephaneLenclud@50
   289
StephaneLenclud@57
   290
        /// Union Range/NotRange
StephaneLenclud@57
   291
        [FieldOffset(56)]
StephaneLenclud@57
   292
        HIDP_BUTTON_CAPS_RANGE Range;
StephaneLenclud@57
   293
StephaneLenclud@57
   294
        [FieldOffset(56)]
StephaneLenclud@57
   295
        HIDP_BUTTON_CAPS_NOT_RANGE NotRange;       
StephaneLenclud@51
   296
    }
StephaneLenclud@50
   297
StephaneLenclud@51
   298
    /// <summary>
StephaneLenclud@51
   299
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   300
    /// </summary>
StephaneLenclud@51
   301
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   302
    public struct HIDP_VALUE_CAPS_RANGE
StephaneLenclud@51
   303
    {
StephaneLenclud@50
   304
StephaneLenclud@51
   305
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   306
        public ushort UsageMin;
StephaneLenclud@50
   307
StephaneLenclud@51
   308
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   309
        public ushort UsageMax;
StephaneLenclud@50
   310
StephaneLenclud@51
   311
        /// USHORT->unsigned short
StephaneLenclud@51
   312
        public ushort StringMin;
StephaneLenclud@50
   313
StephaneLenclud@51
   314
        /// USHORT->unsigned short
StephaneLenclud@51
   315
        public ushort StringMax;
StephaneLenclud@50
   316
StephaneLenclud@51
   317
        /// USHORT->unsigned short
StephaneLenclud@51
   318
        public ushort DesignatorMin;
StephaneLenclud@50
   319
StephaneLenclud@51
   320
        /// USHORT->unsigned short
StephaneLenclud@51
   321
        public ushort DesignatorMax;
StephaneLenclud@50
   322
StephaneLenclud@51
   323
        /// USHORT->unsigned short
StephaneLenclud@51
   324
        public ushort DataIndexMin;
StephaneLenclud@50
   325
StephaneLenclud@51
   326
        /// USHORT->unsigned short
StephaneLenclud@51
   327
        public ushort DataIndexMax;
StephaneLenclud@51
   328
    }
StephaneLenclud@50
   329
StephaneLenclud@51
   330
    /// <summary>
StephaneLenclud@51
   331
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   332
    /// </summary>
StephaneLenclud@51
   333
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   334
    public struct HIDP_VALUE_CAPS_NOT_RANGE
StephaneLenclud@51
   335
    {
StephaneLenclud@50
   336
StephaneLenclud@51
   337
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   338
        public ushort Usage;
StephaneLenclud@50
   339
StephaneLenclud@51
   340
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   341
        public ushort Reserved1;
StephaneLenclud@50
   342
StephaneLenclud@51
   343
        /// USHORT->unsigned short
StephaneLenclud@51
   344
        public ushort StringIndex;
StephaneLenclud@50
   345
StephaneLenclud@51
   346
        /// USHORT->unsigned short
StephaneLenclud@51
   347
        public ushort Reserved2;
StephaneLenclud@50
   348
StephaneLenclud@51
   349
        /// USHORT->unsigned short
StephaneLenclud@51
   350
        public ushort DesignatorIndex;
StephaneLenclud@50
   351
StephaneLenclud@51
   352
        /// USHORT->unsigned short
StephaneLenclud@51
   353
        public ushort Reserved3;
StephaneLenclud@50
   354
StephaneLenclud@51
   355
        /// USHORT->unsigned short
StephaneLenclud@51
   356
        public ushort DataIndex;
StephaneLenclud@50
   357
StephaneLenclud@51
   358
        /// USHORT->unsigned short
StephaneLenclud@51
   359
        public ushort Reserved4;
StephaneLenclud@51
   360
    }
StephaneLenclud@50
   361
StephaneLenclud@50
   362
StephaneLenclud@59
   363
    /// <summary>
StephaneLenclud@59
   364
    /// 
StephaneLenclud@59
   365
    /// </summary>
StephaneLenclud@59
   366
    [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)]
StephaneLenclud@51
   367
    public struct HIDP_VALUE_CAPS
StephaneLenclud@51
   368
    {
StephaneLenclud@50
   369
StephaneLenclud@51
   370
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   371
        [FieldOffset(0)]
StephaneLenclud@51
   372
        public ushort UsagePage;
StephaneLenclud@50
   373
StephaneLenclud@51
   374
        /// UCHAR->unsigned char
StephaneLenclud@59
   375
        [FieldOffset(2)]
StephaneLenclud@51
   376
        public byte ReportID;
StephaneLenclud@50
   377
StephaneLenclud@51
   378
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   379
        [FieldOffset(3)]
StephaneLenclud@59
   380
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   381
        public bool IsAlias;
StephaneLenclud@50
   382
StephaneLenclud@51
   383
        /// USHORT->unsigned short
StephaneLenclud@59
   384
        [FieldOffset(4)]
StephaneLenclud@51
   385
        public ushort BitField;
StephaneLenclud@50
   386
StephaneLenclud@51
   387
        /// USHORT->unsigned short
StephaneLenclud@59
   388
        [FieldOffset(6)]
StephaneLenclud@51
   389
        public ushort LinkCollection;
StephaneLenclud@50
   390
StephaneLenclud@51
   391
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   392
        [FieldOffset(8)]
StephaneLenclud@51
   393
        public ushort LinkUsage;
StephaneLenclud@50
   394
StephaneLenclud@51
   395
        /// USAGE->USHORT->unsigned short
StephaneLenclud@59
   396
        [FieldOffset(10)]
StephaneLenclud@51
   397
        public ushort LinkUsagePage;
StephaneLenclud@50
   398
StephaneLenclud@51
   399
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   400
        [FieldOffset(12)]
StephaneLenclud@59
   401
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   402
        public bool IsRange;
StephaneLenclud@50
   403
StephaneLenclud@51
   404
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   405
        [FieldOffset(13)]
StephaneLenclud@59
   406
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   407
        public bool IsStringRange;
StephaneLenclud@50
   408
StephaneLenclud@51
   409
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   410
        [FieldOffset(14)]
StephaneLenclud@59
   411
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   412
        public bool IsDesignatorRange;
StephaneLenclud@50
   413
StephaneLenclud@51
   414
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   415
        [FieldOffset(15)]
StephaneLenclud@59
   416
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   417
        public bool IsAbsolute;
StephaneLenclud@50
   418
StephaneLenclud@51
   419
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@59
   420
        [FieldOffset(16)]
StephaneLenclud@59
   421
        [MarshalAsAttribute(UnmanagedType.U1)]
StephaneLenclud@59
   422
        public bool HasNull;
StephaneLenclud@50
   423
StephaneLenclud@51
   424
        /// UCHAR->unsigned char
StephaneLenclud@59
   425
        [FieldOffset(17)]
StephaneLenclud@51
   426
        public byte Reserved;
StephaneLenclud@50
   427
StephaneLenclud@51
   428
        /// USHORT->unsigned short
StephaneLenclud@59
   429
        [FieldOffset(18)]
StephaneLenclud@51
   430
        public ushort BitSize;
StephaneLenclud@50
   431
StephaneLenclud@51
   432
        /// USHORT->unsigned short
StephaneLenclud@59
   433
        [FieldOffset(20)]
StephaneLenclud@51
   434
        public ushort ReportCount;
StephaneLenclud@50
   435
StephaneLenclud@51
   436
        /// USHORT[5]
StephaneLenclud@59
   437
        /// We had to use 5 ushorts instead of an array to avoid alignment exception issues.
StephaneLenclud@59
   438
        [FieldOffset(22)]
StephaneLenclud@59
   439
        public ushort Reserved21;
StephaneLenclud@59
   440
        [FieldOffset(24)]
StephaneLenclud@59
   441
        public ushort Reserved22;
StephaneLenclud@59
   442
        [FieldOffset(26)]
StephaneLenclud@59
   443
        public ushort Reserved23;
StephaneLenclud@59
   444
        [FieldOffset(28)]
StephaneLenclud@59
   445
        public ushort Reserved24;
StephaneLenclud@59
   446
        [FieldOffset(30)]
StephaneLenclud@59
   447
        public ushort Reserved25;
StephaneLenclud@50
   448
StephaneLenclud@51
   449
        /// ULONG->unsigned int
StephaneLenclud@59
   450
        [FieldOffset(32)]
StephaneLenclud@51
   451
        public uint UnitsExp;
StephaneLenclud@50
   452
StephaneLenclud@51
   453
        /// ULONG->unsigned int
StephaneLenclud@59
   454
        [FieldOffset(36)]
StephaneLenclud@51
   455
        public uint Units;
StephaneLenclud@50
   456
StephaneLenclud@51
   457
        /// LONG->int
StephaneLenclud@59
   458
        [FieldOffset(40)]
StephaneLenclud@51
   459
        public int LogicalMin;
StephaneLenclud@50
   460
StephaneLenclud@51
   461
        /// LONG->int
StephaneLenclud@59
   462
        [FieldOffset(44)]
StephaneLenclud@51
   463
        public int LogicalMax;
StephaneLenclud@50
   464
StephaneLenclud@51
   465
        /// LONG->int
StephaneLenclud@59
   466
        [FieldOffset(48)]
StephaneLenclud@51
   467
        public int PhysicalMin;
StephaneLenclud@50
   468
StephaneLenclud@51
   469
        /// LONG->int
StephaneLenclud@59
   470
        [FieldOffset(52)]
StephaneLenclud@51
   471
        public int PhysicalMax;
StephaneLenclud@50
   472
StephaneLenclud@59
   473
        /// Union Range/NotRange
StephaneLenclud@59
   474
        [FieldOffset(56)]
StephaneLenclud@59
   475
        public HIDP_VALUE_CAPS_RANGE Range;
StephaneLenclud@59
   476
StephaneLenclud@59
   477
        [FieldOffset(56)]
StephaneLenclud@59
   478
        public HIDP_VALUE_CAPS_NOT_RANGE NotRange;
StephaneLenclud@51
   479
    }
StephaneLenclud@59
   480
    
StephaneLenclud@51
   481
}
StephaneLenclud@50
   482
StephaneLenclud@51
   483