Author: tfaber
Date: Sun May 12 15:44:58 2013
New Revision: 59005

URL: http://svn.reactos.org/svn/reactos?rev=59005&view=rev
Log:
[HIDCLASS]
- Use pool tagging

Modified:
    trunk/reactos/drivers/hid/hidclass/fdo.c
    trunk/reactos/drivers/hid/hidclass/hidclass.c
    trunk/reactos/drivers/hid/hidclass/pdo.c
    trunk/reactos/drivers/hid/hidclass/precomp.h

Modified: trunk/reactos/drivers/hid/hidclass/fdo.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/fdo.c?rev=59005&r1=59004&r2=59005&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/fdo.c    [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/fdo.c    [iso-8859-1] Sun May 12 
15:44:58 2013
@@ -294,7 +294,9 @@
     //
     // now allocate space for the report descriptor
     //
-    FDODeviceExtension->ReportDescriptor = 
(PUCHAR)ExAllocatePool(NonPagedPool, 
FDODeviceExtension->HidDescriptor.DescriptorList[0].wReportLength);
+    FDODeviceExtension->ReportDescriptor = ExAllocatePoolWithTag(NonPagedPool,
+                                                                 
FDODeviceExtension->HidDescriptor.DescriptorList[0].wReportLength,
+                                                                 HIDCLASS_TAG);
     if (!FDODeviceExtension->ReportDescriptor)
     {
         //
@@ -444,7 +446,9 @@
     //
     // allocate result
     //
-    DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(NonPagedPool, 
sizeof(DEVICE_RELATIONS) + (FDODeviceExtension->DeviceRelations->Count-1) * 
sizeof(PDEVICE_OBJECT));
+    DeviceRelations = ExAllocatePoolWithTag(NonPagedPool,
+                                            sizeof(DEVICE_RELATIONS) + 
(FDODeviceExtension->DeviceRelations->Count-1) * sizeof(PDEVICE_OBJECT),
+                                            HIDCLASS_TAG);
     if (!DeviceRelations)
     {
         //

Modified: trunk/reactos/drivers/hid/hidclass/hidclass.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/hidclass.c?rev=59005&r1=59004&r2=59005&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/hidclass.c       [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/hidclass.c       [iso-8859-1] Sun May 12 
15:44:58 2013
@@ -184,7 +184,7 @@
     //
     // allocate context
     //
-    Context = (PHIDCLASS_FILEOP_CONTEXT)ExAllocatePool(NonPagedPool, 
sizeof(HIDCLASS_FILEOP_CONTEXT));
+    Context = ExAllocatePoolWithTag(NonPagedPool, 
sizeof(HIDCLASS_FILEOP_CONTEXT), HIDCLASS_TAG);
     if (!Context)
     {
         //
@@ -344,7 +344,7 @@
     //
     // free context
     //
-    ExFreePool(IrpContext);
+    ExFreePoolWithTag(IrpContext, HIDCLASS_TAG);
 
     //
     // complete request
@@ -462,7 +462,7 @@
     //
     // free input report buffer
     //
-    ExFreePool(IrpContext->InputReportBuffer);
+    ExFreePoolWithTag(IrpContext->InputReportBuffer, HIDCLASS_TAG);
 
     //
     // remove us from pending list
@@ -517,7 +517,7 @@
     //
     // free irp context
     //
-    ExFreePool(IrpContext);
+    ExFreePoolWithTag(IrpContext, HIDCLASS_TAG);
 
     //
     // done
@@ -611,7 +611,7 @@
     //
     // allocate completion context
     //
-    IrpContext = ExAllocatePool(NonPagedPool, sizeof(HIDCLASS_IRP_CONTEXT));
+    IrpContext = ExAllocatePoolWithTag(NonPagedPool, 
sizeof(HIDCLASS_IRP_CONTEXT), HIDCLASS_TAG);
     if (!IrpContext)
     {
         //
@@ -673,14 +673,14 @@
     //
     // allocate buffer
     //
-    IrpContext->InputReportBuffer = ExAllocatePool(NonPagedPool, 
IrpContext->InputReportBufferLength);
+    IrpContext->InputReportBuffer = ExAllocatePoolWithTag(NonPagedPool, 
IrpContext->InputReportBufferLength, HIDCLASS_TAG);
     if (!IrpContext->InputReportBuffer)
     {
         //
         // no memory
         //
         IoFreeIrp(Irp);
-        ExFreePool(IrpContext);
+        ExFreePoolWithTag(IrpContext, HIDCLASS_TAG);
         return STATUS_INSUFFICIENT_RESOURCES;
     }
 

Modified: trunk/reactos/drivers/hid/hidclass/pdo.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/pdo.c?rev=59005&r1=59004&r2=59005&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/pdo.c    [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/pdo.c    [iso-8859-1] Sun May 12 
15:44:58 2013
@@ -98,7 +98,7 @@
     //
     // allocate new buffer
     //
-    NewBuffer = (LPWSTR)ExAllocatePool(NonPagedPool, (Length + 1) * 
sizeof(WCHAR));
+    NewBuffer = ExAllocatePoolWithTag(NonPagedPool, (Length + 1) * 
sizeof(WCHAR), HIDCLASS_TAG);
     if (!NewBuffer)
     {
         //
@@ -127,7 +127,7 @@
     //
     // free old buffer
     //
-    ExFreePool(Buffer);
+    ExFreePoolWithTag(Buffer, 0);
 
     //
     // store result
@@ -249,12 +249,12 @@
     //
     // free old buffer
     //
-    ExFreePool((PVOID)Irp->IoStatus.Information);
+    ExFreePoolWithTag((PVOID)Irp->IoStatus.Information, 0);
 
     //
     // allocate buffer
     //
-    Ptr = (LPWSTR)ExAllocatePool(NonPagedPool, (Offset + 1) * sizeof(WCHAR));
+    Ptr = ExAllocatePoolWithTag(NonPagedPool, (Offset + 1) * sizeof(WCHAR), 
HIDCLASS_TAG);
     if (!Ptr)
     {
         //
@@ -294,7 +294,7 @@
     //
     // allocate buffer
     //
-    Buffer = ExAllocatePool(NonPagedPool, 5 * sizeof(WCHAR));
+    Buffer = ExAllocatePoolWithTag(NonPagedPool, 5 * sizeof(WCHAR), 
HIDCLASS_TAG);
     if (!Buffer)
     {
         //
@@ -322,7 +322,7 @@
 {
     LPWSTR Buffer;
 
-    Buffer = (LPWSTR)ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR));
+    Buffer = ExAllocatePoolWithTag(NonPagedPool, 2 * sizeof(WCHAR), 
HIDCLASS_TAG);
     if (!Buffer)
     {
         //
@@ -437,7 +437,7 @@
             //
             //
             //
-            BusInformation = 
(PPNP_BUS_INFORMATION)ExAllocatePool(NonPagedPool, sizeof(PNP_BUS_INFORMATION));
+            BusInformation = ExAllocatePoolWithTag(NonPagedPool, 
sizeof(PNP_BUS_INFORMATION), HIDCLASS_TAG);
 
             //
             // fill in result
@@ -478,7 +478,7 @@
             //
             // allocate device relations
             //
-            DeviceRelation = (PDEVICE_RELATIONS)ExAllocatePool(NonPagedPool, 
sizeof(DEVICE_RELATIONS));
+            DeviceRelation = ExAllocatePoolWithTag(NonPagedPool, 
sizeof(DEVICE_RELATIONS), HIDCLASS_TAG);
             if (!DeviceRelation)
             {
                 //
@@ -649,7 +649,7 @@
     // first allocate device relations
     //
     Length = sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * 
FDODeviceExtension->Common.DeviceDescription.CollectionDescLength;
-    DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(NonPagedPool, Length);
+    DeviceRelations = ExAllocatePoolWithTag(NonPagedPool, Length, 
HIDCLASS_TAG);
     if (!DeviceRelations)
     {
         //
@@ -760,7 +760,7 @@
         //
         // free device relations
         //
-        ExFreePool(DeviceRelations);
+        ExFreePoolWithTag(DeviceRelations, HIDCLASS_TAG);
         return Status;
     }
 

Modified: trunk/reactos/drivers/hid/hidclass/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/precomp.h?rev=59005&r1=59004&r2=59005&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/precomp.h        [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/precomp.h        [iso-8859-1] Sun May 12 
15:44:58 2013
@@ -10,6 +10,8 @@
 #include <wdmguid.h>
 #include <debug.h>
 
+#define HIDCLASS_TAG 'CdiH'
+
 typedef struct
 {
     PDRIVER_OBJECT DriverObject;


Reply via email to