[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 VOID
NTAPI NTAPI
MiDeleteVirtualAddresses( MiDeleteVirtualAddresses(
IN ULONG_PTR Va, _In_ ULONG_PTR Va,
IN ULONG_PTR EndingAddress, _In_ ULONG_PTR EndingAddress,
IN PMMVAD Vad _In_opt_ PMMVAD Vad
); );
VOID VOID

View file

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