Home | History | Annotate | Download | only in include
      1 /*
      2  * hidpi.h
      3  *
      4  * Public Interface for HID parsing library.
      5  *
      6  * This file is part of the w32api package.
      7  *
      8  * Contributors:
      9  *   Created by Casper S. Hornstrup <chorns (at) users.sourceforge.net>
     10  *
     11  * THIS SOFTWARE IS NOT COPYRIGHTED
     12  *
     13  * This source code is offered for use in the public domain. You may
     14  * use, modify or distribute it freely.
     15  *
     16  * This code is distributed in the hope that it will be useful but
     17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
     18  * DISCLAIMED. This includes but is not limited to warranties of
     19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     20  *
     21  */
     22 
     23 #ifndef __HIDPI_H
     24 #define __HIDPI_H
     25 
     26 #include "hidusage.h"
     27 
     28 #ifdef __cplusplus
     29 extern "C" {
     30 #endif
     31 
     32 #if defined(_HIDPI_)
     33 # define HIDAPI
     34 #else
     35 # define HIDAPI DECLSPEC_IMPORT
     36 #endif
     37 
     38 #if !defined (_NTDEF_) && !defined (_NTSTATUS_PSDK)
     39 #define _NTSTATUS_PSDK
     40   typedef LONG NTSTATUS,*PNTSTATUS;
     41 #endif
     42 
     43 typedef PUCHAR PHIDP_REPORT_DESCRIPTOR;
     44 typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
     45 
     46 typedef struct _HIDP_UNKNOWN_TOKEN {
     47   UCHAR  Token;
     48   UCHAR  Reserved[3];
     49   ULONG  BitField;
     50 } HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN;
     51 
     52 typedef enum _HIDP_KEYBOARD_DIRECTION {
     53   HidP_Keyboard_Break,
     54   HidP_Keyboard_Make
     55 } HIDP_KEYBOARD_DIRECTION;
     56 
     57 typedef struct _HIDP_KEYBOARD_MODIFIER_STATE {
     58   _ANONYMOUS_UNION union {
     59     _ANONYMOUS_STRUCT struct {
     60       ULONG  LeftControl : 1;
     61       ULONG  LeftShift : 1;
     62       ULONG  LeftAlt : 1;
     63       ULONG  LeftGUI : 1;
     64       ULONG  RightControl : 1;
     65       ULONG  RightShift : 1;
     66       ULONG  RightAlt : 1;
     67       ULONG  RigthGUI : 1;
     68       ULONG  CapsLock : 1;
     69       ULONG  ScollLock : 1;
     70       ULONG  NumLock : 1;
     71       ULONG  Reserved : 21;
     72     } DUMMYSTRUCTNAME;
     73     ULONG ul;
     74   } DUMMYUNIONNAME;
     75 } HIDP_KEYBOARD_MODIFIER_STATE, *PHIDP_KEYBOARD_MODIFIER_STATE;
     76 
     77 typedef BOOLEAN (NTAPI *PHIDP_INSERT_SCANCODES)(
     78   PVOID  Context,
     79   PCHAR  NewScanCodes,
     80   ULONG  Length);
     81 
     82 typedef struct _USAGE_AND_PAGE {
     83   USAGE  Usage;
     84   USAGE  UsagePage;
     85 } USAGE_AND_PAGE, *PUSAGE_AND_PAGE;
     86 
     87 typedef struct _HIDD_ATTRIBUTES {
     88   ULONG   Size;
     89   USHORT  VendorID;
     90   USHORT  ProductID;
     91   USHORT  VersionNumber;
     92 } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
     93 
     94 typedef struct _HIDD_CONFIGURATION {
     95   PVOID  cookie;
     96   ULONG  size;
     97   ULONG  RingBufferSize;
     98 } HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
     99 
    100 HIDAPI
    101 NTSTATUS
    102 NTAPI
    103 HidP_TranslateUsageAndPagesToI8042ScanCodes(
    104   PUSAGE_AND_PAGE  ChangedUsageList,
    105   ULONG  UsageListLength,
    106   HIDP_KEYBOARD_DIRECTION  KeyAction,
    107   PHIDP_KEYBOARD_MODIFIER_STATE  ModifierState,
    108   PHIDP_INSERT_SCANCODES  InsertCodesProcedure,
    109   PVOID  InsertCodesContext);
    110 
    111 HIDAPI
    112 NTSTATUS
    113 NTAPI
    114 HidP_TranslateUsagesToI8042ScanCodes(
    115   PUSAGE  ChangedUsageList,
    116   ULONG  UsageListLength,
    117   HIDP_KEYBOARD_DIRECTION  KeyAction,
    118   PHIDP_KEYBOARD_MODIFIER_STATE  ModifierState,
    119   PHIDP_INSERT_SCANCODES  InsertCodesProcedure,
    120   PVOID  InsertCodesContext);
    121 
    122 typedef struct _HIDP_BUTTON_CAPS {
    123   USAGE  UsagePage;
    124   UCHAR  ReportID;
    125   BOOLEAN  IsAlias;
    126   USHORT  BitField;
    127   USHORT  LinkCollection;
    128   USAGE  LinkUsage;
    129   USAGE  LinkUsagePage;
    130   BOOLEAN  IsRange;
    131   BOOLEAN  IsStringRange;
    132   BOOLEAN  IsDesignatorRange;
    133   BOOLEAN  IsAbsolute;
    134   ULONG  Reserved[10];
    135   _ANONYMOUS_UNION union {
    136     struct {
    137       USAGE  UsageMin, UsageMax;
    138       USHORT  StringMin, StringMax;
    139       USHORT  DesignatorMin, DesignatorMax;
    140       USHORT  DataIndexMin, DataIndexMax;
    141     } Range;
    142     struct  {
    143        USAGE  Usage, Reserved1;
    144        USHORT  StringIndex, Reserved2;
    145        USHORT  DesignatorIndex, Reserved3;
    146        USHORT  DataIndex, Reserved4;
    147     } NotRange;
    148   } DUMMYUNIONNAME;
    149 } HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
    150 
    151 typedef struct _HIDP_CAPS {
    152   USAGE  Usage;
    153   USAGE  UsagePage;
    154   USHORT  InputReportByteLength;
    155   USHORT  OutputReportByteLength;
    156   USHORT  FeatureReportByteLength;
    157   USHORT  Reserved[17];
    158   USHORT  NumberLinkCollectionNodes;
    159   USHORT  NumberInputButtonCaps;
    160   USHORT  NumberInputValueCaps;
    161   USHORT  NumberInputDataIndices;
    162   USHORT  NumberOutputButtonCaps;
    163   USHORT  NumberOutputValueCaps;
    164   USHORT  NumberOutputDataIndices;
    165   USHORT  NumberFeatureButtonCaps;
    166   USHORT  NumberFeatureValueCaps;
    167   USHORT  NumberFeatureDataIndices;
    168 } HIDP_CAPS, *PHIDP_CAPS;
    169 
    170 typedef struct _HIDP_DATA {
    171   USHORT  DataIndex;
    172   USHORT  Reserved;
    173   _ANONYMOUS_UNION union {
    174     ULONG  RawValue;
    175     BOOLEAN  On;
    176   }  DUMMYUNIONNAME;
    177 } HIDP_DATA, *PHIDP_DATA;
    178 
    179 typedef struct _HIDP_EXTENDED_ATTRIBUTES {
    180   UCHAR  NumGlobalUnknowns;
    181   UCHAR  Reserved[3];
    182   PHIDP_UNKNOWN_TOKEN  GlobalUnknowns;
    183   ULONG  Data[1];
    184 } HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES;
    185 
    186 #define HIDP_LINK_COLLECTION_ROOT         ((USHORT) -1)
    187 #define HIDP_LINK_COLLECTION_UNSPECIFIED  ((USHORT) 0)
    188 
    189 typedef struct _HIDP_LINK_COLLECTION_NODE {
    190   USAGE  LinkUsage;
    191   USAGE  LinkUsagePage;
    192   USHORT  Parent;
    193   USHORT  NumberOfChildren;
    194   USHORT  NextSibling;
    195   USHORT  FirstChild;
    196   ULONG  CollectionType: 8;
    197   ULONG  IsAlias: 1;
    198   ULONG  Reserved: 23;
    199   PVOID  UserContext;
    200 } HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE;
    201 
    202 typedef struct _HIDP_VALUE_CAPS {
    203   USAGE  UsagePage;
    204   UCHAR  ReportID;
    205   BOOLEAN  IsAlias;
    206   USHORT  BitField;
    207   USHORT  LinkCollection;
    208   USAGE  LinkUsage;
    209   USAGE  LinkUsagePage;
    210   BOOLEAN  IsRange;
    211   BOOLEAN  IsStringRange;
    212   BOOLEAN  IsDesignatorRange;
    213   BOOLEAN  IsAbsolute;
    214   BOOLEAN  HasNull;
    215   UCHAR  Reserved;
    216   USHORT  BitSize;
    217   USHORT  ReportCount;
    218   USHORT  Reserved2[5];
    219   ULONG  UnitsExp;
    220   ULONG  Units;
    221   LONG  LogicalMin, LogicalMax;
    222   LONG  PhysicalMin, PhysicalMax;
    223     _ANONYMOUS_UNION union {
    224       struct {
    225         USAGE  UsageMin, UsageMax;
    226         USHORT  StringMin, StringMax;
    227         USHORT  DesignatorMin, DesignatorMax;
    228         USHORT  DataIndexMin, DataIndexMax;
    229       } Range;
    230       struct {
    231         USAGE  Usage, Reserved1;
    232         USHORT  StringIndex, Reserved2;
    233         USHORT  DesignatorIndex, Reserved3;
    234         USHORT  DataIndex, Reserved4;
    235       } NotRange;
    236     } DUMMYUNIONNAME;
    237 } HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
    238 
    239 typedef enum _HIDP_REPORT_TYPE {
    240   HidP_Input,
    241   HidP_Output,
    242   HidP_Feature
    243 } HIDP_REPORT_TYPE;
    244 
    245 #define FACILITY_HID_ERROR_CODE           0x11
    246 
    247 #define HIDP_ERROR_CODES(SEV, CODE) \
    248   ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE)))
    249 
    250 #define HIDP_STATUS_SUCCESS                 (HIDP_ERROR_CODES(0x0, 0))
    251 #define HIDP_STATUS_NULL                    (HIDP_ERROR_CODES(0x8, 1))
    252 #define HIDP_STATUS_INVALID_PREPARSED_DATA  (HIDP_ERROR_CODES(0xC, 1))
    253 #define HIDP_STATUS_INVALID_REPORT_TYPE     (HIDP_ERROR_CODES(0xC, 2))
    254 #define HIDP_STATUS_INVALID_REPORT_LENGTH   (HIDP_ERROR_CODES(0xC, 3))
    255 #define HIDP_STATUS_USAGE_NOT_FOUND         (HIDP_ERROR_CODES(0xC, 4))
    256 #define HIDP_STATUS_VALUE_OUT_OF_RANGE      (HIDP_ERROR_CODES(0xC, 5))
    257 #define HIDP_STATUS_BAD_LOG_PHY_VALUES      (HIDP_ERROR_CODES(0xC, 6))
    258 #define HIDP_STATUS_BUFFER_TOO_SMALL        (HIDP_ERROR_CODES(0xC, 7))
    259 #define HIDP_STATUS_INTERNAL_ERROR          (HIDP_ERROR_CODES(0xC, 8))
    260 #define HIDP_STATUS_I8042_TRANS_UNKNOWN     (HIDP_ERROR_CODES(0xC, 9))
    261 #define HIDP_STATUS_INCOMPATIBLE_REPORT_ID  (HIDP_ERROR_CODES(0xC, 0xA))
    262 #define HIDP_STATUS_NOT_VALUE_ARRAY         (HIDP_ERROR_CODES(0xC, 0xB))
    263 #define HIDP_STATUS_IS_VALUE_ARRAY          (HIDP_ERROR_CODES(0xC, 0xC))
    264 #define HIDP_STATUS_DATA_INDEX_NOT_FOUND    (HIDP_ERROR_CODES(0xC, 0xD))
    265 #define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xC, 0xE))
    266 #define HIDP_STATUS_BUTTON_NOT_PRESSED      (HIDP_ERROR_CODES(0xC, 0xF))
    267 #define HIDP_STATUS_REPORT_DOES_NOT_EXIST   (HIDP_ERROR_CODES(0xC, 0x10))
    268 #define HIDP_STATUS_NOT_IMPLEMENTED         (HIDP_ERROR_CODES(0xC, 0x20))
    269 #define HIDP_STATUS_I8242_TRANS_UNKNOWN     HIDP_STATUS_I8042_TRANS_UNKNOWN
    270 
    271 
    272 #if !defined(_HIDPI_NO_FUNCTION_MACROS_)
    273 /*
    274  * NTSTATUS
    275  * HidP_GetButtonCaps(
    276  *   IN HIDP_REPORT_TYPE  ReportType,
    277  *   OUT PHIDP_BUTTON_CAPS  ButtonCaps,
    278  *   IN OUT PULONG  ButtonCapsLength,
    279  *   IN PHIDP_PREPARSED_DATA  PreparsedData);
    280  */
    281 #define HidP_GetButtonCaps(_Type_, _Caps_, _Len_, _Data_) \
    282   HidP_GetSpecificButtonCaps(_Type_, 0, 0, 0, _Caps_, _Len_, _Data_)
    283 
    284 /*
    285  * NTSTATUS
    286  * HidP_GetButtons(
    287  *   IN HIDP_REPORT_TYPE  ReportType,
    288  *   IN USAGE  UsagePage,
    289  *   IN USHORT  LinkCollection,
    290  *   OUT USAGE  *UsageList,
    291  *   IN OUT ULONG  *UsageLength,
    292  *   IN PHIDP_PREPARSED_DATA  PreparsedData,
    293  *   IN PCHAR  Report,
    294  *   IN ULONG  ReportLength);
    295  */
    296 #define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \
    297   HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe)
    298 
    299 #define HidP_GetButtonListLength(RTy, UPa, Ppd) \
    300   HidP_GetUsageListLength(Rty, UPa, Ppd)
    301 
    302 
    303 /*
    304  * NTSTATUS
    305  * HidP_GetButtonsEx(
    306  *   IN HIDP_REPORT_TYPE  ReportType,
    307  *   IN USHORT  LinkCollection,
    308  *   OUT PUSAGE_AND_PAGE  ButtonList,
    309  *   IN OUT ULONG  *UsageLength,
    310  *   IN PHIDP_PREPARSED_DATA  PreparsedData,
    311  *   IN PCHAR  Report,
    312  *   IN ULONG  ReportLength);
    313  */
    314 #define HidP_GetButtonsEx(RT, LC, BL, UL, PD, R, RL)  \
    315   HidP_GetUsagesEx(RT, LC, BL, UL, PD, R, RL)
    316 
    317 #endif /* _HIDPI_NO_FUNCTION_MACROS_ */
    318 
    319 HIDAPI
    320 NTSTATUS
    321 NTAPI
    322 HidP_GetCaps(
    323   PHIDP_PREPARSED_DATA  PreparsedData,
    324   PHIDP_CAPS  Capabilities);
    325 
    326 HIDAPI
    327 NTSTATUS
    328 NTAPI
    329 HidP_GetData(
    330   HIDP_REPORT_TYPE  ReportType,
    331   PHIDP_DATA  DataList,
    332   PULONG  DataLength,
    333   PHIDP_PREPARSED_DATA  PreparsedData,
    334   PCHAR  Report,
    335   ULONG  ReportLength);
    336 
    337 HIDAPI
    338 NTSTATUS
    339 NTAPI
    340 HidP_GetExtendedAttributes(
    341   HIDP_REPORT_TYPE  ReportType,
    342   USHORT  DataIndex,
    343   PHIDP_PREPARSED_DATA  PreparsedData,
    344   PHIDP_EXTENDED_ATTRIBUTES  Attributes,
    345   PULONG  LengthAttributes);
    346 
    347 HIDAPI
    348 NTSTATUS
    349 NTAPI
    350 HidP_GetLinkCollectionNodes(
    351   PHIDP_LINK_COLLECTION_NODE  LinkCollectionNodes,
    352   PULONG  LinkCollectionNodesLength,
    353   PHIDP_PREPARSED_DATA  PreparsedData);
    354 
    355 HIDAPI
    356 NTSTATUS
    357 NTAPI
    358 HidP_GetScaledUsageValue(
    359   HIDP_REPORT_TYPE  ReportType,
    360   USAGE  UsagePage,
    361   USHORT  LinkCollection,
    362   USAGE  Usage,
    363   PLONG  UsageValue,
    364   PHIDP_PREPARSED_DATA  PreparsedData,
    365   PCHAR  Report,
    366   ULONG  ReportLength);
    367 
    368 HIDAPI
    369 NTSTATUS
    370 NTAPI
    371 HidP_GetSpecificButtonCaps(
    372   HIDP_REPORT_TYPE  ReportType,
    373   USAGE  UsagePage,
    374   USHORT  LinkCollection,
    375   USAGE  Usage,
    376   PHIDP_BUTTON_CAPS  ButtonCaps,
    377   PULONG  ButtonCapsLength,
    378   PHIDP_PREPARSED_DATA  PreparsedData);
    379 
    380 HIDAPI
    381 NTSTATUS
    382 NTAPI
    383 HidP_GetSpecificValueCaps(
    384   HIDP_REPORT_TYPE  ReportType,
    385   USAGE  UsagePage,
    386   USHORT  LinkCollection,
    387   USAGE  Usage,
    388   PHIDP_VALUE_CAPS  ValueCaps,
    389   PULONG  ValueCapsLength,
    390   PHIDP_PREPARSED_DATA  PreparsedData);
    391 
    392 HIDAPI
    393 NTSTATUS
    394 NTAPI
    395 HidP_GetUsages(
    396   HIDP_REPORT_TYPE  ReportType,
    397   USAGE  UsagePage,
    398   USHORT  LinkCollection,
    399   USAGE  *UsageList,
    400   ULONG  *UsageLength,
    401   PHIDP_PREPARSED_DATA  PreparsedData,
    402   PCHAR  Report,
    403   ULONG  ReportLength);
    404 
    405 HIDAPI
    406 NTSTATUS
    407 NTAPI
    408 HidP_GetUsagesEx(
    409   HIDP_REPORT_TYPE  ReportType,
    410   USHORT  LinkCollection,
    411   PUSAGE_AND_PAGE  ButtonList,
    412   ULONG  *UsageLength,
    413   PHIDP_PREPARSED_DATA  PreparsedData,
    414   PCHAR  Report,
    415   ULONG  ReportLength);
    416 
    417 HIDAPI
    418 NTSTATUS
    419 NTAPI
    420 HidP_GetUsageValue(
    421   HIDP_REPORT_TYPE  ReportType,
    422   USAGE  UsagePage,
    423   USHORT  LinkCollection,
    424   USAGE  Usage,
    425   PULONG  UsageValue,
    426   PHIDP_PREPARSED_DATA  PreparsedData,
    427   PCHAR  Report,
    428   ULONG  ReportLength);
    429 
    430 HIDAPI
    431 NTSTATUS
    432 NTAPI
    433 HidP_GetUsageValueArray(
    434   HIDP_REPORT_TYPE  ReportType,
    435   USAGE  UsagePage,
    436   USHORT  LinkCollection,
    437   USAGE  Usage,
    438   PCHAR  UsageValue,
    439   USHORT  UsageValueByteLength,
    440   PHIDP_PREPARSED_DATA  PreparsedData,
    441   PCHAR  Report,
    442   ULONG  ReportLength);
    443 
    444 #if !defined(_HIDPI_NO_FUNCTION_MACROS_)
    445 
    446 /*
    447  * NTSTATUS
    448  * HidP_GetValueCaps(
    449  *   IN HIDP_REPORT_TYPE  ReportType,
    450  *   OUT PHIDP_VALUE_CAPS  ValueCaps,
    451  *   IN OUT PULONG  ValueCapsLength,
    452  *   IN PHIDP_PREPARSED_DATA  PreparsedData);
    453  */
    454 #define HidP_GetValueCaps(_Type_, _Caps_, _Len_, _Data_) \
    455   HidP_GetSpecificValueCaps (_Type_, 0, 0, 0, _Caps_, _Len_, _Data_)
    456 
    457 #endif /* _HIDPI_NO_FUNCTION_MACROS_ */
    458 
    459 HIDAPI
    460 NTSTATUS
    461 NTAPI
    462 HidP_InitializeReportForID(
    463   HIDP_REPORT_TYPE  ReportType,
    464   UCHAR  ReportID,
    465   PHIDP_PREPARSED_DATA  PreparsedData,
    466   PCHAR  Report,
    467   ULONG  ReportLength);
    468 
    469 #if !defined(_HIDPI_NO_FUNCTION_MACROS_)
    470 
    471 /*
    472  * BOOLEAN
    473  * HidP_IsSameUsageAndPage(
    474  *   USAGE_AND_PAGE  u1,
    475  *   USAGE_AND_PAGE  u2);
    476  */
    477 #define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2))
    478 
    479 #endif /* _HIDPI_NO_FUNCTION_MACROS_ */
    480 
    481 HIDAPI
    482 ULONG
    483 NTAPI
    484 HidP_MaxDataListLength(
    485   HIDP_REPORT_TYPE  ReportType,
    486   PHIDP_PREPARSED_DATA  PreparsedData);
    487 
    488 HIDAPI
    489 ULONG
    490 NTAPI
    491 HidP_MaxUsageListLength(
    492   HIDP_REPORT_TYPE  ReportType,
    493   USAGE  UsagePage,
    494   PHIDP_PREPARSED_DATA  PreparsedData);
    495 
    496 #if !defined(_HIDPI_NO_FUNCTION_MACROS_)
    497 
    498 /*
    499  * NTSTATUS
    500  * HidP_SetButtons(
    501  *   IN HIDP_REPORT_TYPE  ReportType,
    502  *   IN USAGE  UsagePage,
    503  *   IN USHORT  LinkCollection,
    504  *   IN PUSAGE  UsageList,
    505  *   IN OUT PULONG  UsageLength,
    506  *   IN PHIDP_PREPARSED_DATA  PreparsedData,
    507  *   IN OUT PCHAR  Report,
    508  *   IN ULONG  ReportLength);
    509  */
    510 #define HidP_SetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \
    511   HidP_SetUsages(RT, UP, LC, UL1, UL2, PD, R, RL)
    512 
    513 #endif /* _HIDPI_NO_FUNCTION_MACROS_ */
    514 
    515 HIDAPI
    516 NTSTATUS
    517 NTAPI
    518 HidP_SetData(
    519   HIDP_REPORT_TYPE  ReportType,
    520   PHIDP_DATA  DataList,
    521   PULONG  DataLength,
    522   PHIDP_PREPARSED_DATA  PreparsedData,
    523   PCHAR  Report,
    524   ULONG  ReportLength);
    525 
    526 HIDAPI
    527 NTSTATUS
    528 NTAPI
    529 HidP_SetScaledUsageValue(
    530   HIDP_REPORT_TYPE  ReportType,
    531   USAGE  UsagePage,
    532   USHORT  LinkCollection,
    533   USAGE  Usage,
    534   LONG  UsageValue,
    535   PHIDP_PREPARSED_DATA  PreparsedData,
    536   PCHAR  Report,
    537   ULONG  ReportLength);
    538 
    539 HIDAPI
    540 NTSTATUS
    541 NTAPI
    542 HidP_SetUsages(
    543   HIDP_REPORT_TYPE  ReportType,
    544   USAGE  UsagePage,
    545   USHORT  LinkCollection, /* Optional */
    546   PUSAGE  UsageList,
    547   PULONG  UsageLength,
    548   PHIDP_PREPARSED_DATA  PreparsedData,
    549   PCHAR  Report,
    550   ULONG  ReportLength);
    551 
    552 HIDAPI
    553 NTSTATUS
    554 NTAPI
    555 HidP_SetUsageValue(
    556   HIDP_REPORT_TYPE  ReportType,
    557   USAGE  UsagePage,
    558   USHORT  LinkCollection,
    559   USAGE  Usage,
    560   ULONG  UsageValue,
    561   PHIDP_PREPARSED_DATA  PreparsedData,
    562   PCHAR  Report,
    563   ULONG  ReportLength);
    564 
    565 HIDAPI
    566 NTSTATUS
    567 NTAPI
    568 HidP_SetUsageValueArray(
    569   HIDP_REPORT_TYPE  ReportType,
    570   USAGE  UsagePage,
    571   USHORT  LinkCollection,
    572   USAGE  Usage,
    573   PCHAR  UsageValue,
    574   USHORT  UsageValueByteLength,
    575   PHIDP_PREPARSED_DATA  PreparsedData,
    576   PCHAR  Report,
    577   ULONG  ReportLength);
    578 
    579 #if !defined(_HIDPI_NO_FUNCTION_MACROS_)
    580 
    581 /*
    582  * NTSTATUS
    583  * HidP_UnsetButtons(
    584  *   IN HIDP_REPORT_TYPE  ReportType,
    585  *   IN USAGE  UsagePage,
    586  *   IN USHORT  LinkCollection,
    587  *   IN PUSAGE  UsageList,
    588  *   IN OUT PULONG  UsageLength,
    589  *   IN PHIDP_PREPARSED_DATA  PreparsedData,
    590  *   IN OUT PCHAR  Report,
    591  *   IN ULONG  ReportLength);
    592  */
    593 #define HidP_UnsetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \
    594   HidP_UnsetUsages(RT, UP, LC, UL1, UL2, PD, R, RL)
    595 
    596 #endif /* _HIDPI_NO_FUNCTION_MACROS_ */
    597 
    598 HIDAPI
    599 NTSTATUS
    600 NTAPI
    601 HidP_UnsetUsages(
    602   HIDP_REPORT_TYPE  ReportType,
    603   USAGE  UsagePage,
    604   USHORT  LinkCollection,
    605   PUSAGE  UsageList,
    606   PULONG  UsageLength,
    607   PHIDP_PREPARSED_DATA  PreparsedData,
    608   PCHAR  Report,
    609   ULONG  ReportLength);
    610 
    611 HIDAPI
    612 NTSTATUS
    613 NTAPI
    614 HidP_UsageAndPageListDifference(
    615   PUSAGE_AND_PAGE  PreviousUsageList,
    616   PUSAGE_AND_PAGE  CurrentUsageList,
    617   PUSAGE_AND_PAGE  BreakUsageList,
    618   PUSAGE_AND_PAGE  MakeUsageList,
    619   ULONG  UsageListLength);
    620 
    621 HIDAPI
    622 NTSTATUS
    623 NTAPI
    624 HidP_UsageListDifference(
    625   PUSAGE  PreviousUsageList,
    626   PUSAGE  CurrentUsageList,
    627   PUSAGE  BreakUsageList,
    628   PUSAGE  MakeUsageList,
    629   ULONG  UsageListLength);
    630 
    631 #ifdef __cplusplus
    632 }
    633 #endif
    634 
    635 #endif /* __HIDPI_H */
    636