Commit b16fb118 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

hid: Don't sign-extend 16-bit values.

Some controllers (including, with the previous patch, any reported through SDL) may report a logical range of [0,65535], which takes up 16 bits but should not be sign-extended. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bd9e130e
......@@ -277,8 +277,6 @@ NTSTATUS WINAPI HidP_GetScaledUsageValue(HIDP_REPORT_TYPE ReportType, USAGE Usag
element->valueStartBit, element->bitCount, &rawValue);
if (rc != HIDP_STATUS_SUCCESS)
return rc;
if (element->caps.value.BitSize == 16)
rawValue = (short)rawValue;
*UsageValue = rawValue;
}
......@@ -925,8 +923,6 @@ NTSTATUS WINAPI HidP_GetData(HIDP_REPORT_TYPE ReportType, HIDP_DATA *DataList, U
element->valueStartBit, element->bitCount, &v);
if (rc != HIDP_STATUS_SUCCESS)
return rc;
if (element->caps.value.BitSize == 16)
v = (short)v;
DataList[uCount].DataIndex = element->caps.value.u.NotRange.DataIndex;
DataList[uCount].u.RawValue = v;
}
......
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