This file is indexed.

/usr/i586-mingw32msvc/include/ddk/hidpi.h is in mingw32-runtime 3.15.2-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
/*
 * hidpi.h
 *
 * Public Interface for HID parsing library.
 *
 * This file is part of the w32api package.
 *
 * Contributors:
 *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
 *
 * THIS SOFTWARE IS NOT COPYRIGHTED
 *
 * This source code is offered for use in the public domain. You may
 * use, modify or distribute it freely.
 *
 * This code is distributed in the hope that it will be useful but
 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
 * DISCLAIMED. This includes but is not limited to warranties of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 */

#ifndef __HIDPI_H
#define __HIDPI_H

#if __GNUC__ >=3
#pragma GCC system_header
#endif

#ifdef __cplusplus
extern "C" {
#endif

#include "ntddk.h"
#include "hidusage.h"

#if defined(_HIDPI_)
  #define HIDAPI DECLSPEC_EXPORT
#else
  #define HIDAPI DECLSPEC_IMPORT
#endif

typedef PUCHAR PHIDP_REPORT_DESCRIPTOR;
typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;

typedef struct _HIDP_UNKNOWN_TOKEN {
  UCHAR  Token;
  UCHAR  Reserved[3];
  ULONG  BitField;
} HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN;

typedef enum _HIDP_KEYBOARD_DIRECTION {
  HidP_Keyboard_Break,
  HidP_Keyboard_Make
} HIDP_KEYBOARD_DIRECTION;

typedef struct _HIDP_KEYBOARD_MODIFIER_STATE {
  _ANONYMOUS_UNION union {
    _ANONYMOUS_STRUCT struct {
      ULONG  LeftControl : 1;
      ULONG  LeftShift : 1;
      ULONG  LeftAlt : 1;
      ULONG  LeftGUI : 1;
      ULONG  RightControl : 1;
      ULONG  RightShift : 1;
      ULONG  RightAlt : 1;
      ULONG  RigthGUI : 1;
      ULONG  CapsLock : 1;
      ULONG  ScollLock : 1;
      ULONG  NumLock : 1;
      ULONG  Reserved : 21;
    } DUMMYSTRUCTNAME;
    ULONG ul;
  } DUMMYUNIONNAME;
} HIDP_KEYBOARD_MODIFIER_STATE, *PHIDP_KEYBOARD_MODIFIER_STATE;

typedef BOOLEAN (DDKAPI *PHIDP_INSERT_SCANCODES)(
  /*IN*/ PVOID  Context,
  /*IN*/ PCHAR  NewScanCodes,
  /*IN*/ ULONG  Length);

typedef struct _USAGE_AND_PAGE {
  USAGE  Usage;
  USAGE  UsagePage;
} USAGE_AND_PAGE, *PUSAGE_AND_PAGE;

HIDAPI
NTSTATUS
DDKAPI
HidP_TranslateUsageAndPagesToI8042ScanCodes(
  /*IN*/ PUSAGE_AND_PAGE  ChangedUsageList,
  /*IN*/ ULONG  UsageListLength,
  /*IN*/ HIDP_KEYBOARD_DIRECTION  KeyAction,
  /*IN OUT*/ PHIDP_KEYBOARD_MODIFIER_STATE  ModifierState,
  /*IN*/ PHIDP_INSERT_SCANCODES  InsertCodesProcedure,
  /*IN*/ PVOID  InsertCodesContext);

HIDAPI
NTSTATUS
DDKAPI
HidP_TranslateUsagesToI8042ScanCodes(
  /*IN*/ PUSAGE  ChangedUsageList,
  /*IN*/ ULONG  UsageListLength,
  /*IN*/ HIDP_KEYBOARD_DIRECTION  KeyAction,
  /*IN OUT*/ PHIDP_KEYBOARD_MODIFIER_STATE  ModifierState,
  /*IN*/ PHIDP_INSERT_SCANCODES  InsertCodesProcedure,
  /*IN*/ PVOID  InsertCodesContext);

typedef struct _HIDP_BUTTON_CAPS {
  USAGE  UsagePage;
  UCHAR  ReportID;
  BOOLEAN  IsAlias;
  USHORT  BitField;
  USHORT  LinkCollection;
  USAGE  LinkUsage;
  USAGE  LinkUsagePage;
  BOOLEAN  IsRange;
  BOOLEAN  IsStringRange;
  BOOLEAN  IsDesignatorRange;
  BOOLEAN  IsAbsolute;
  ULONG  Reserved[10];
  _ANONYMOUS_UNION union {
    struct {
      USAGE  UsageMin, UsageMax;
      USHORT  StringMin, StringMax;
      USHORT  DesignatorMin, DesignatorMax;
      USHORT  DataIndexMin, DataIndexMax;
    } Range;
    struct  {
       USAGE  Usage, Reserved1;
       USHORT  StringIndex, Reserved2;
       USHORT  DesignatorIndex, Reserved3;
       USHORT  DataIndex, Reserved4;
    } NotRange;
  } DUMMYUNIONNAME;
} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;

typedef struct _HIDP_CAPS {
  USAGE  Usage;
  USAGE  UsagePage;
  USHORT  InputReportByteLength;
  USHORT  OutputReportByteLength;
  USHORT  FeatureReportByteLength;
  USHORT  Reserved[17];
  USHORT  NumberLinkCollectionNodes;
  USHORT  NumberInputButtonCaps;
  USHORT  NumberInputValueCaps;
  USHORT  NumberInputDataIndices;
  USHORT  NumberOutputButtonCaps;
  USHORT  NumberOutputValueCaps;
  USHORT  NumberOutputDataIndices;
  USHORT  NumberFeatureButtonCaps;
  USHORT  NumberFeatureValueCaps;
  USHORT  NumberFeatureDataIndices;
} HIDP_CAPS, *PHIDP_CAPS;

typedef struct _HIDP_DATA {
  USHORT  DataIndex;
  USHORT  Reserved;
  _ANONYMOUS_UNION union {
    ULONG  RawValue;
    BOOLEAN  On;
  }  DUMMYUNIONNAME;
} HIDP_DATA, *PHIDP_DATA;

typedef struct _HIDP_EXTENDED_ATTRIBUTES {
  UCHAR  NumGlobalUnknowns;
  UCHAR  Reserved[3];
  PHIDP_UNKNOWN_TOKEN  GlobalUnknowns;
  ULONG  Data[1];
} HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES;

#define HIDP_LINK_COLLECTION_ROOT         ((USHORT) -1)
#define HIDP_LINK_COLLECTION_UNSPECIFIED  ((USHORT) 0)

typedef struct _HIDP_LINK_COLLECTION_NODE {
  USAGE  LinkUsage;
  USAGE  LinkUsagePage;
  USHORT  Parent;
  USHORT  NumberOfChildren;
  USHORT  NextSibling;
  USHORT  FirstChild;
  ULONG  CollectionType: 8;
  ULONG  IsAlias: 1;
  ULONG  Reserved: 23;
  PVOID  UserContext;
} HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE;

typedef struct _HIDP_VALUE_CAPS {
  USAGE  UsagePage;
  UCHAR  ReportID;
  BOOLEAN  IsAlias;
  USHORT  BitField;
  USHORT  LinkCollection;
  USAGE  LinkUsage;
  USAGE  LinkUsagePage;
  BOOLEAN  IsRange;
  BOOLEAN  IsStringRange;
  BOOLEAN  IsDesignatorRange;
  BOOLEAN  IsAbsolute;
  BOOLEAN  HasNull;
  UCHAR  Reserved;
  USHORT  BitSize;
  USHORT  ReportCount;
  USHORT  Reserved2[5];
  ULONG  UnitsExp;
  ULONG  Units;
  LONG  LogicalMin, LogicalMax;
  LONG  PhysicalMin, PhysicalMax;
    _ANONYMOUS_UNION union {
      struct {
        USAGE  UsageMin, UsageMax;
        USHORT  StringMin, StringMax;
        USHORT  DesignatorMin, DesignatorMax;
        USHORT  DataIndexMin, DataIndexMax;
      } Range;
      struct {
        USAGE  Usage, Reserved1;
        USHORT  StringIndex, Reserved2;
        USHORT  DesignatorIndex, Reserved3;
        USHORT  DataIndex, Reserved4;
      } NotRange;
    } DUMMYUNIONNAME;
} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;

typedef enum _HIDP_REPORT_TYPE {
  HidP_Input,
  HidP_Output,
  HidP_Feature
} HIDP_REPORT_TYPE;

#define FACILITY_HID_ERROR_CODE           0x11

#define HIDP_ERROR_CODES(SEV, CODE) \
  ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE)))

#define HIDP_STATUS_SUCCESS                 (HIDP_ERROR_CODES(0x0, 0))
#define HIDP_STATUS_NULL                    (HIDP_ERROR_CODES(0x8, 1))
#define HIDP_STATUS_INVALID_PREPARSED_DATA  (HIDP_ERROR_CODES(0xC, 1))
#define HIDP_STATUS_INVALID_REPORT_TYPE     (HIDP_ERROR_CODES(0xC, 2))
#define HIDP_STATUS_INVALID_REPORT_LENGTH   (HIDP_ERROR_CODES(0xC, 3))
#define HIDP_STATUS_USAGE_NOT_FOUND         (HIDP_ERROR_CODES(0xC, 4))
#define HIDP_STATUS_VALUE_OUT_OF_RANGE      (HIDP_ERROR_CODES(0xC, 5))
#define HIDP_STATUS_BAD_LOG_PHY_VALUES      (HIDP_ERROR_CODES(0xC, 6))
#define HIDP_STATUS_BUFFER_TOO_SMALL        (HIDP_ERROR_CODES(0xC, 7))
#define HIDP_STATUS_INTERNAL_ERROR          (HIDP_ERROR_CODES(0xC, 8))
#define HIDP_STATUS_I8042_TRANS_UNKNOWN     (HIDP_ERROR_CODES(0xC, 9))
#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID  (HIDP_ERROR_CODES(0xC, 0xA))
#define HIDP_STATUS_NOT_VALUE_ARRAY         (HIDP_ERROR_CODES(0xC, 0xB))
#define HIDP_STATUS_IS_VALUE_ARRAY          (HIDP_ERROR_CODES(0xC, 0xC))
#define HIDP_STATUS_DATA_INDEX_NOT_FOUND    (HIDP_ERROR_CODES(0xC, 0xD))
#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xC, 0xE))
#define HIDP_STATUS_BUTTON_NOT_PRESSED      (HIDP_ERROR_CODES(0xC, 0xF))
#define HIDP_STATUS_REPORT_DOES_NOT_EXIST   (HIDP_ERROR_CODES(0xC, 0x10))
#define HIDP_STATUS_NOT_IMPLEMENTED         (HIDP_ERROR_CODES(0xC, 0x20))
#define HIDP_STATUS_I8242_TRANS_UNKNOWN     HIDP_STATUS_I8042_TRANS_UNKNOWN



