[NTOS:MM] Implement MmAllocate/FreeMappingAddress (#7260)

Implement MmAllocateMappingAddress and MmFreeMappingAddress routines.
Based on mm-implement-mappingaddress.patch by Thomas Faber with some changes from me.
Required by Microsoft NTFS driver (from Windows Server 2003 SP2 only, the one from Windows XP SP3 does not need them) and by NDIS & TDI drivers (both from Windows XP SP3 and Windows Server 2003 SP2). Also they are called when using Dr. Web Security Space 8 filter drivers together with MS FltMgr & TDI.
Fortunately, this part (these two routines) are enough to get the drivers working in both cases, and others (partially incomplete) routines are not badly required, so they can be finished and committed later.
CORE-10147, CORE-14635, CORE-17409, CORE-19318
This commit is contained in:
Oleg Dubinskiy 2024-11-02 15:10:51 +01:00 committed by GitHub
parent abbc784010
commit 83d74e7433
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 131 additions and 13 deletions

View file

@ -633,7 +633,7 @@ MmAdvanceMdl(
_Must_inspect_result_
_IRQL_requires_max_(APC_LEVEL)
_When_ (return != NULL, _Out_writes_bytes_opt_ (NumberOfBytes))
_Ret_maybenull_
NTKERNELAPI
PVOID
NTAPI
@ -646,7 +646,7 @@ NTKERNELAPI
VOID
NTAPI
MmFreeMappingAddress(
_In_ PVOID BaseAddress,
_In_ __drv_freesMem(Mem) _Post_invalid_ PVOID BaseAddress,
_In_ ULONG PoolTag);
_IRQL_requires_max_ (APC_LEVEL)