Commit 152aafc7 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidclass.sys: Set BitField item to current value.

As documented on MSDN, and as testing shows. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bf0ab04b
......@@ -147,7 +147,10 @@ static void copy_hidp_value_caps( HIDP_VALUE_CAPS *out, const struct hid_value_c
out->LinkCollection = in->link_collection;
out->LinkUsagePage = in->link_usage_page;
out->LinkUsage = in->link_usage;
out->BitField = in->bit_field;
out->IsAlias = FALSE;
out->IsAbsolute = HID_VALUE_CAPS_IS_ABSOLUTE( in );
out->HasNull = HID_VALUE_CAPS_HAS_NULL( in );
out->BitSize = in->bit_size;
out->ReportCount = in->report_count;
out->UnitsExp = in->units_exp;
......@@ -501,6 +504,8 @@ static int parse_descriptor( BYTE *descriptor, unsigned int index, unsigned int
}
i += size;
state->items.bit_field = value;
#define SHORT_ITEM(tag,type) (((tag)<<4)|((type)<<2))
switch (item & SHORT_ITEM(0xf,0x3))
{
......@@ -660,9 +665,6 @@ static void build_elements(WINE_HID_REPORT *wine_report, WINE_HID_ELEMENT *elems
wine_report->bitSize += wine_element->bitCount;
wine_element->caps = feature->caps;
wine_element->caps.BitField = feature->BitField;
wine_element->caps.IsAbsolute = feature->IsAbsolute;
wine_element->caps.HasNull = feature->HasNull;
if (wine_element->caps.IsRange)
{
......
......@@ -1892,7 +1892,7 @@ static void test_hidp(HANDLE file, int report_id)
check_member(button_caps[i], expect_button_caps[i], "%04x", UsagePage);
check_member(button_caps[i], expect_button_caps[i], "%d", ReportID);
check_member(button_caps[i], expect_button_caps[i], "%d", IsAlias);
todo_wine
todo_wine_if(i == 1 || i == 2)
check_member(button_caps[i], expect_button_caps[i], "%d", BitField);
todo_wine_if(i >= 2)
check_member(button_caps[i], expect_button_caps[i], "%d", LinkCollection);
......@@ -1994,7 +1994,7 @@ static void test_hidp(HANDLE file, int report_id)
check_member(value_caps[i], expect_value_caps[i], "%04x", UsagePage);
check_member(value_caps[i], expect_value_caps[i], "%d", ReportID);
check_member(value_caps[i], expect_value_caps[i], "%d", IsAlias);
todo_wine
todo_wine_if(i == 2)
check_member(value_caps[i], expect_value_caps[i], "%d", BitField);
check_member(value_caps[i], expect_value_caps[i], "%d", LinkCollection);
check_member(value_caps[i], expect_value_caps[i], "%04x", LinkUsage);
......
......@@ -84,6 +84,7 @@ struct hid_value_caps
USHORT link_collection;
USAGE link_usage_page;
USAGE link_usage;
USHORT bit_field;
USHORT bit_size;
USHORT report_count;
LONG logical_min;
......@@ -94,6 +95,9 @@ struct hid_value_caps
ULONG units_exp;
};
#define HID_VALUE_CAPS_IS_ABSOLUTE(x) (((x)->bit_field & 0x04) == 0)
#define HID_VALUE_CAPS_HAS_NULL(x) (((x)->bit_field & 0x40) != 0)
typedef struct __WINE_HID_REPORT
{
UCHAR reportID;
......
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