/*
 * NTSTATUS
 * HidP_GetButtonCaps(
 * IN HIDP_REPORT_TYPE  ReportType,
 * OUT PHIDP_BUTTON_CAPS  ButtonCaps,
 * IN OUT PULONG  ButtonCapsLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData);
 */
#define HidP_GetButtonCaps(_Type_, _Caps_, _Len_, _Data_) \
  HidP_GetSpecificButtonCaps(_Type_, 0, 0, 0, _Caps_, _Len_, _Data_)

/*
 * NTSTATUS
 * HidP_GetButtons(
 * IN HIDP_REPORT_TYPE  ReportType,
 * IN USAGE  UsagePage,
 * IN USHORT  LinkCollection,
 * OUT USAGE  *UsageList,
 * IN OUT ULONG  *UsageLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData,
 * IN PCHAR  Report,
 * IN ULONG  ReportLength);
 */
#define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \
  HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe)

#define HidP_GetButtonListLength(RTy, UPa, Ppd) \
  HidP_GetUsageListLength(Rty, UPa, Ppd)


/*
 * NTSTATUS
 * HidP_GetButtonsEx(
 * IN HIDP_REPORT_TYPE  ReportType,
 * IN USHORT  LinkCollection,
 * OUT PUSAGE_AND_PAGE  ButtonList,
 * IN OUT ULONG  *UsageLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData,
 * IN PCHAR  Report,
 * IN ULONG  ReportLength);
 */
