Author: hbelusca
Date: Fri Sep 28 12:17:23 2012
New Revision: 57412
URL:
http://svn.reactos.org/svn/reactos?rev=57412&view=rev
Log:
[NTOSKRNL]
- ExFreePool --> ExFreePoolWithTag in some places.
- Remove dead code (section.c)
- Free resource (sysldr.c)
Modified:
trunk/reactos/ntoskrnl/cache/section/data.c
trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
trunk/reactos/ntoskrnl/io/iomgr/irq.c
trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
trunk/reactos/ntoskrnl/mm/ARM3/expool.c
trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/cache/section/data.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/dat…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -555,7 +555,7 @@
{
KeReleaseSpinLock(&FileObject->IrpListLock, OldIrql);
DPRINTC("Free Segment %x\n", Segment);
- ExFreePool(Segment);
+ ExFreePoolWithTag(Segment, TAG_MM_SECTION_SEGMENT);
DPRINT("Filling out Segment info (previous data section)\n");
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -1347,7 +1347,7 @@
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, Event, NULL);
- if (LocalLength) ExFreePool(LocalLength);
+ if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
@@ -1450,7 +1450,7 @@
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
/* Free buffer and return the exception code */
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -1466,7 +1466,7 @@
if (!NT_SUCCESS(Status))
{
/* Fail */
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
return Status;
}
@@ -1539,7 +1539,7 @@
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, Event, NULL);
- if (AuxBuffer) ExFreePool(AuxBuffer);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
@@ -1863,7 +1863,7 @@
_SEH2_END;
/* Free the event */
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
else
{
@@ -2465,7 +2465,7 @@
* Someone else set the completion port in the
* meanwhile, so dereference the port and fail.
*/
- ExFreePool(Context);
+ ExFreePoolWithTag(Context, IOC_TAG);
ObDereferenceObject(Queue);
Status = STATUS_INVALID_PARAMETER;
}
@@ -2524,7 +2524,7 @@
_SEH2_END;
/* Free the event */
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
else
{
@@ -2555,7 +2555,7 @@
{
/* Clear it in the IRP for completion */
Irp->UserEvent = NULL;
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_IO);
}
/* Set the caller IOSB */
@@ -2722,7 +2722,7 @@
/* Allocate a buffer */
LocalLength = ExAllocatePoolWithTag(NonPagedPool,
sizeof(LARGE_INTEGER),
- TAG_LOCK);
+ TAG_LOCK);
/* Set the length */
*LocalLength = CapturedLength;
@@ -2733,7 +2733,7 @@
{
/* Allocating failed, clean up and return the exception code */
IopCleanupAfterException(FileObject, Irp, NULL, Event);
- if (LocalLength) ExFreePool(LocalLength);
+ if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
/* Return the exception code */
_SEH2_YIELD(return _SEH2_GetExceptionCode());
Modified: trunk/reactos/ntoskrnl/io/iomgr/irq.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irq.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irq.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irq.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -103,7 +103,7 @@
if (FirstRun)
{
/* We failed early so just free this */
- ExFreePool(IoInterrupt);
+ ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
}
else
{
@@ -163,7 +163,7 @@
}
/* Free the I/O Interrupt */
- ExFreePool(IoInterrupt);
+ ExFreePool(IoInterrupt); // ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
}
/* EOF */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -200,7 +200,7 @@
//
// Free the table if we failed and return status
//
- if (DriverThunks) ExFreePool(DriverThunks);
+ if (DriverThunks) ExFreePoolWithTag(DriverThunks, 'tVmM');
return Status;
}
Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -358,7 +358,7 @@
// Finally, AND with the bucket mask to generate a valid index/bucket into
// the table
//
- ULONGLONG Result = 40543 * Tag;
+ ULONGLONG Result = (ULONGLONG)40543 * Tag;
return (ULONG)BucketMask & ((ULONG)Result ^ (Result >> 32));
}
@@ -1185,7 +1185,7 @@
//
// Free the "Generic DPC" temporary buffer, return the buffer length and
status
//
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, 'ofnI');
if (ReturnLength) *ReturnLength = CurrentLength;
return Status;
}
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -1172,7 +1172,7 @@
KeFlushCurrentTb();
/* Free our run structure */
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, 'lMmM');
}
VOID
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -663,7 +663,7 @@
ASSERT(Pfn1->u3.e1.ReadInProgress == 0);
/* Windows checks there's some free pages and this isn't an in-page error */
- ASSERT(MmAvailablePages >= 0);
+ ASSERT(MmAvailablePages > 0);
ASSERT(Pfn1->u4.InPageError == 0);
/* ReactOS checks for this */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -118,7 +118,11 @@
Base,
&Parent);
/* Bail out, if still nothing free was found */
- if (Result == TableFoundNode) return STATUS_NO_MEMORY;
+ if (Result == TableFoundNode)
+ {
+ ExFreePoolWithTag(Vad, 'ldaV');
+ return STATUS_NO_MEMORY;
+ }
}
/* Validate that it came from the VAD ranges */
@@ -1857,6 +1861,7 @@
{
/* We ran out of session IDs, we should expand */
DPRINT1("Too many sessions created. Expansion not yet supported\n");
+ ExFreePoolWithTag(PageTables, 'tHmM');
return STATUS_NO_MEMORY;
}
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -1,11 +1,11 @@
/*
-* PROJECT: ReactOS Kernel
-* LICENSE: BSD - See COPYING.ARM in the top level directory
-* FILE: ntoskrnl/mm/ARM3/sysldr.c
-* PURPOSE: Contains the Kernel Loader (SYSLDR) for loading PE files.
-* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
-* ReactOS Portable Systems Group
-*/
+ * PROJECT: ReactOS Kernel
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
+ * FILE: ntoskrnl/mm/ARM3/sysldr.c
+ * PURPOSE: Contains the Kernel Loader (SYSLDR) for loading PE files.
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ * ReactOS Portable Systems Group
+ */
/* INCLUDES *******************************************************************/
@@ -2179,9 +2179,13 @@
NewEntry->FullDllName.Buffer =
ExAllocatePoolWithTag(PagedPool,
LdrEntry->FullDllName.MaximumLength +
- sizeof(UNICODE_NULL),
+ sizeof(UNICODE_NULL),
TAG_LDR_WSTR);
- if (!NewEntry->FullDllName.Buffer) return FALSE;
+ if (!NewEntry->FullDllName.Buffer)
+ {
+ ExFreePoolWithTag(NewEntry, TAG_MODULE_OBJECT);
+ return FALSE;
+ }
/* Set the base name */
NewEntry->BaseDllName.Buffer = (PVOID)(NewEntry + 1);
@@ -3436,3 +3440,4 @@
return ProcAddress;
}
+/* EOF */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -1099,7 +1099,7 @@
//
// Check if we had allocated pool
//
- if (HavePoolAddress) ExFreePool(PoolAddress);
+ if (HavePoolAddress) ExFreePoolWithTag(PoolAddress, 'VmRw');
//
// Check if we failed during the probe
@@ -1160,7 +1160,7 @@
//
// Check if we had allocated pool
//
- if (HavePoolAddress) ExFreePool(PoolAddress);
+ if (HavePoolAddress) ExFreePoolWithTag(PoolAddress, 'VmRw');
//
// All bytes read
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Fri Sep 28 12:17:23 2012
@@ -1761,17 +1761,12 @@
Region->Protect,
&NewPage,
1);
- if (!NT_SUCCESS(Status))
- {
- DPRINT("MmCreateVirtualMapping failed, not out of memory\n");
- KeBugCheck(MEMORY_MANAGEMENT);
- return(Status);
- }
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Unable to create virtual mapping\n");
- KeBugCheck(MEMORY_MANAGEMENT);
- }
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("MmCreateVirtualMapping failed, unable to create virtual mapping,
not out of memory\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
+ return(Status);
+ }
/*
* Unshare the old page.
@@ -3786,7 +3781,7 @@
if(ImageSectionObject->Segments != NULL)
ExFreePool(ImageSectionObject->Segments);
- ExFreePool(ImageSectionObject);
+ ExFreePoolWithTag(ImageSectionObject, TAG_MM_SECTION_SEGMENT);
ObDereferenceObject(Section);
ObDereferenceObject(FileObject);
return(StatusExeFmt);