From 6a2050afbeec1a6eccf480fb2a4d5e654589dcb2 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Thu, 26 May 2011 22:22:37 +0000 Subject: [PATCH] [HAL] - Use ExFreePoolWithTag instead of ExFreePool - Add definitions of used tags svn path=/trunk/; revision=51943 --- reactos/hal/halx86/generic/legacy/bus/bushndlr.c | 14 +++++++------- reactos/hal/halx86/generic/legacy/bus/pcibus.c | 10 +++++----- reactos/hal/halx86/generic/legacy/bussupp.c | 4 ++-- reactos/hal/halx86/include/hal.h | 3 +++ 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/reactos/hal/halx86/generic/legacy/bus/bushndlr.c b/reactos/hal/halx86/generic/legacy/bus/bushndlr.c index 2ab551c610e..31ea9d592dc 100644 --- a/reactos/hal/halx86/generic/legacy/bus/bushndlr.c +++ b/reactos/hal/halx86/generic/legacy/bus/bushndlr.c @@ -36,7 +36,7 @@ HalpAllocateArray(IN ULONG ArraySize) /* Allocate the array */ Array = ExAllocatePoolWithTag(NonPagedPool, Size, - 'BusH'); + TAG_BUS_HANDLER); if (!Array) KeBugCheckEx(HAL_MEMORY_ALLOCATION, Size, 0, (ULONG_PTR)__FILE__, __LINE__); /* Initialize it */ @@ -263,7 +263,7 @@ HaliRegisterBusHandler(IN INTERFACE_TYPE InterfaceType, /* Allocate the bus handler */ Bus = ExAllocatePoolWithTag(NonPagedPool, sizeof(HAL_BUS_HANDLER) + ExtraData, - 'HsuB'); + TAG_BUS_HANDLER); if (!Bus) return STATUS_INSUFFICIENT_RESOURCES; /* Return the handler */ @@ -404,11 +404,11 @@ HaliRegisterBusHandler(IN INTERFACE_TYPE InterfaceType, //MmUnlockPagableImageSection(CodeHandle); /* Free all allocations */ - if (Bus) ExFreePool(Bus); - if (InterfaceArray) ExFreePool(InterfaceArray); - if (InterfaceBusNumberArray) ExFreePool(InterfaceBusNumberArray); - if (ConfigArray) ExFreePool(ConfigArray); - if (ConfigBusNumberArray) ExFreePool(ConfigBusNumberArray); + if (Bus) ExFreePoolWithTag(Bus, TAG_BUS_HANDLER); + if (InterfaceArray) ExFreePoolWithTag(InterfaceArray, TAG_BUS_HANDLER); + if (InterfaceBusNumberArray) ExFreePoolWithTag(InterfaceBusNumberArray, TAG_BUS_HANDLER); + if (ConfigArray) ExFreePoolWithTag(ConfigArray, TAG_BUS_HANDLER); + if (ConfigBusNumberArray) ExFreePoolWithTag(ConfigBusNumberArray, TAG_BUS_HANDLER); /* And we're done */ return Status; diff --git a/reactos/hal/halx86/generic/legacy/bus/pcibus.c b/reactos/hal/halx86/generic/legacy/bus/pcibus.c index ddb05cacf43..a2485ac328b 100644 --- a/reactos/hal/halx86/generic/legacy/bus/pcibus.c +++ b/reactos/hal/halx86/generic/legacy/bus/pcibus.c @@ -572,7 +572,7 @@ HalpGetISAFixedPCIIrq(IN PBUS_HANDLER BusHandler, if (PciData.VendorID == PCI_INVALID_VENDORID) return STATUS_UNSUCCESSFUL; /* Allocate the supported range structure */ - *Range = ExAllocatePoolWithTag(PagedPool, sizeof(SUPPORTED_RANGE), 'Hal '); + *Range = ExAllocatePoolWithTag(PagedPool, sizeof(SUPPORTED_RANGE), TAG_HAL); if (!*Range) return STATUS_INSUFFICIENT_RESOURCES; /* Set it up */ @@ -766,7 +766,7 @@ HalpAssignPCISlotResources(IN PBUS_HANDLER BusHandler, PagedPool, sizeof(CM_RESOURCE_LIST) + (ResourceCount - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), - ' laH'); + TAG_HAL); if (NULL == *AllocatedResources) return STATUS_NO_MEMORY; @@ -1015,7 +1015,7 @@ HalpQueryPciRegistryInfo(VOID) sizeof(PCI_REGISTRY_INFO_INTERNAL) + (KeyInformation.Values * sizeof(PCI_CARD_DESCRIPTOR)), - ' laH'); + TAG_HAL); if (PciRegistryInfo) { /* Get the first card descriptor entry */ @@ -1069,7 +1069,7 @@ HalpQueryPciRegistryInfo(VOID) /* Just allocate the basic structure then */ PciRegistryInfo = ExAllocatePoolWithTag(NonPagedPool, sizeof(PCI_REGISTRY_INFO_INTERNAL), - ' laH'); + TAG_HAL); if (!PciRegistryInfo) return NULL; } @@ -1119,7 +1119,7 @@ HalpInitializePciStubs(VOID) MaxPciBusNumber = PciRegistryInfo->NoBuses - 1; /* Free the info structure */ - ExFreePool(PciRegistryInfo); + ExFreePoolWithTag(PciRegistryInfo, TAG_HAL); } /* Initialize the PCI lock */ diff --git a/reactos/hal/halx86/generic/legacy/bussupp.c b/reactos/hal/halx86/generic/legacy/bussupp.c index 013b8564d79..76aca8c098a 100644 --- a/reactos/hal/halx86/generic/legacy/bussupp.c +++ b/reactos/hal/halx86/generic/legacy/bussupp.c @@ -1096,7 +1096,7 @@ HalpInitializePciBus(VOID) HalpGetNMICrashFlag(); /* Free the registry data */ - ExFreePool(PciRegistryInfo); + ExFreePoolWithTag(PciRegistryInfo, TAG_HAL); /* Tell PnP if this hard supports correct decoding */ HalpMarkChipsetDecode(ExtendedAddressDecoding); @@ -1256,7 +1256,7 @@ HaliTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, Handler = HalReferenceHandlerForBus(InterfaceType, BusNumber); if (!(Handler) || !(Handler->TranslateBusAddress)) { - DPRINT1("No translator!\n"); + DPRINT1("No translator Interface: %x, Bus: %x, Handler: %x!\n", InterfaceType, BusNumber, Handler); return FALSE; } diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index 33aaa83b763..701c374620b 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -45,6 +45,9 @@ #include "internal/i386/intrin_i.h" #endif +#define TAG_HAL ' laH' +#define TAG_BUS_HANDLER 'BusH' + /* Internal HAL Headers */ #include "apic.h" #include "bus.h"