Author: tfaber
Date: Fri Mar 27 18:03:39 2015
New Revision: 66922
URL:
http://svn.reactos.org/svn/reactos?rev=66922&view=rev
Log:
[CDFS][MSFS][PCI]
- Use sensible pool tags
Modified:
trunk/reactos/drivers/bus/pci/fdo.c
trunk/reactos/drivers/bus/pci/pdo.c
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/close.c
trunk/reactos/drivers/filesystems/cdfs/create.c
trunk/reactos/drivers/filesystems/cdfs/dirctl.c
trunk/reactos/drivers/filesystems/cdfs/fcb.c
trunk/reactos/drivers/filesystems/cdfs/fsctl.c
trunk/reactos/drivers/filesystems/cdfs/misc.c
trunk/reactos/drivers/filesystems/cdfs/rw.c
trunk/reactos/drivers/filesystems/msfs/create.c
trunk/reactos/drivers/filesystems/msfs/rw.c
Modified: trunk/reactos/drivers/bus/pci/fdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/fdo.c?rev=…
==============================================================================
--- trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -154,7 +154,7 @@
Status = FdoLocateChildDevice(&Device, DeviceExtension, SlotNumber,
&PciConfig);
if (!NT_SUCCESS(Status))
{
- Device = (PPCI_DEVICE)ExAllocatePoolWithTag(NonPagedPool,
sizeof(PCI_DEVICE),TAG_PCI);
+ Device = ExAllocatePoolWithTag(NonPagedPool, sizeof(PCI_DEVICE),
TAG_PCI);
if (!Device)
{
/* FIXME: Cleanup resources for already discovered devices */
@@ -232,11 +232,12 @@
{
/* FIXME: Another bus driver has already created a DEVICE_RELATIONS
structure so we must merge this structure with our own */
+ DPRINT1("FIXME: leaking old bus relations\n");
}
Size = sizeof(DEVICE_RELATIONS) +
sizeof(Relations->Objects) * (DeviceExtension->DeviceListCount - 1);
- Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size);
+ Relations = ExAllocatePoolWithTag(PagedPool, Size, TAG_PCI);
if (!Relations)
return STATUS_INSUFFICIENT_RESOURCES;
@@ -369,7 +370,7 @@
RtlFreeUnicodeString(&PdoDeviceExtension->DeviceLocation);
}
- ExFreePool(Relations);
+ ExFreePoolWithTag(Relations, TAG_PCI);
return ErrorStatus;
}
Modified: trunk/reactos/drivers/bus/pci/pdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/pdo.c?rev=…
==============================================================================
--- trunk/reactos/drivers/bus/pci/pdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/pci/pdo.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -150,7 +150,7 @@
DPRINT("Called\n");
DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
- BusInformation = ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION));
+ BusInformation = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION),
TAG_PCI);
Irp->IoStatus.Information = (ULONG_PTR)BusInformation;
if (BusInformation != NULL)
{
@@ -1475,7 +1475,7 @@
return Irp->IoStatus.Status;
/* We can do this because we only return 1 PDO for TargetDeviceRelation */
- DeviceRelations = ExAllocatePool(PagedPool, sizeof(*DeviceRelations));
+ DeviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(*DeviceRelations),
TAG_PCI);
if (!DeviceRelations)
return STATUS_INSUFFICIENT_RESOURCES;
@@ -1621,7 +1621,7 @@
KeReleaseSpinLock(&FdoDeviceExtension->DeviceListLock, OldIrql);
/* Free the device */
- ExFreePool(DeviceExtension->PciDevice);
+ ExFreePoolWithTag(DeviceExtension->PciDevice, TAG_PCI);
/* Complete the IRP */
Irp->IoStatus.Status = STATUS_SUCCESS;
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -231,8 +231,12 @@
ULONG LastOffset;
} CCB, *PCCB;
-#define TAG_CCB 'BCCI'
-#define TAG_FCB 'BCFI'
+#define CDFS_TAG 'sfdC'
+#define CDFS_CCB_TAG 'ccdC'
+#define CDFS_NONPAGED_FCB_TAG 'nfdC'
+#define CDFS_SHORT_NAME_TAG 'sgdC'
+#define CDFS_SEARCH_PATTERN_TAG 'eedC'
+#define CDFS_FILENAME_TAG 'nFdC'
typedef struct
{
Modified: trunk/reactos/drivers/filesystems/cdfs/close.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -67,9 +67,9 @@
if (Ccb->DirectorySearchPattern.Buffer)
{
- ExFreePoolWithTag(Ccb->DirectorySearchPattern.Buffer, TAG_CCB);
+ ExFreePoolWithTag(Ccb->DirectorySearchPattern.Buffer,
CDFS_SEARCH_PATTERN_TAG);
}
- ExFreePoolWithTag(Ccb, TAG_CCB);
+ ExFreePoolWithTag(Ccb, CDFS_CCB_TAG);
return(STATUS_SUCCESS);
}
Modified: trunk/reactos/drivers/filesystems/cdfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -62,8 +62,7 @@
sizeof(WCHAR);
AbsoluteFileName->Length = 0;
AbsoluteFileName->MaximumLength = Length;
- AbsoluteFileName->Buffer = ExAllocatePool(NonPagedPool,
- Length);
+ AbsoluteFileName->Buffer = ExAllocatePoolWithTag(NonPagedPool, Length,
CDFS_FILENAME_TAG);
if (AbsoluteFileName->Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -180,7 +179,7 @@
FileObject);
if ((FileName == &AbsFileName) && AbsFileName.Buffer)
- ExFreePool(AbsFileName.Buffer);
+ ExFreePoolWithTag(AbsFileName.Buffer, CDFS_FILENAME_TAG);
return Status;
}
Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -610,7 +610,7 @@
{
First = TRUE;
Ccb->DirectorySearchPattern.Buffer =
- ExAllocatePoolWithTag(NonPagedPool, SearchPattern->Length +
sizeof(WCHAR), TAG_CCB);
+ ExAllocatePoolWithTag(NonPagedPool, SearchPattern->Length +
sizeof(WCHAR), CDFS_SEARCH_PATTERN_TAG);
if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -623,7 +623,7 @@
else if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
First = TRUE;
- Ccb->DirectorySearchPattern.Buffer = ExAllocatePoolWithTag(NonPagedPool, 2 *
sizeof(WCHAR), TAG_CCB);
+ Ccb->DirectorySearchPattern.Buffer = ExAllocatePoolWithTag(NonPagedPool, 2 *
sizeof(WCHAR), CDFS_SEARCH_PATTERN_TAG);
if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -69,7 +69,9 @@
{
PFCB Fcb;
- Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(FCB), TAG_FCB);
+ Fcb = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(FCB),
+ CDFS_NONPAGED_FCB_TAG);
if(!Fcb) return NULL;
RtlZeroMemory(Fcb, sizeof(FCB));
@@ -112,11 +114,11 @@
{
Entry = Fcb->ShortNameList.Flink;
RemoveEntryList(Entry);
- ExFreePoolWithTag(Entry, TAG_FCB);
+ ExFreePoolWithTag(Entry, CDFS_SHORT_NAME_TAG);
}
ExDeleteResourceLite(&Fcb->NameListResource);
- ExFreePoolWithTag(Fcb, TAG_FCB);
+ ExFreePoolWithTag(Fcb, CDFS_NONPAGED_FCB_TAG);
}
@@ -237,7 +239,7 @@
FileObject = IoCreateStreamFileObject(NULL, Vcb->StorageDevice);
- newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), TAG_CCB);
+ newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), CDFS_CCB_TAG);
if (newCCB == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -266,7 +268,7 @@
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
FileObject->FsContext2 = NULL;
- ExFreePoolWithTag(newCCB, TAG_CCB);
+ ExFreePoolWithTag(newCCB, CDFS_CCB_TAG);
ObDereferenceObject(FileObject);
Fcb->FileObject = NULL;
return _SEH2_GetExceptionCode();
@@ -438,7 +440,7 @@
{
PCCB newCCB;
- newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), TAG_CCB);
+ newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), CDFS_CCB_TAG);
if (newCCB == NULL)
{
return(STATUS_INSUFFICIENT_RESOURCES);
@@ -467,7 +469,7 @@
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
FileObject->FsContext2 = NULL;
- ExFreePoolWithTag(newCCB, TAG_CCB);
+ ExFreePoolWithTag(newCCB, CDFS_CCB_TAG);
return _SEH2_GetExceptionCode();
}
_SEH2_END;
Modified: trunk/reactos/drivers/filesystems/cdfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -204,8 +204,7 @@
DPRINT("CdfsGetVolumeData\n");
- Buffer = ExAllocatePool(NonPagedPool,
- CDFS_BASIC_SECTOR);
+ Buffer = ExAllocatePoolWithTag(NonPagedPool, CDFS_BASIC_SECTOR, CDFS_TAG);
if (Buffer == NULL)
return STATUS_INSUFFICIENT_RESOURCES;
@@ -219,7 +218,7 @@
TRUE);
if (!NT_SUCCESS(Status))
{
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, CDFS_TAG);
return Status;
}
@@ -253,7 +252,7 @@
TRUE);
if (!NT_SUCCESS(Status))
{
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, CDFS_TAG);
return Status;
}
@@ -264,7 +263,7 @@
if (Buffer[0] != 1 || Buffer[1] != 'C' || Buffer[2] != 'D'
||
Buffer[3] != '0' || Buffer[4] != '0' || Buffer[5] !=
'1')
{
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, CDFS_TAG);
return STATUS_UNRECOGNIZED_VOLUME;
}
}
@@ -299,7 +298,7 @@
}
}
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, CDFS_TAG);
return(STATUS_SUCCESS);
}
@@ -383,9 +382,7 @@
goto ByeBye;
}
- Ccb = ExAllocatePoolWithTag(NonPagedPool,
- sizeof(CCB),
- TAG_CCB);
+ Ccb = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), CDFS_CCB_TAG);
if (Ccb == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -446,7 +443,7 @@
if (DeviceExt && DeviceExt->StreamFileObject)
ObDereferenceObject(DeviceExt->StreamFileObject);
if (Fcb)
- ExFreePool(Fcb);
+ ExFreePoolWithTag(Fcb, CDFS_NONPAGED_FCB_TAG);
if (NewDeviceObject)
IoDeleteDevice(NewDeviceObject);
}
Modified: trunk/reactos/drivers/filesystems/cdfs/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -205,7 +205,9 @@
}
/* We've scanned over all entries and now have a unique one. Cache it. */
- ShortNameEntry = ExAllocatePoolWithTag(PagedPool, sizeof(CDFS_SHORT_NAME), TAG_FCB);
+ ShortNameEntry = ExAllocatePoolWithTag(PagedPool,
+ sizeof(CDFS_SHORT_NAME),
+ CDFS_SHORT_NAME_TAG);
if (!ShortNameEntry)
{
/* We couldn't cache it, but we can return it. We run the risk of
Modified: trunk/reactos/drivers/filesystems/cdfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -134,7 +134,9 @@
BOOLEAN bFreeBuffer = FALSE;
if ((ReadOffset % BLOCKSIZE) != 0 || (ToRead % BLOCKSIZE) != 0)
{
- PageBuf = ExAllocatePool(NonPagedPool, nBlocks * BLOCKSIZE);
+ PageBuf = ExAllocatePoolWithTag(NonPagedPool,
+ nBlocks * BLOCKSIZE,
+ CDFS_TAG);
if (!PageBuf)
{
return STATUS_NO_MEMORY;
@@ -165,7 +167,7 @@
}
if(bFreeBuffer)
- ExFreePool(PageBuf);
+ ExFreePoolWithTag(PageBuf, CDFS_TAG);
}
return Status;
Modified: trunk/reactos/drivers/filesystems/msfs/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/msfs/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/msfs/create.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -39,7 +39,7 @@
DPRINT("Mailslot name: %wZ\n", &FileObject->FileName);
- Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB));
+ Ccb = ExAllocatePoolWithTag(NonPagedPool, sizeof(MSFS_CCB), 'cFsM');
if (Ccb == NULL)
{
Irp->IoStatus.Status = STATUS_NO_MEMORY;
@@ -65,7 +65,7 @@
if (current_entry == &DeviceExtension->FcbListHead)
{
- ExFreePool(Ccb);
+ ExFreePoolWithTag(Ccb, 'cFsM');
KeUnlockMutex(&DeviceExtension->FcbListLock);
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
@@ -125,7 +125,7 @@
DPRINT("Mailslot name: %wZ\n", &FileObject->FileName);
- Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB));
+ Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(MSFS_FCB), 'fFsM');
if (Fcb == NULL)
{
Irp->IoStatus.Status = STATUS_NO_MEMORY;
@@ -138,10 +138,12 @@
Fcb->Name.Length = FileObject->FileName.Length;
Fcb->Name.MaximumLength = Fcb->Name.Length + sizeof(UNICODE_NULL);
- Fcb->Name.Buffer = ExAllocatePool(NonPagedPool, Fcb->Name.MaximumLength);
+ Fcb->Name.Buffer = ExAllocatePoolWithTag(NonPagedPool,
+ Fcb->Name.MaximumLength,
+ 'NFsM');
if (Fcb->Name.Buffer == NULL)
{
- ExFreePool(Fcb);
+ ExFreePoolWithTag(Fcb, 'fFsM');
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
@@ -153,11 +155,11 @@
RtlCopyUnicodeString(&Fcb->Name, &FileObject->FileName);
- Ccb = ExAllocatePool(NonPagedPool, sizeof(MSFS_CCB));
+ Ccb = ExAllocatePoolWithTag(NonPagedPool, sizeof(MSFS_CCB), 'cFsM');
if (Ccb == NULL)
{
- ExFreePool(Fcb->Name.Buffer);
- ExFreePool(Fcb);
+ ExFreePoolWithTag(Fcb->Name.Buffer, 'NFsM');
+ ExFreePoolWithTag(Fcb, 'fFsM');
Irp->IoStatus.Status = STATUS_NO_MEMORY;
Irp->IoStatus.Information = 0;
@@ -197,9 +199,9 @@
if (current_entry != &DeviceExtension->FcbListHead)
{
- ExFreePool(Fcb->Name.Buffer);
- ExFreePool(Fcb);
- ExFreePool(Ccb);
+ ExFreePoolWithTag(Fcb->Name.Buffer, 'NFsM');
+ ExFreePoolWithTag(Fcb, 'fFsM');
+ ExFreePoolWithTag(Ccb, 'cFsM');
KeUnlockMutex(&DeviceExtension->FcbListLock);
@@ -288,7 +290,7 @@
MSFS_MESSAGE,
MessageListEntry);
RemoveEntryList(Fcb->MessageListHead.Flink);
- ExFreePool(Message);
+ ExFreePoolWithTag(Message, 'rFsM');
}
Fcb->MessageCount = 0;
@@ -300,15 +302,15 @@
KeAcquireSpinLock(&Fcb->CcbListLock, &oldIrql);
RemoveEntryList(&Ccb->CcbListEntry);
KeReleaseSpinLock(&Fcb->CcbListLock, oldIrql);
- ExFreePool(Ccb);
+ ExFreePoolWithTag(Ccb, 'cFsM');
FileObject->FsContext2 = NULL;
if (Fcb->ReferenceCount == 0)
{
DPRINT("ReferenceCount == 0: Deleting mailslot data\n");
RemoveEntryList(&Fcb->FcbListEntry);
- ExFreePool(Fcb->Name.Buffer);
- ExFreePool(Fcb);
+ ExFreePoolWithTag(Fcb->Name.Buffer, 'NFsM');
+ ExFreePoolWithTag(Fcb, 'fFsM');
}
KeUnlockMutex(&DeviceExtension->FcbListLock);
Modified: trunk/reactos/drivers/filesystems/msfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/msfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/msfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/msfs/rw.c [iso-8859-1] Fri Mar 27 18:03:39 2015
@@ -77,7 +77,7 @@
RemoveHeadList(&Fcb->MessageListHead);
KeReleaseSpinLock(&Fcb->MessageListLock, oldIrql);
- ExFreePool(Message);
+ ExFreePoolWithTag(Message, 'rFsM');
Fcb->MessageCount--;
if (Fcb->MessageCount == 0)
{
@@ -142,8 +142,9 @@
DPRINT("Length: %lu Message: %s\n", Length, (PUCHAR)Buffer);
/* Allocate new message */
- Message = ExAllocatePool(NonPagedPool,
- sizeof(MSFS_MESSAGE) + Length);
+ Message = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(MSFS_MESSAGE) + Length,
+ 'rFsM');
if (Message == NULL)
{
Irp->IoStatus.Status = STATUS_NO_MEMORY;