As documented on MSDN, and as testing shows.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/hidclass.sys/descriptor.c | 8 +++++--- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 4 ++-- include/wine/hid.h | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/hidclass.sys/descriptor.c b/dlls/hidclass.sys/descriptor.c index 19f12d77ded..86b68863308 100644 --- a/dlls/hidclass.sys/descriptor.c +++ b/dlls/hidclass.sys/descriptor.c @@ -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) { diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index ff1db96a06a..5453af8ff1c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -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); diff --git a/include/wine/hid.h b/include/wine/hid.h index 47aeda5575c..185015a52d9 100644 --- a/include/wine/hid.h +++ b/include/wine/hid.h @@ -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;