Win32Hid.cs
author StephaneLenclud
Sun, 15 Feb 2015 11:53:36 +0100
changeset 56 cace0afae0fa
parent 51 5f1f1053a595
child 57 878e0b271c11
permissions -rw-r--r--
HidDevice now supports capabilities and button capabilities.
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@56
    43
        public static extern HidStatus HidP_GetValueCaps(HIDP_REPORT_TYPE ReportType, ref 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@51
   230
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)]
StephaneLenclud@51
   231
    public struct HIDP_BUTTON_CAPS_UNION
StephaneLenclud@51
   232
    {
StephaneLenclud@50
   233
StephaneLenclud@51
   234
        /// 
StephaneLenclud@51
   235
        [System.Runtime.InteropServices.FieldOffsetAttribute(0)]
StephaneLenclud@51
   236
        public HIDP_BUTTON_CAPS_RANGE Range;
StephaneLenclud@50
   237
StephaneLenclud@51
   238
        /// 
StephaneLenclud@51
   239
        [System.Runtime.InteropServices.FieldOffsetAttribute(0)]
StephaneLenclud@51
   240
        public HIDP_BUTTON_CAPS_NOT_RANGE NotRange;
StephaneLenclud@51
   241
    }
StephaneLenclud@50
   242
StephaneLenclud@51
   243
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   244
    public struct HIDP_BUTTON_CAPS
StephaneLenclud@51
   245
    {
StephaneLenclud@50
   246
StephaneLenclud@51
   247
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   248
        public ushort UsagePage;
StephaneLenclud@50
   249
StephaneLenclud@51
   250
        /// UCHAR->unsigned char
StephaneLenclud@51
   251
        public byte ReportID;
StephaneLenclud@50
   252
StephaneLenclud@51
   253
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   254
        public byte IsAlias;
StephaneLenclud@50
   255
StephaneLenclud@51
   256
        /// USHORT->unsigned short
StephaneLenclud@51
   257
        public ushort BitField;
StephaneLenclud@50
   258
StephaneLenclud@51
   259
        /// USHORT->unsigned short
StephaneLenclud@51
   260
        public ushort LinkCollection;
StephaneLenclud@50
   261
StephaneLenclud@51
   262
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   263
        public ushort LinkUsage;
StephaneLenclud@50
   264
StephaneLenclud@51
   265
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   266
        public ushort LinkUsagePage;
StephaneLenclud@50
   267
StephaneLenclud@51
   268
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   269
        public byte IsRange;
StephaneLenclud@50
   270
StephaneLenclud@51
   271
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   272
        public byte IsStringRange;
StephaneLenclud@50
   273
StephaneLenclud@51
   274
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   275
        public byte IsDesignatorRange;
StephaneLenclud@50
   276
StephaneLenclud@51
   277
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   278
        public byte IsAbsolute;
StephaneLenclud@50
   279
StephaneLenclud@51
   280
        /// ULONG[10]
StephaneLenclud@51
   281
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U4)]
StephaneLenclud@51
   282
        public uint[] Reserved;
StephaneLenclud@50
   283
StephaneLenclud@51
   284
        /// TODO: get the proper field offset to make it nicer and get rid of union type
StephaneLenclud@51
   285
        public HIDP_BUTTON_CAPS_UNION Union;
StephaneLenclud@51
   286
    }
StephaneLenclud@50
   287
StephaneLenclud@51
   288
    /// <summary>
StephaneLenclud@51
   289
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   290
    /// </summary>
StephaneLenclud@51
   291
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   292
    public struct HIDP_VALUE_CAPS_RANGE
StephaneLenclud@51
   293
    {
StephaneLenclud@50
   294
StephaneLenclud@51
   295
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   296
        public ushort UsageMin;
StephaneLenclud@50
   297
StephaneLenclud@51
   298
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   299
        public ushort UsageMax;
StephaneLenclud@50
   300
StephaneLenclud@51
   301
        /// USHORT->unsigned short
StephaneLenclud@51
   302
        public ushort StringMin;
StephaneLenclud@50
   303
StephaneLenclud@51
   304
        /// USHORT->unsigned short
StephaneLenclud@51
   305
        public ushort StringMax;
StephaneLenclud@50
   306
StephaneLenclud@51
   307
        /// USHORT->unsigned short
StephaneLenclud@51
   308
        public ushort DesignatorMin;
StephaneLenclud@50
   309
StephaneLenclud@51
   310
        /// USHORT->unsigned short
StephaneLenclud@51
   311
        public ushort DesignatorMax;
StephaneLenclud@50
   312
StephaneLenclud@51
   313
        /// USHORT->unsigned short
StephaneLenclud@51
   314
        public ushort DataIndexMin;
StephaneLenclud@50
   315
StephaneLenclud@51
   316
        /// USHORT->unsigned short
StephaneLenclud@51
   317
        public ushort DataIndexMax;
StephaneLenclud@51
   318
    }
StephaneLenclud@50
   319
StephaneLenclud@51
   320
    /// <summary>
StephaneLenclud@51
   321
    /// Type created in place of an anonymous struct
StephaneLenclud@51
   322
    /// </summary>
StephaneLenclud@51
   323
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   324
    public struct HIDP_VALUE_CAPS_NOT_RANGE
