Author: tfaber
Date: Sat May 11 17:15:54 2013
New Revision: 58998
URL:
http://svn.reactos.org/svn/reactos?rev=58998&view=rev
Log:
[KBDHID][MOUHID]
- Free the correct usage list buffer
Modified:
trunk/reactos/drivers/hid/kbdhid/kbdhid.c
trunk/reactos/drivers/hid/kbdhid/kbdhid.h
trunk/reactos/drivers/hid/mouhid/mouhid.c
trunk/reactos/drivers/hid/mouhid/mouhid.h
Modified: trunk/reactos/drivers/hid/kbdhid/kbdhid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/kbdhid/kbdhid.…
==============================================================================
--- trunk/reactos/drivers/hid/kbdhid/kbdhid.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/kbdhid/kbdhid.c [iso-8859-1] Sat May 11 17:15:54 2013
@@ -729,6 +729,7 @@
ExFreePoolWithTag(PreparsedData, KBDHID_TAG);
return STATUS_INSUFFICIENT_RESOURCES;
}
+ DeviceExtension->UsageListBuffer = Buffer;
/* init usage lists */
RtlZeroMemory(Buffer, sizeof(USAGE_AND_PAGE) * 4 * Buttons);
@@ -788,9 +789,10 @@
DeviceExtension->PreparsedData = NULL;
}
- if (DeviceExtension->CurrentUsageList)
- {
- ExFreePoolWithTag(DeviceExtension->CurrentUsageList, KBDHID_TAG);
+ if (DeviceExtension->UsageListBuffer)
+ {
+ ExFreePoolWithTag(DeviceExtension->UsageListBuffer, KBDHID_TAG);
+ DeviceExtension->UsageListBuffer = NULL;
DeviceExtension->CurrentUsageList = NULL;
DeviceExtension->PreviousUsageList = NULL;
DeviceExtension->MakeUsageList = NULL;
Modified: trunk/reactos/drivers/hid/kbdhid/kbdhid.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/kbdhid/kbdhid.…
==============================================================================
--- trunk/reactos/drivers/hid/kbdhid/kbdhid.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/kbdhid/kbdhid.h [iso-8859-1] Sat May 11 17:15:54 2013
@@ -39,6 +39,11 @@
// class callback
//
PVOID ClassService;
+
+ //
+ // buffer for the four usage lists below
+ //
+ PVOID UsageListBuffer;
//
// usage list length
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] Sat May 11 17:15:54 2013
@@ -720,7 +720,7 @@
ULONG ValueCapsLength;
HIDP_VALUE_CAPS ValueCaps;
PMOUHID_DEVICE_EXTENSION DeviceExtension;
- PUSHORT Buffer;
+ PUSAGE Buffer;
/* get device extension */
DeviceExtension = DeviceObject->DeviceExtension;
@@ -816,6 +816,7 @@
ExFreePoolWithTag(PreparsedData, MOUHID_TAG);
return STATUS_INSUFFICIENT_RESOURCES;
}
+ DeviceExtension->UsageListBuffer = Buffer;
/* init usage lists */
RtlZeroMemory(Buffer, sizeof(USAGE) * 4 * Buttons);
@@ -919,9 +920,10 @@
DeviceExtension->PreparsedData = NULL;
}
- if (DeviceExtension->CurrentUsageList)
- {
- ExFreePoolWithTag(DeviceExtension->CurrentUsageList, MOUHID_TAG);
+ if (DeviceExtension->UsageListBuffer)
+ {
+ ExFreePoolWithTag(DeviceExtension->UsageListBuffer, MOUHID_TAG);
+ DeviceExtension->UsageListBuffer = NULL;
DeviceExtension->CurrentUsageList = NULL;
DeviceExtension->PreviousUsageList = NULL;
DeviceExtension->MakeUsageList = NULL;
Modified: trunk/reactos/drivers/hid/mouhid/mouhid.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
==============================================================================
--- trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] Sat May 11 17:15:54 2013
@@ -48,6 +48,11 @@
// wheel usage page
//
USHORT WheelUsagePage;
+
+ //
+ // buffer for the four usage lists below
+ //
+ PVOID UsageListBuffer;
//
// usage list length