[NTOS:MM] Improve MiDeleteVirtualAddresses

- Fix parameter annotations
- Add an ASSERT
This commit is contained in:
Timo Kreuzer 2024-04-06 19:40:31 +03:00
parent 8851d86847
commit a8f4a76c7b
2 changed files with 9 additions and 8 deletions

View file

@ -2330,9 +2330,9 @@ MiMakeProtectionMask(
VOID
NTAPI
MiDeleteVirtualAddresses(
IN ULONG_PTR Va,
IN ULONG_PTR EndingAddress,
IN PMMVAD Vad
_In_ ULONG_PTR Va,
_In_ ULONG_PTR EndingAddress,
_In_opt_ PMMVAD Vad
);
VOID

View file

@ -527,9 +527,10 @@ MiDeletePte(IN PMMPTE PointerPte,
VOID
NTAPI
MiDeleteVirtualAddresses(IN ULONG_PTR Va,
IN ULONG_PTR EndingAddress,
IN PMMVAD Vad)
MiDeleteVirtualAddresses(
_In_ ULONG_PTR Va,
_In_ ULONG_PTR EndingAddress,
_In_opt_ PMMVAD Vad)
{
PMMPTE PointerPte, PrototypePte, LastPrototypePte;
PMMPDE PointerPde;
@ -545,8 +546,8 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
BOOLEAN AddressGap = FALSE;
PSUBSECTION Subsection;
/* Get out if this is a fake VAD, RosMm will free the marea pages */
if ((Vad) && MI_IS_MEMORY_AREA_VAD(Vad)) return;
/* We should never get RosMm memory areas here */
ASSERT((Vad == NULL) || !MI_IS_MEMORY_AREA_VAD(Vad));
/* Get the current process */
CurrentProcess = PsGetCurrentProcess();