StephaneLenclud@51
   325
    {
StephaneLenclud@50
   326
StephaneLenclud@51
   327
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   328
        public ushort Usage;
StephaneLenclud@50
   329
StephaneLenclud@51
   330
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   331
        public ushort Reserved1;
StephaneLenclud@50
   332
StephaneLenclud@51
   333
        /// USHORT->unsigned short
StephaneLenclud@51
   334
        public ushort StringIndex;
StephaneLenclud@50
   335
StephaneLenclud@51
   336
        /// USHORT->unsigned short
StephaneLenclud@51
   337
        public ushort Reserved2;
StephaneLenclud@50
   338
StephaneLenclud@51
   339
        /// USHORT->unsigned short
StephaneLenclud@51
   340
        public ushort DesignatorIndex;
StephaneLenclud@50
   341
StephaneLenclud@51
   342
        /// USHORT->unsigned short
StephaneLenclud@51
   343
        public ushort Reserved3;
StephaneLenclud@50
   344
StephaneLenclud@51
   345
        /// USHORT->unsigned short
StephaneLenclud@51
   346
        public ushort DataIndex;
StephaneLenclud@50
   347
StephaneLenclud@51
   348
        /// USHORT->unsigned short
StephaneLenclud@51
   349
        public ushort Reserved4;
StephaneLenclud@51
   350
    }
StephaneLenclud@50
   351
StephaneLenclud@51
   352
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)]
StephaneLenclud@51
   353
    public struct HIDP_VALUE_CAPS_UNION
StephaneLenclud@51
   354
    {
StephaneLenclud@50
   355
StephaneLenclud@51
   356
        /// 
StephaneLenclud@51
   357
        [System.Runtime.InteropServices.FieldOffsetAttribute(0)]
StephaneLenclud@51
   358
        public HIDP_VALUE_CAPS_RANGE Range;
StephaneLenclud@50
   359
StephaneLenclud@51
   360
        /// 
StephaneLenclud@51
   361
        [System.Runtime.InteropServices.FieldOffsetAttribute(0)]
StephaneLenclud@51
   362
        public HIDP_VALUE_CAPS_NOT_RANGE NotRange;
StephaneLenclud@51
   363
    }
StephaneLenclud@50
   364
StephaneLenclud@51
   365
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
StephaneLenclud@51
   366
    public struct HIDP_VALUE_CAPS
StephaneLenclud@51
   367
    {
StephaneLenclud@50
   368
StephaneLenclud@51
   369
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   370
        public ushort UsagePage;
StephaneLenclud@50
   371
StephaneLenclud@51
   372
        /// UCHAR->unsigned char
StephaneLenclud@51
   373
        public byte ReportID;
StephaneLenclud@50
   374
StephaneLenclud@51
   375
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   376
        public byte IsAlias;
StephaneLenclud@50
   377
StephaneLenclud@51
   378
        /// USHORT->unsigned short
StephaneLenclud@51
   379
        public ushort BitField;
StephaneLenclud@50
   380
StephaneLenclud@51
   381
        /// USHORT->unsigned short
StephaneLenclud@51
   382
        public ushort LinkCollection;
StephaneLenclud@50
   383
StephaneLenclud@51
   384
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   385
        public ushort LinkUsage;
StephaneLenclud@50
   386
StephaneLenclud@51
   387
        /// USAGE->USHORT->unsigned short
StephaneLenclud@51
   388
        public ushort LinkUsagePage;
StephaneLenclud@50
   389
StephaneLenclud@51
   390
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   391
        public byte IsRange;
StephaneLenclud@50
   392
StephaneLenclud@51
   393
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   394
        public byte IsStringRange;
StephaneLenclud@50
   395
StephaneLenclud@51
   396
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   397
        public byte IsDesignatorRange;
StephaneLenclud@50
   398
StephaneLenclud@51
   399
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   400
        public byte IsAbsolute;
StephaneLenclud@50
   401
StephaneLenclud@51
   402
        /// BOOLEAN->BYTE->unsigned char
StephaneLenclud@51
   403
        public byte HasNull;
StephaneLenclud@50
   404
StephaneLenclud@51
   405
        /// UCHAR->unsigned char
StephaneLenclud@51
   406
        public byte Reserved;
StephaneLenclud@50
   407
StephaneLenclud@51
   408
        /// USHORT->unsigned short
StephaneLenclud@51
   409
        public ushort BitSize;
StephaneLenclud@50
   410
StephaneLenclud@51
   411
        /// USHORT->unsigned short
StephaneLenclud@51
   412
        public ushort ReportCount;
StephaneLenclud@50
   413
StephaneLenclud@51
   414
        /// USHORT[5]
StephaneLenclud@51
   415
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)]
StephaneLenclud@51
   416
        public ushort[] Reserved2;
StephaneLenclud@50
   417
StephaneLenclud@51
   418
        /// ULONG->unsigned int
StephaneLenclud@51
   419
        public uint UnitsExp;
StephaneLenclud@50
   420
StephaneLenclud@51
   421
        /// ULONG->unsigned int
StephaneLenclud@51
   422
        public uint Units;
StephaneLenclud@50
   423
StephaneLenclud@51
   424
        /// LONG->int
StephaneLenclud@51
   425
        public int LogicalMin;
StephaneLenclud@50
   426
StephaneLenclud@51
   427
        /// LONG->int
StephaneLenclud@51
   428
        public int LogicalMax;
StephaneLenclud@50
   429
StephaneLenclud@51
   430
        /// LONG->int
StephaneLenclud@51
   431
        public int PhysicalMin;
StephaneLenclud@50
   432
StephaneLenclud@51
   433
        /// LONG->int
StephaneLenclud@51
   434
        public int PhysicalMax;
StephaneLenclud@50
   435
StephaneLenclud@51
   436
        /// 
StephaneLenclud@51
   437
        public HIDP_VALUE_CAPS_UNION Union;
StephaneLenclud@51
   438
    }
StephaneLenclud@51
   439
}
StephaneLenclud@50
   440
StephaneLenclud@51
   441