Commit 9ade4305 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidparse.sys: Add HID_VALUE_CAPS_IS_(ABSOLUTE|CONSTANT) flags instead of checking bit_field.

parent 8eb6180d
......@@ -647,7 +647,7 @@ static NTSTATUS get_button_caps( const struct hid_value_caps *caps, void *user )
dst->LinkUsage = caps->link_usage;
dst->BitField = caps->bit_field;
dst->IsAlias = FALSE;
dst->IsAbsolute = HID_VALUE_CAPS_IS_ABSOLUTE( caps );
dst->IsAbsolute = (caps->flags & HID_VALUE_CAPS_IS_ABSOLUTE) ? 1 : 0;
dst->IsRange = (caps->flags & HID_VALUE_CAPS_IS_RANGE) ? 1 : 0;
if (!dst->IsRange)
{
......@@ -704,7 +704,7 @@ static NTSTATUS get_value_caps( const struct hid_value_caps *caps, void *user )
dst->LinkUsage = caps->link_usage;
dst->BitField = caps->bit_field;
dst->IsAlias = FALSE;
dst->IsAbsolute = HID_VALUE_CAPS_IS_ABSOLUTE( caps );
dst->IsAbsolute = (caps->flags & HID_VALUE_CAPS_IS_ABSOLUTE) ? 1 : 0;
dst->HasNull = HID_VALUE_CAPS_HAS_NULL( caps );
dst->BitSize = caps->bit_size;
dst->UnitsExp = caps->units_exp;
......
......@@ -357,6 +357,9 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
if (!(is_array = HID_VALUE_CAPS_IS_ARRAY( &state->items ))) state->items.report_count -= usages_size - 1;
else start_bit -= state->items.report_count * state->items.bit_size;
if (!(state->items.bit_field & INPUT_ABS_REL)) state->items.flags |= HID_VALUE_CAPS_IS_ABSOLUTE;
if (state->items.bit_field & INPUT_DATA_CONST) state->items.flags |= HID_VALUE_CAPS_IS_CONSTANT;
while (usages_size--)
{
if (!is_array) start_bit -= state->items.report_count * state->items.bit_size;
......
......@@ -62,11 +62,12 @@ struct hid_value_caps
/* named array continues on next caps */
#define HID_VALUE_CAPS_ARRAY_HAS_MORE 0x01
#define HID_VALUE_CAPS_IS_CONSTANT 0x02
#define HID_VALUE_CAPS_IS_ABSOLUTE 0x08
#define HID_VALUE_CAPS_IS_RANGE 0x10
#define HID_VALUE_CAPS_IS_STRING_RANGE 0x40
#define HID_VALUE_CAPS_IS_DESIGNATOR_RANGE 0x80
#define HID_VALUE_CAPS_IS_ABSOLUTE(x) (((x)->bit_field & 0x04) == 0)
#define HID_VALUE_CAPS_HAS_NULL(x) (((x)->bit_field & 0x40) != 0)
#define HID_VALUE_CAPS_IS_ARRAY(c) (((c)->bit_field & 2) == 0)
#define HID_VALUE_CAPS_IS_BUTTON(c) ((c)->bit_size == 1 || HID_VALUE_CAPS_IS_ARRAY(c))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment