[NTOS:MM] Add ASSERTS to MmLockAddressSpace to guarantee lock ordering
[NTOS:MM/PS] Remove code duplication between LookupEntryPoint/MiLocateExportName/MiFindExportedRoutineByName. (#4918) As it turns out, those three functions were duplicating the same code between each other. Reimplement these in terms of a common helper, RtlFindExportedRoutineByName(). Indeed: MiFindExportedRoutineByName() was just MiLocateExportName() but taking a PANSI_STRING instead of a NULL-terminated string. A similar state of affairs also existed in Windows <= 2003, and the MS guys also noticed it. Both routines have been then merged and renamed to MiFindExportedRoutineByName() on Windows 8 (taking a PCSTR instead), and finally renamed and exported as RtlFindExportedRoutineByName() on Windows 10.
[NTOS:MM] Reformat MmCallDllInitialize and MiCallDllUnloadAndUnloadDll.
[NTOS:Mm] Implement MmCreatePhysicalMapping and MmDeletePhysicalMapping to handle pyhsical memory sections
[NTOS:MM] Use FORCEINLINE instead of simple inline inline implies an implementation must exist in another compilation unit
[NTOS] Add some sanity checks when synchronizing PDEs
[NTOS:MM] Implement PeakCommitment (MmPeakCommitment, MmTotalCommittedPages) (#4650) And return the corresponding values in SystemPerformanceInformation. Lockless updating counters suggestion by Thomas Faber.
[NTOS:MM] Add the pool quota prototypes and some definitions Declare the MmRaisePoolQuota and MmReturnPoolQuota prototypes in the header and add some definitions related to pool quotas, namely MmTotalNonPagedPoolQuota and MmTotalPagedPoolQuota. These variables are used internally by the kernel as sort of "containers" (for the lack of a better term) which uphold the amount of quotas that the Process Manager is requesting the Memory Manager to raise or return the pool quota limit. In addition to that, add some definitions needed for both of these functions. The definitions, MI_CHARGE_PAGED_POOL_QUOTA and MI_CHARGE_NON_PAGED_POOL_QUOTA respectively, bear some interesting aspect. Seemingly the 0x80000 and 0x10000 values (that would denote to 524288 and 65536 specifically) are used as quota "limits" or in other words, thresholds that the kernel uses. So for example if one would want to raise the quota limit charge, MmRaisePoolQuota will raise it so based on this formula -- NewMaxQuota = CurrentQuota + LIMIT_VALUE. LIMIT_VALUE can be either MI_CHARGE_PAGED_POOL_QUOTA or MI_CHARGE_NON_PAGED_POOL_QUOTA, depending a per quota pool basis. What's more interesting is that these values are pervasive in Process Manager even. This is when quotas are to be returned back and trim the limit of the quota block if needed, the kernel would either take the amount provided by the caller of quotas to return or the threshold (paged or not paged) if the amount to return exceeds the said threshold in question.
[NTOS] Fix broken SAL annotations on MmDereferenceSegmentWithLock.
[NTOS:MM] Annotate some functions with regards to MmPfnLock Also fix MI_ASSERT_PFN_LOCK_HELD macro. Now in debug builds, SpinLocks are always non-zero when held.
[NTOS:MM] Implement MmFlushImageSection(MmFlushForDelete) CORE-17544
[NTOS:MM] Save caller address when tracing PFNs
[NTOS:MM] MmFlushSegment(): Fix Iosb annotation Addendum to 90c6a65.
[NTOS:MM/x64] Fix Interlocked(Compare)ExchangePte and PAGE_FROM_SSE for x64 This fixes using PFNs with more than 20 bits.
[NTOS:MM] Remove some dead code from legacy Mm
Revert "[NTOS:MM] Add private pages to process working sets" This is so full of bugs, I don't know what to say. This reverts commit 374fef2d59f39b714ff3152f1590f6af843c8bf5.
[NTOS:MM] Add private pages to process working sets
[NTOS] Introduce KiQueuedSpinLockGuard, similar to std::lock_guard for Queued Spin lock And use it in Mm as MiPfnLockGuard
[REACTOS] Addendum to 5c7ce4475e246560d1622b8cc60dc603e3955f66 - Fix MSVC 2015 build Put data into PAGEDATA or INITDATA sections Keep section declaration for prototypes CORE-17540
[NTOS:MM] First shot for Working Set list support - Initialize - Add private page (no shared page support yet) - Remove pages - Trim Yes, this is C++ in the kernel.