hidclass.sys: Remove old reports from WINE_HIDP_PREPARSED_DATA.
[wine.git] / include / wine / hid.h
blob2bb26ff280e14964ccdb6c63c443545e0cb974e3
1 /*
2 * Wine internal HID structures
4 * Copyright 2015 Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_PARSE_H
22 #define __WINE_PARSE_H
24 #include "ntstatus.h"
25 #define WIN32_NO_STATUS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winternl.h"
29 #include "hidusage.h"
30 #include "ddk/hidpi.h"
32 #define HID_MAGIC 0x8491759
34 struct hid_value_caps
36 USAGE usage_page;
37 USAGE usage_min;
38 USAGE usage_max;
39 USHORT data_index_min;
40 USHORT data_index_max;
41 USHORT string_min;
42 USHORT string_max;
43 USHORT designator_min;
44 USHORT designator_max;
45 BOOLEAN is_range;
46 BOOLEAN is_string_range;
47 BOOLEAN is_designator_range;
48 UCHAR report_id;
49 USHORT link_collection;
50 USAGE link_usage_page;
51 USAGE link_usage;
52 USHORT bit_field;
53 USHORT bit_size;
54 USHORT report_count;
55 ULONG start_bit;
56 ULONG start_index;
57 LONG logical_min;
58 LONG logical_max;
59 LONG physical_min;
60 LONG physical_max;
61 ULONG units;
62 ULONG units_exp;
65 #define HID_VALUE_CAPS_IS_ABSOLUTE(x) (((x)->bit_field & 0x04) == 0)
66 #define HID_VALUE_CAPS_HAS_NULL(x) (((x)->bit_field & 0x40) != 0)
67 #define HID_VALUE_CAPS_IS_ARRAY(c) (((c)->bit_field & 2) == 0)
68 #define HID_VALUE_CAPS_IS_BUTTON(c) ((c)->bit_size == 1 || HID_VALUE_CAPS_IS_ARRAY(c))
70 typedef struct __WINE_HIDP_PREPARSED_DATA
72 DWORD magic;
73 DWORD dwSize;
74 HIDP_CAPS caps;
75 USHORT value_caps_count[3];
76 struct hid_value_caps value_caps[1];
77 } WINE_HIDP_PREPARSED_DATA, *PWINE_HIDP_PREPARSED_DATA;
79 #define HID_INPUT_VALUE_CAPS(d) ((d)->value_caps)
80 #define HID_OUTPUT_VALUE_CAPS(d) (HID_INPUT_VALUE_CAPS(d) + (d)->value_caps_count[0])
81 #define HID_FEATURE_VALUE_CAPS(d) (HID_OUTPUT_VALUE_CAPS(d) + (d)->value_caps_count[1])
82 #define HID_COLLECTION_VALUE_CAPS(d) (HID_FEATURE_VALUE_CAPS(d) + (d)->value_caps_count[2])
84 #endif /* __WINE_PARSE_H */