pinvoke-interop-assistant-input.c
changeset 50 e6c103ebb155
child 68 bbe61b1021bb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pinvoke-interop-assistant-input.c	Sat Feb 14 22:11:36 2015 +0100
     1.3 @@ -0,0 +1,141 @@
     1.4 +
     1.5 +typedef USHORT USAGE, *PUSAGE;
     1.6 +typedef LONG NTSTATUS;
     1.7 +
     1.8 +typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
     1.9 +
    1.10 +typedef enum _HIDP_REPORT_TYPE
    1.11 +{
    1.12 +    HidP_Input,
    1.13 +    HidP_Output,
    1.14 +    HidP_Feature
    1.15 +} HIDP_REPORT_TYPE;
    1.16 +
    1.17 +typedef struct _HIDP_CAPS
    1.18 +{
    1.19 +    USAGE    Usage;
    1.20 +    USAGE    UsagePage;
    1.21 +    USHORT   InputReportByteLength;
    1.22 +    USHORT   OutputReportByteLength;
    1.23 +    USHORT   FeatureReportByteLength;
    1.24 +    USHORT   Reserved[17];
    1.25 +
    1.26 +    USHORT   NumberLinkCollectionNodes;
    1.27 +
    1.28 +    USHORT   NumberInputButtonCaps;
    1.29 +    USHORT   NumberInputValueCaps;
    1.30 +    USHORT   NumberInputDataIndices;
    1.31 +
    1.32 +    USHORT   NumberOutputButtonCaps;
    1.33 +    USHORT   NumberOutputValueCaps;
    1.34 +    USHORT   NumberOutputDataIndices;
    1.35 +
    1.36 +    USHORT   NumberFeatureButtonCaps;
    1.37 +    USHORT   NumberFeatureValueCaps;
    1.38 +    USHORT   NumberFeatureDataIndices;
    1.39 +} HIDP_CAPS, *PHIDP_CAPS;
    1.40 +
    1.41 +
    1.42 +typedef struct _HIDP_BUTTON_CAPS
    1.43 +{
    1.44 +    USAGE    UsagePage;
    1.45 +    UCHAR    ReportID;
    1.46 +    BOOLEAN  IsAlias;
    1.47 +
    1.48 +    USHORT   BitField;
    1.49 +    USHORT   LinkCollection;   // A unique internal index pointer
    1.50 +
    1.51 +    USAGE    LinkUsage;
    1.52 +    USAGE    LinkUsagePage;
    1.53 +
    1.54 +    BOOLEAN  IsRange;
    1.55 +    BOOLEAN  IsStringRange;
    1.56 +    BOOLEAN  IsDesignatorRange;
    1.57 +    BOOLEAN  IsAbsolute;
    1.58 +
    1.59 +    ULONG    Reserved[10];
    1.60 +    union {
    1.61 +        struct {
    1.62 +            USAGE    UsageMin,         UsageMax;
    1.63 +            USHORT   StringMin,        StringMax;
    1.64 +            USHORT   DesignatorMin,    DesignatorMax;
    1.65 +            USHORT   DataIndexMin,     DataIndexMax;
    1.66 +        } Range;
    1.67 +        struct  {
    1.68 +            USAGE    Usage,            Reserved1;
    1.69 +            USHORT   StringIndex,      Reserved2;
    1.70 +            USHORT   DesignatorIndex,  Reserved3;
    1.71 +            USHORT   DataIndex,        Reserved4;
    1.72 +        } NotRange;
    1.73 +    };
    1.74 +
    1.75 +} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
    1.76 +
    1.77 +typedef struct _HIDP_VALUE_CAPS
    1.78 +{
    1.79 +    USAGE    UsagePage;
    1.80 +    UCHAR    ReportID;
    1.81 +    BOOLEAN  IsAlias;
    1.82 +
    1.83 +    USHORT   BitField;
    1.84 +    USHORT   LinkCollection;   // A unique internal index pointer
    1.85 +
    1.86 +    USAGE    LinkUsage;
    1.87 +    USAGE    LinkUsagePage;
    1.88 +
    1.89 +    BOOLEAN  IsRange;
    1.90 +    BOOLEAN  IsStringRange;
    1.91 +    BOOLEAN  IsDesignatorRange;
    1.92 +    BOOLEAN  IsAbsolute;
    1.93 +
    1.94 +    BOOLEAN  HasNull;        // Does this channel have a null report   union
    1.95 +    UCHAR    Reserved;
    1.96 +    USHORT   BitSize;        // How many bits are devoted to this value?
    1.97 +
    1.98 +    USHORT   ReportCount;    // See Note below.  Usually set to 1.
    1.99 +    USHORT   Reserved2[5];
   1.100 +
   1.101 +    ULONG    UnitsExp;
   1.102 +    ULONG    Units;
   1.103 +
   1.104 +    LONG     LogicalMin,       LogicalMax;
   1.105 +    LONG     PhysicalMin,      PhysicalMax;
   1.106 +
   1.107 +    union {
   1.108 +        struct {
   1.109 +            USAGE    UsageMin,         UsageMax;
   1.110 +            USHORT   StringMin,        StringMax;
   1.111 +            USHORT   DesignatorMin,    DesignatorMax;
   1.112 +            USHORT   DataIndexMin,     DataIndexMax;
   1.113 +        } Range;
   1.114 +
   1.115 +        struct {
   1.116 +            USAGE    Usage,            Reserved1;
   1.117 +            USHORT   StringIndex,      Reserved2;
   1.118 +            USHORT   DesignatorIndex,  Reserved3;
   1.119 +            USHORT   DataIndex,        Reserved4;
   1.120 +        } NotRange;
   1.121 +    };
   1.122 +} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
   1.123 +
   1.124 +NTSTATUS __stdcall
   1.125 +HidP_GetCaps (
   1.126 +         PHIDP_PREPARSED_DATA      PreparsedData,
   1.127 +        PHIDP_CAPS                Capabilities
   1.128 +   );
   1.129 +
   1.130 +   NTSTATUS __stdcall
   1.131 +HidP_GetButtonCaps (
   1.132 +          HIDP_REPORT_TYPE     ReportType,
   1.133 +   PHIDP_BUTTON_CAPS ButtonCaps,
   1.134 +       PUSHORT              ButtonCapsLength,
   1.135 +          PHIDP_PREPARSED_DATA PreparsedData
   1.136 +);
   1.137 +
   1.138 +NTSTATUS __stdcall
   1.139 +HidP_GetValueCaps (
   1.140 +          HIDP_REPORT_TYPE     ReportType,
   1.141 +   PHIDP_VALUE_CAPS ValueCaps,
   1.142 +       PUSHORT              ValueCapsLength,
   1.143 +          PHIDP_PREPARSED_DATA PreparsedData
   1.144 +);