https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf74f101c258665268a42…
commit bf74f101c258665268a428e9a788bc8e68c17b3c
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Nov 25 00:32:28 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Nov 25 00:41:53 2019 +0100
[VIDEOPRT] Use ExFreePoolWithTag() + Add some ASSERTs.
---
win32ss/drivers/videoprt/agp.c | 10 +++++-----
win32ss/drivers/videoprt/event.c | 4 +++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/win32ss/drivers/videoprt/agp.c b/win32ss/drivers/videoprt/agp.c
index e149a201375..2ad191e088b 100644
--- a/win32ss/drivers/videoprt/agp.c
+++ b/win32ss/drivers/videoprt/agp.c
@@ -176,7 +176,7 @@ IntAgpReleasePhysical(
}
/* Free resources */
- ExFreePool(AgpMapping);
+ ExFreePoolWithTag(AgpMapping, TAG_VIDEO_PORT);
}
PHYSICAL_ADDRESS NTAPI
@@ -230,7 +230,7 @@ IntAgpReservePhysical(
&AgpMapping->PhysicalAddress);
if (!NT_SUCCESS(Status) || AgpMapping->MapHandle == NULL)
{
- ExFreePool(AgpMapping);
+ ExFreePoolWithTag(AgpMapping, TAG_VIDEO_PORT);
WARN_(VIDEOPRT, "Warning: AgpBusInterface->ReserveMemory failed (Status =
0x%x)\n",
Status);
return ZeroAddress;
@@ -412,7 +412,7 @@ IntAgpReleaseVirtual(
}
/* Free resources */
- ExFreePool(VirtualMapping);
+ ExFreePoolWithTag(VirtualMapping, TAG_VIDEO_PORT);
}
PVOID NTAPI
@@ -447,7 +447,7 @@ IntAgpReserveVirtual(
if (ProcessHandle == NULL)
{
/* FIXME: What to do in this case? */
- ExFreePool(VirtualMapping);
+ ExFreePoolWithTag(VirtualMapping, TAG_VIDEO_PORT);
return NULL;
}
else /* ProcessHandle != NULL */
@@ -459,7 +459,7 @@ IntAgpReserveVirtual(
MEM_RESERVE, PAGE_NOACCESS);
if (!NT_SUCCESS(Status))
{
- ExFreePool(VirtualMapping);
+ ExFreePoolWithTag(VirtualMapping, TAG_VIDEO_PORT);
WARN_(VIDEOPRT, "ZwAllocateVirtualMemory() failed: Status = 0x%x\n",
Status);
return NULL;
}
diff --git a/win32ss/drivers/videoprt/event.c b/win32ss/drivers/videoprt/event.c
index 16153397f8a..77f48817676 100644
--- a/win32ss/drivers/videoprt/event.c
+++ b/win32ss/drivers/videoprt/event.c
@@ -78,7 +78,7 @@ VideoPortDeleteEvent(
if (!Event->pKEvent) return ERROR_INVALID_PARAMETER;
/* Free storage */
- ExFreePool(Event);
+ ExFreePoolWithTag(Event, TAG_VIDEO_PORT);
/* Indicate success */
return NO_ERROR;
@@ -93,6 +93,7 @@ VideoPortSetEvent(
_In_ PVOID HwDeviceExtension,
_In_ PEVENT Event)
{
+ ASSERT(Event);
return KeSetEvent(Event->pKEvent, IO_NO_INCREMENT, FALSE);
}
@@ -105,6 +106,7 @@ VideoPortClearEvent(
_In_ PVOID HwDeviceExtension,
_In_ PEVENT Event)
{
+ ASSERT(Event);
KeClearEvent(Event->pKEvent);
}