#define HidP_GetButtonsEx(RT, LC, BL, UL, PD, R, RL)  \
  HidP_GetUsagesEx(RT, LC, BL, UL, PD, R, RL)

HIDAPI
NTSTATUS
DDKAPI
HidP_GetCaps(
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*OUT*/ PHIDP_CAPS  Capabilities);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetData(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*OUT*/ PHIDP_DATA  DataList,
  /*IN OUT*/ PULONG  DataLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetExtendedAttributes(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USHORT  DataIndex,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*OUT*/ PHIDP_EXTENDED_ATTRIBUTES  Attributes,
  /*IN OUT*/ PULONG  LengthAttributes);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetLinkCollectionNodes(
  /*OUT*/ PHIDP_LINK_COLLECTION_NODE  LinkCollectionNodes,
  /*IN OUT*/ PULONG  LinkCollectionNodesLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetScaledUsageValue(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection  /*OPTIONAL*/,
  /*IN*/ USAGE  Usage,
  /*OUT*/ PLONG  UsageValue,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetSpecificButtonCaps(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection,
  /*IN*/ USAGE  Usage,
  /*OUT*/ PHIDP_BUTTON_CAPS  ButtonCaps,
  /*IN OUT*/ PULONG  ButtonCapsLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetSpecificValueCaps(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection,
  /*IN*/ USAGE  Usage,
  /*OUT*/ PHIDP_VALUE_CAPS  ValueCaps,
  /*IN OUT*/ PULONG  ValueCapsLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetUsages(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection  /*OPTIONAL*/,
  /*OUT*/ USAGE  *UsageList,
  /*IN OUT*/ ULONG  *UsageLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetUsagesEx(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USHORT  LinkCollection,
  /*OUT*/ PUSAGE_AND_PAGE  ButtonList,
  /*IN OUT*/ ULONG  *UsageLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetUsageValue(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection,
  /*IN*/ USAGE  Usage,
  /*OUT*/ PULONG  UsageValue,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_GetUsageValueArray(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection  /*OPTIONAL*/,
  /*IN*/ USAGE  Usage,
  /*OUT*/ PCHAR  UsageValue,
  /*IN*/ USHORT  UsageValueByteLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

/*
 * NTSTATUS
 * HidP_GetValueCaps(
 * IN HIDP_REPORT_TYPE  ReportType,
 * OUT PHIDP_VALUE_CAPS  ValueCaps,
 * IN OUT PULONG  ValueCapsLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData);
 */
#define HidP_GetValueCaps(_Type_, _Caps_, _Len_, _Data_) \
  HidP_GetSpecificValueCaps (_Type_, 0, 0, 0, _Caps_, _Len_, _Data_)

HIDAPI
NTSTATUS
DDKAPI
HidP_InitializeReportForID(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ UCHAR  ReportID,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

/*
 * BOOLEAN
 * HidP_IsSameUsageAndPage(
 *   USAGE_AND_PAGE  u1,
 *   USAGE_AND_PAGE  u2);
 */
#define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2))

HIDAPI
ULONG
DDKAPI
HidP_MaxDataListLength(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData);

HIDAPI
ULONG
DDKAPI
HidP_MaxUsageListLength(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage  /*OPTIONAL*/,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData);

/*
 * NTSTATUS
 * HidP_SetButtons(
 * IN HIDP_REPORT_TYPE  ReportType,
 * IN USAGE  UsagePage,
 * IN USHORT  LinkCollection,
 * IN PUSAGE  UsageList,
 * IN OUT PULONG  UsageLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData,
 * IN OUT PCHAR  Report,
 * IN ULONG  ReportLength);
 */
#define HidP_SetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \
  HidP_SetUsages(RT, UP, LC, UL1, UL2, PD, R, RL)

HIDAPI
NTSTATUS
DDKAPI
HidP_SetData(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ PHIDP_DATA  DataList,
  /*IN OUT*/ PULONG  DataLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_SetScaledUsageValue(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage, 
  /*IN*/ USHORT  LinkCollection  /*OPTIONAL*/,
  /*IN*/ USAGE  Usage,
  /*IN*/ LONG  UsageValue,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_SetUsages(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection /*OPTIONAL*/,
  /*IN*/ PUSAGE  UsageList,
  /*IN OUT*/ PULONG  UsageLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_SetUsageValue(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection,
  /*IN*/ USAGE  Usage,
  /*IN*/ ULONG  UsageValue,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_SetUsageValueArray(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection  /*OPTIONAL*/,
  /*IN*/ USAGE  Usage,
  /*IN*/ PCHAR  UsageValue,
  /*IN*/ USHORT  UsageValueByteLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

/*
 * NTSTATUS
 * HidP_UnsetButtons(
 * IN HIDP_REPORT_TYPE  ReportType,
 * IN USAGE  UsagePage,
 * IN USHORT  LinkCollection,
 * IN PUSAGE  UsageList,
 * IN OUT PULONG  UsageLength,
 * IN PHIDP_PREPARSED_DATA  PreparsedData,
 * IN OUT PCHAR  Report,
 * IN ULONG  ReportLength);
 */
#define HidP_UnsetButtons(RT, UP, LC, UL1, UL2, PD, R, RL) \
  HidP_UnsetUsages(RT, UP, LC, UL1, UL2, PD, R, RL)

HIDAPI
NTSTATUS
DDKAPI
HidP_UnsetUsages(
  /*IN*/ HIDP_REPORT_TYPE  ReportType,
  /*IN*/ USAGE  UsagePage,
  /*IN*/ USHORT  LinkCollection,
  /*IN*/ PUSAGE  UsageList,
  /*IN OUT*/ PULONG  UsageLength,
  /*IN*/ PHIDP_PREPARSED_DATA  PreparsedData,
  /*IN OUT*/ PCHAR  Report,
  /*IN*/ ULONG  ReportLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_UsageAndPageListDifference(
  /*IN*/ PUSAGE_AND_PAGE  PreviousUsageList,
  /*IN*/ PUSAGE_AND_PAGE  CurrentUsageList,
  /*OUT*/ PUSAGE_AND_PAGE  BreakUsageList,
  /*OUT*/ PUSAGE_AND_PAGE  MakeUsageList,
  /*IN*/ ULONG  UsageListLength);

HIDAPI
NTSTATUS
DDKAPI
HidP_UsageListDifference(
  /*IN*/ PUSAGE  PreviousUsageList,
  /*IN*/ PUSAGE  CurrentUsageList,
  /*OUT*/ PUSAGE  BreakUsageList,
  /*OUT*/ PUSAGE  MakeUsageList,
  /*IN*/ ULONG  UsageListLength);

#ifdef __cplusplus
}
#endif

#endif /* __HIDPI_H */