mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 00:54:18 +00:00
[NTOSKRNL]
- ExFreePool --> ExFreePoolWithTag in some places. - Remove dead code (section.c) - Free resource (sysldr.c) svn path=/trunk/; revision=57412
This commit is contained in:
parent
23d6a39557
commit
24a14abf27
11 changed files with 47 additions and 42 deletions
2
reactos/ntoskrnl/cache/section/data.c
vendored
2
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -555,7 +555,7 @@ MmCreateCacheSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
{
|
{
|
||||||
KeReleaseSpinLock(&FileObject->IrpListLock, OldIrql);
|
KeReleaseSpinLock(&FileObject->IrpListLock, OldIrql);
|
||||||
DPRINTC("Free Segment %x\n", Segment);
|
DPRINTC("Free Segment %x\n", Segment);
|
||||||
ExFreePool(Segment);
|
ExFreePoolWithTag(Segment, TAG_MM_SECTION_SEGMENT);
|
||||||
|
|
||||||
DPRINT("Filling out Segment info (previous data section)\n");
|
DPRINT("Filling out Segment info (previous data section)\n");
|
||||||
|
|
||||||
|
|
|
@ -1347,7 +1347,7 @@ NtLockFile(IN HANDLE FileHandle,
|
||||||
{
|
{
|
||||||
/* Allocating failed, clean up and return the exception code */
|
/* Allocating failed, clean up and return the exception code */
|
||||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||||
if (LocalLength) ExFreePool(LocalLength);
|
if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
|
||||||
|
|
||||||
/* Return the exception code */
|
/* Return the exception code */
|
||||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
|
@ -1450,7 +1450,7 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
/* Free buffer and return the exception code */
|
/* Free buffer and return the exception code */
|
||||||
if (AuxBuffer) ExFreePool(AuxBuffer);
|
if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
|
||||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
@ -1466,7 +1466,7 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
if (AuxBuffer) ExFreePool(AuxBuffer);
|
if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1539,7 +1539,7 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
||||||
{
|
{
|
||||||
/* Allocating failed, clean up and return the exception code */
|
/* Allocating failed, clean up and return the exception code */
|
||||||
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
IopCleanupAfterException(FileObject, Irp, Event, NULL);
|
||||||
if (AuxBuffer) ExFreePool(AuxBuffer);
|
if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
|
||||||
|
|
||||||
/* Return the exception code */
|
/* Return the exception code */
|
||||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
|
@ -1863,7 +1863,7 @@ NtQueryInformationFile(IN HANDLE FileHandle,
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
/* Free the event */
|
/* Free the event */
|
||||||
ExFreePool(Event);
|
ExFreePoolWithTag(Event, TAG_IO);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2465,7 +2465,7 @@ NtSetInformationFile(IN HANDLE FileHandle,
|
||||||
* Someone else set the completion port in the
|
* Someone else set the completion port in the
|
||||||
* meanwhile, so dereference the port and fail.
|
* meanwhile, so dereference the port and fail.
|
||||||
*/
|
*/
|
||||||
ExFreePool(Context);
|
ExFreePoolWithTag(Context, IOC_TAG);
|
||||||
ObDereferenceObject(Queue);
|
ObDereferenceObject(Queue);
|
||||||
Status = STATUS_INVALID_PARAMETER;
|
Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -2524,7 +2524,7 @@ NtSetInformationFile(IN HANDLE FileHandle,
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
/* Free the event */
|
/* Free the event */
|
||||||
ExFreePool(Event);
|
ExFreePoolWithTag(Event, TAG_IO);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2555,7 +2555,7 @@ NtSetInformationFile(IN HANDLE FileHandle,
|
||||||
{
|
{
|
||||||
/* Clear it in the IRP for completion */
|
/* Clear it in the IRP for completion */
|
||||||
Irp->UserEvent = NULL;
|
Irp->UserEvent = NULL;
|
||||||
ExFreePool(Event);
|
ExFreePoolWithTag(Event, TAG_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the caller IOSB */
|
/* Set the caller IOSB */
|
||||||
|
@ -2733,7 +2733,7 @@ NtUnlockFile(IN HANDLE FileHandle,
|
||||||
{
|
{
|
||||||
/* Allocating failed, clean up and return the exception code */
|
/* Allocating failed, clean up and return the exception code */
|
||||||
IopCleanupAfterException(FileObject, Irp, NULL, Event);
|
IopCleanupAfterException(FileObject, Irp, NULL, Event);
|
||||||
if (LocalLength) ExFreePool(LocalLength);
|
if (LocalLength) ExFreePoolWithTag(LocalLength, TAG_LOCK);
|
||||||
|
|
||||||
/* Return the exception code */
|
/* Return the exception code */
|
||||||
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
|
|
|
@ -103,7 +103,7 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
|
||||||
if (FirstRun)
|
if (FirstRun)
|
||||||
{
|
{
|
||||||
/* We failed early so just free this */
|
/* We failed early so just free this */
|
||||||
ExFreePool(IoInterrupt);
|
ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the I/O Interrupt */
|
/* Free the I/O Interrupt */
|
||||||
ExFreePool(IoInterrupt);
|
ExFreePool(IoInterrupt); // ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -200,7 +200,7 @@ Cleanup:
|
||||||
//
|
//
|
||||||
// Free the table if we failed and return status
|
// Free the table if we failed and return status
|
||||||
//
|
//
|
||||||
if (DriverThunks) ExFreePool(DriverThunks);
|
if (DriverThunks) ExFreePoolWithTag(DriverThunks, 'tVmM');
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ ExpComputeHashForTag(IN ULONG Tag,
|
||||||
// Finally, AND with the bucket mask to generate a valid index/bucket into
|
// Finally, AND with the bucket mask to generate a valid index/bucket into
|
||||||
// the table
|
// the table
|
||||||
//
|
//
|
||||||
ULONGLONG Result = 40543 * Tag;
|
ULONGLONG Result = (ULONGLONG)40543 * Tag;
|
||||||
return (ULONG)BucketMask & ((ULONG)Result ^ (Result >> 32));
|
return (ULONG)BucketMask & ((ULONG)Result ^ (Result >> 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,7 +1185,7 @@ ExGetPoolTagInfo(IN PSYSTEM_POOLTAG_INFORMATION SystemInformation,
|
||||||
//
|
//
|
||||||
// Free the "Generic DPC" temporary buffer, return the buffer length and status
|
// Free the "Generic DPC" temporary buffer, return the buffer length and status
|
||||||
//
|
//
|
||||||
ExFreePool(Buffer);
|
ExFreePoolWithTag(Buffer, 'ofnI');
|
||||||
if (ReturnLength) *ReturnLength = CurrentLength;
|
if (ReturnLength) *ReturnLength = CurrentLength;
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1172,7 +1172,7 @@ MmFreeLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
KeFlushCurrentTb();
|
KeFlushCurrentTb();
|
||||||
|
|
||||||
/* Free our run structure */
|
/* Free our run structure */
|
||||||
ExFreePool(Buffer);
|
ExFreePoolWithTag(Buffer, 'lMmM');
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -663,7 +663,7 @@ MiResolveTransitionFault(IN PVOID FaultingAddress,
|
||||||
ASSERT(Pfn1->u3.e1.ReadInProgress == 0);
|
ASSERT(Pfn1->u3.e1.ReadInProgress == 0);
|
||||||
|
|
||||||
/* Windows checks there's some free pages and this isn't an in-page error */
|
/* 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);
|
ASSERT(Pfn1->u4.InPageError == 0);
|
||||||
|
|
||||||
/* ReactOS checks for this */
|
/* ReactOS checks for this */
|
||||||
|
|
|
@ -118,7 +118,11 @@ MiCreatePebOrTeb(IN PEPROCESS Process,
|
||||||
Base,
|
Base,
|
||||||
&Parent);
|
&Parent);
|
||||||
/* Bail out, if still nothing free was found */
|
/* 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 */
|
/* Validate that it came from the VAD ranges */
|
||||||
|
@ -1857,6 +1861,7 @@ MiSessionCreateInternal(OUT PULONG SessionId)
|
||||||
{
|
{
|
||||||
/* We ran out of session IDs, we should expand */
|
/* We ran out of session IDs, we should expand */
|
||||||
DPRINT1("Too many sessions created. Expansion not yet supported\n");
|
DPRINT1("Too many sessions created. Expansion not yet supported\n");
|
||||||
|
ExFreePoolWithTag(PageTables, 'tHmM');
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2181,7 +2181,11 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
LdrEntry->FullDllName.MaximumLength +
|
LdrEntry->FullDllName.MaximumLength +
|
||||||
sizeof(UNICODE_NULL),
|
sizeof(UNICODE_NULL),
|
||||||
TAG_LDR_WSTR);
|
TAG_LDR_WSTR);
|
||||||
if (!NewEntry->FullDllName.Buffer) return FALSE;
|
if (!NewEntry->FullDllName.Buffer)
|
||||||
|
{
|
||||||
|
ExFreePoolWithTag(NewEntry, TAG_MODULE_OBJECT);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the base name */
|
/* Set the base name */
|
||||||
NewEntry->BaseDllName.Buffer = (PVOID)(NewEntry + 1);
|
NewEntry->BaseDllName.Buffer = (PVOID)(NewEntry + 1);
|
||||||
|
@ -3436,3 +3440,4 @@ MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
|
||||||
return ProcAddress;
|
return ProcAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1099,7 +1099,7 @@ MiDoPoolCopy(IN PEPROCESS SourceProcess,
|
||||||
//
|
//
|
||||||
// Check if we had allocated pool
|
// Check if we had allocated pool
|
||||||
//
|
//
|
||||||
if (HavePoolAddress) ExFreePool(PoolAddress);
|
if (HavePoolAddress) ExFreePoolWithTag(PoolAddress, 'VmRw');
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check if we failed during the probe
|
// Check if we failed during the probe
|
||||||
|
@ -1160,7 +1160,7 @@ MiDoPoolCopy(IN PEPROCESS SourceProcess,
|
||||||
//
|
//
|
||||||
// Check if we had allocated pool
|
// Check if we had allocated pool
|
||||||
//
|
//
|
||||||
if (HavePoolAddress) ExFreePool(PoolAddress);
|
if (HavePoolAddress) ExFreePoolWithTag(PoolAddress, 'VmRw');
|
||||||
|
|
||||||
//
|
//
|
||||||
// All bytes read
|
// All bytes read
|
||||||
|
|
|
@ -1763,15 +1763,10 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace,
|
||||||
1);
|
1);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("MmCreateVirtualMapping failed, not out of memory\n");
|
DPRINT1("MmCreateVirtualMapping failed, unable to create virtual mapping, not out of memory\n");
|
||||||
KeBugCheck(MEMORY_MANAGEMENT);
|
KeBugCheck(MEMORY_MANAGEMENT);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT1("Unable to create virtual mapping\n");
|
|
||||||
KeBugCheck(MEMORY_MANAGEMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unshare the old page.
|
* Unshare the old page.
|
||||||
|
@ -3786,7 +3781,7 @@ MmCreateImageSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
if(ImageSectionObject->Segments != NULL)
|
if(ImageSectionObject->Segments != NULL)
|
||||||
ExFreePool(ImageSectionObject->Segments);
|
ExFreePool(ImageSectionObject->Segments);
|
||||||
|
|
||||||
ExFreePool(ImageSectionObject);
|
ExFreePoolWithTag(ImageSectionObject, TAG_MM_SECTION_SEGMENT);
|
||||||
ObDereferenceObject(Section);
|
ObDereferenceObject(Section);
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
return(StatusExeFmt);
|
return(StatusExeFmt);
|
||||||
|
|
Loading…
Reference in a new issue