Author: janderwald
Date: Wed Oct 24 09:37:08 2012
New Revision: 57603
URL:
http://svn.reactos.org/svn/reactos?rev=57603&view=rev
Log:
[MOUHID]
- Report absolute mouse in Flags MOUSE_INPUT_DATA member
[HIDPARSER]
- Fix data conversion when extracting unscaled data from reports
- Fixes VBOX absolute pointing device
- Tested with VBOX 4.1.22
- #Core-6553 #resolve
Modified:
trunk/reactos/drivers/hid/mouhid/mouhid.c
trunk/reactos/lib/drivers/hidparser/api.c
Modified: trunk/reactos/drivers/hid/mouhid/mouhid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
==============================================================================
--- trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] Wed Oct 24 09:37:08 2012
@@ -92,7 +92,8 @@
VOID
MouHid_GetButtonFlags(
IN PMOUHID_DEVICE_EXTENSION DeviceExtension,
- OUT PUSHORT ButtonFlags)
+ OUT PUSHORT ButtonFlags,
+ OUT PUSHORT Flags)
{
NTSTATUS Status;
USAGE Usage;
@@ -102,6 +103,7 @@
/* init flags */
*ButtonFlags = 0;
+ *Flags = 0;
/* get usages */
CurrentUsageListLength = DeviceExtension->UsageListLength;
@@ -170,7 +172,7 @@
if (DeviceExtension->MouseAbsolute)
{
// mouse operates absolute
- *ButtonFlags |= MOUSE_MOVE_ABSOLUTE;
+ *Flags |= MOUSE_MOVE_ABSOLUTE;
}
}
@@ -212,6 +214,7 @@
NTSTATUS Status;
LONG LastX, LastY;
MOUSE_INPUT_DATA MouseInputData;
+ USHORT Flags;
/* get device extension */
DeviceExtension = (PMOUHID_DEVICE_EXTENSION)Context;
@@ -239,13 +242,14 @@
MouHid_GetButtonMove(DeviceExtension, &LastX, &LastY);
/* get mouse change flags */
- MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags);
+ MouHid_GetButtonFlags(DeviceExtension, &ButtonFlags, &Flags);
/* init input data */
RtlZeroMemory(&MouseInputData, sizeof(MOUSE_INPUT_DATA));
/* init input data */
MouseInputData.ButtonFlags = ButtonFlags;
+ MouseInputData.Flags = Flags;
MouseInputData.LastX = LastX;
MouseInputData.LastY = LastY;
Modified: trunk/reactos/lib/drivers/hidparser/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/api.…
==============================================================================
--- trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] Wed Oct 24 09:37:08 2012
@@ -630,11 +630,10 @@
ASSERT(ReportItem->ByteOffset < ReportDescriptorLength);
//
- // one extra shift for skipping the prepended report id
- //
- Data = 0;
- Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1],
min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
- //Data = ReportDescriptor[ReportItem->ByteOffset + 1];
+ // FIXME: support items with variable bitlength
+ //
+ ASSERT(ReportItem->BitCount == 16);
+ Data = (ReportDescriptor[ReportItem->ByteOffset +1] & 0xFF) |
(ReportDescriptor[ReportItem->ByteOffset +2] & 0xFF) << 8;
//
// shift data