Commit graph

1147 commits

Author SHA1 Message Date
Jérôme Gardou 8404d1a6ff [NTOS:MM] Allow MiMapPageInHyperSpace to be called from DISPATCH_LEVEL
Also annotate it to show its behaviour.
2021-04-07 23:09:26 +02:00
Oleg Dubinskiy 52f4d8019b [NTOS:MM][NTOS:SE] Mute some noisy stubs
Mute debug prints of MmDoesFileHaveUserWritableReferences and SeAuditingFileEventsWithContext stubs.
These stubs are very noisy and create a lot of spam in the log when using Microsoft NTFS driver in ReactOS (with some other improvements applied).
Implementing those functions isn't badly required for the proper work of this driver, so better way for now is just mute these stubs a bit.
After my changes, they will be displayed only once, and the log will be more clear, so it will seem to be enough to understand that the driver calls these routines.
CORE-17409
2021-04-07 13:16:03 +02:00
Jérôme Gardou 0d3825862f [NTOS:KE] Rewrite KiSystemCallTrampoline in assembly
Instead of making assumptions about what the compiler does with forced-inline functions
2021-04-06 17:57:18 +02:00
Eric Kohl d8c38c4b4c [NTOS:PNP] PiSetDevNodeText: Do not overwrite existing DeviceDesc values
CORE-17513
2021-04-05 14:33:48 +02:00
Mark Jansen 5e928e5c92
[NTOS:MM] Stubplement cookie generation for drivers 2021-04-03 18:08:53 +02:00
Eric Kohl c449929fef [NTOS:EX] Use RtlCutoverTimeToSystemTime to determine the current time zone id
CORE-14658
2021-04-03 09:38:07 +02:00
Jérôme Gardou 998870c5ea [NTOS:MM] Properly fail for invalid sizes of data section mappings 2021-03-30 22:20:15 +02:00
Jérôme Gardou 4c731adc04 [NTOS:MM] Fix compilation when PFN tracing is enabled 2021-03-30 17:22:09 +02:00
Jérôme Gardou 80f8beeeee [NTOS/MM] Remove an outdated check 2021-03-30 17:13:19 +02:00
Jérôme Gardou 0187c1e113 [NTOS:MM] Fix PFN tracing 2021-03-30 16:26:43 +02:00
George Bișoc eba68ffb9c [NTOS:SE] Specify the code section of SepCreateSystemProcessToken as INIT
This function is used during the Security kernel module phase initialisation to set up the system process token which the phase initialisation procedure in itself is stored in the INIT section. With that being said, do the same for SepCreateSystemProcessToken too and add a header documentation as an addition.
2021-03-25 02:30:46 +03:00
George Bișoc 5b5b814af8 [NTOS:SE] Create the anonymous logon tokens on Security initialisation phase 2021-03-25 02:30:46 +03:00
George Bișoc fe0f9d8646 [NTOS:SE] Implement SepCreateSystemAnonymousLogonToken and SepCreateSystemAnonymousLogonTokenNoEveryone functions
These private functions are needed to set up two different kinds of system's anonymous logon tokens: one that includes everyone in the group and the other that doesn't. These functions are needed as next step closer to the
implementation of NtImpersonateAnonymousToken system call.
2021-03-25 02:30:46 +03:00
George Bișoc b28530d4ac [NTOS:SE] Set up an ACL and SD for the anonymous logon 2021-03-25 02:30:46 +03:00
Jérôme Gardou 6e4f83da70 [NTOS:CC] Wake up lazy scan after inserting elements in the list. 2021-03-24 15:28:04 +01:00
Jérôme Gardou edd4a985d9 [NTOS:CC] Be verbose about why we defer writes 2021-03-24 15:27:36 +01:00
Jérôme Gardou 5c54fb9179 [NTOS:CC] Rewrite CcPostDeferredWrites
This allows to post small writes if there are any, and avoid holding the list lock for a long time.
2021-03-24 11:22:28 +01:00
Jérôme Gardou b13a696513 [NTOS:KE] Explicitly cast -1 to ULONG 2021-03-24 11:13:04 +01:00
Jérôme Gardou 94d175b7f2 [NTOS] Remove a definition which is redundant with ndk 2021-03-24 11:12:12 +01:00
Jérôme Gardou 187ca32175 [NTOS:KE] Use PNT_TIB as argument in KeSetTebBase 2021-03-24 11:09:20 +01:00
Jérôme Gardou 173cdcae8f [CMAKE] Use the "kernel" module type for ntoskrnl and ntkrnlmp 2021-03-23 11:18:43 +01:00
Jérôme Gardou d1d1260f5f [NTOS:MM] Fix integer arithmetics 2021-03-22 10:02:12 +01:00
Victor Perevertkin 0fed07b7e4
[NTOS:PNP] Initialize DeviceDesc and LocationInformation registry fields
for manually reported devices, as it is required by the newdev.dll
for installing drivers from INF files

CORE-17212 CORE-17398

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2021-03-19 07:57:41 +03:00
Victor Perevertkin aec3d9cc8f
[NTOS:IO][NTOS:PNP] Fix incorrect usage of IopGetRegistryValue
KEY_VALUE_FULL_INFORMATION was not always freed properly
2021-03-19 01:07:22 +03:00
Jérôme Gardou 42094071ee [NTOS:MM] Silence noisy DPRINTs 2021-03-18 12:24:21 +01:00
Jérôme Gardou 4ff5d39edb [NTOS:MM] Use a define for the big pool table occupation rate 2021-03-18 12:24:21 +01:00
Jérôme Gardou 8494688eeb [NTOS:MM] Do not use atomic operations to set a bit while holding a lock.
Saving your fingers from typing it doesn't make it better code.
2021-03-18 12:24:21 +01:00
Jérôme Gardou f06b58925d [NTOS:MM] Implement shrinking big pool allocation table
Shrink when using 1/8 of its allocated capacity (thus use 25% of it at the end of the process)
Expand when using 3/4 of its allocated capacity (thus use ~40% of it at the end of the process)
2021-03-18 12:24:21 +01:00
Jérôme Gardou 54354712e2 [NTOS:MM] Fail allocating non-paged pool when running out of available pages 2021-03-18 12:24:21 +01:00
Jérôme Gardou 34630a06ca [NTOS:MM] Do not bugcheck when we are freeing a big allocation for which we didn't manage to insert the tag 2021-03-18 12:24:21 +01:00
Jérôme Gardou d5fa0788d8 [NTOS:MM] Silence a DPRINT which became noisy 2021-03-16 13:23:21 +01:00
Victor Perevertkin 59a5dba443
[NTOS:PNP] Implement PlugPlayControlStartDevice control class
This control class is triggered when a driver is being installed for a
non-critical device. The driver info should already be in the registry
so we just need to push the device through the state graph

Meanwhile, combine the code for similar control classes into
PiControlSyncDeviceAction routine

CORE-17463 CORE-17490
2021-03-16 03:17:57 +03:00
Victor Perevertkin 029accdcf7
[NDK] Change the data structure for PlugPlayControlResetDevice control class
PlugPlayControlResetDevice shares the input structure with several other
control classes.
Source: ProcessHacker sources e9c8121f41/ntpnpapi.h
2021-03-16 03:17:42 +03:00
Serge Gautherie e0400e7810 [NTOS:KE] KiIdleLoop(): Propagate DECLSPEC_NORETURN to callers 2021-03-05 00:43:15 +03:00
Serge Gautherie 5f1d79f0c5 [NTOS:KE] KiIdleLoop(): Add DECLSPEC_NORETURN, Remove FASTCALL 2021-03-05 00:43:15 +03:00
George Bișoc 44b8e5caac [NTOS:SE] Complete the SepCompareTokens implementation
* Implement SepCompareSidAndAttributesFromTokens and SepComparePrivilegeAndAttributesFromTokens functions for array elements comparison
* Implement the token comparison code in SepCompareTokens function
* Add a missing PAGED_CODE() in SepCompareTokens as most of the token comparison code is paged
* Use SAL annotations for SepCompareTokens and NtCompareTokens
2021-03-04 16:22:56 +03:00
George Bișoc a340ec1767
[NTOS:PS] Guard the quota in a spin lock (#3419)
Prior to acquiring a quota from the process and do whatever it's needed to do (charge it or return it back), we must guard ourselves with a spinlock so that we may not get into potential race conditions. In Windows Server 2003, PspGivebackQuota and PspExpandQuota do the same thing and they're the equivalent to PspReturnProcessQuotaSpecifiedPool and PspChargeProcessQuotaSpecifiedPool in our codebase.
2021-03-04 04:43:30 +03:00
Serge Gautherie 7851ad8635 [NTOS:KD] KdpDebugLogInit(): Close the thread handle
Addendum to 07dc415 (r43331).
2021-03-03 09:01:37 +01:00
Serge Gautherie 802ad6d3ee [NTOS:KD] KdpLoggerThread(): Assert being in kernel mode
to be explicit that using Nt*() is safe.

Follow-up to 9537653.
2021-03-03 09:01:37 +01:00
George Bișoc 6170b574f0
[NTOS:PS] Implement PS_QUOTA_TYPE and let the quota code use it (#3389)
This will replace the PoolIndex variable and as such we'll only be using the PS_QUOTA_TYPE enumeration, as Windows does. Both QuotaEntry, QuotaUsage and QuotaPeak depend explicitly or implicitly on this enumeration. Further details about this enum can be found in the following articles.
https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ps/psquota/type.htm?tx=68,143
https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ps/psquota/block.htm?tx=68,142,143
https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/ps/eprocess/index.htm (see QuotaPeak and QuotaUsage)
2021-03-02 20:09:58 +01:00
Jérôme Gardou 4e4c47cccc [NTOS:KE] Generate proper frame info for trap handler in GCC builds
CORE-8531
2021-03-02 14:37:39 +01:00
Jérôme Gardou 7caf9e9d48 [NTOS:KD] Use Zw* syscall variants
The log file can be (re-)initialized when previous mode is User-Mode,
thus the calls fail on probing input parameters
2021-02-26 08:46:53 +01:00
Jérôme Gardou a93e065ebc [NTOS:MM] Do not chunk-read file when we are the modified-page-writer thread 2021-02-26 08:46:53 +01:00
Jérôme Gardou 35c091adaf [NTOS:MM] Do not chunk-read files marked with FO_RANDOM_ACCESS 2021-02-26 08:46:53 +01:00
Eric Kohl 9ff015f770 [NTOS:CM] Report key creation to the notify code 2021-02-21 15:49:06 +01:00
Jérôme Gardou 2a962eaf8c [NTOS:CC] Keep a reference on the shared cache map of the file when we are in lazy write
This should fix "Leaking VACB" debug prints
2021-02-19 15:48:31 +01:00
Jérôme Gardou d18634c026 [NTOS:WMI] Be consistent about potential NULL pointer use 2021-02-18 10:24:53 +01:00
Serge Gautherie 17a9041da1 [NTOS:WMI] IoWMIWriteEvent(): Add WNODE_FLAG_TRACED_GUID case
Addendum to d5f8964 (r23040).
CORE-17384
2021-02-17 18:59:09 +01:00
Serge Gautherie 495e22e0d5 [NTOS:WMI] IoWMIWriteEvent(): Fix annotation, Extend DPRINT1()
CORE-17384
2021-02-17 18:59:09 +01:00
Timo Kreuzer 4b4bff0642 [NTOS:MM] Handle demand zero PTEs with MM_EXECUTE_READWRITE and MM_READWRITE 2021-02-16 18:02:57 +01:00
Hervé Poussineau 58332b076c [NTOS:KD] Merge initialization phases 1 and 2, and fix log file debugging
Phase 2 and 3 were not done anymore since 777a2d94da.

Fix that, by merging phases 1 and 2, and by calling phase 3 later
for log file debugging, when ExpInitializationPhase = 3

CORE-17470
2021-02-16 00:12:25 +01:00
Jérôme Gardou 0573de22a0 [NTOS:MM] Do not assert on a case we actually support 2021-02-10 17:48:30 +01:00
Jérôme Gardou 73fd52a164 [NTOS:MM] Flush dirty pages after closing the page files.
CORE-17462
2021-02-10 11:14:19 +01:00
Timo Kreuzer ca74467904
[NTOS:CC] Raise status, when CcMapData fails (#3348)
Also add a check in fastfat, that asserts, when CcMapData returns FALSE.
2021-02-09 09:29:48 +01:00
George Bișoc dd4c113594
[NTOS:SE] Do not use a global lock for tokens (#3445)
In Windows Server 2003 the lock is initialised on a per-token basis, that is, the lock resource is created in SepDuplicateToken() and SepCreateToken() functions. This ensures that the lock initialisation is done locally for the specific token thus avoiding the need of a global lock.
2021-02-05 12:10:19 +03:00
Victor Perevertkin b705df731e
[NTOS:MM][FASTFAT_NEW] Fix DBG usage, fixes Release build 2021-02-05 11:54:10 +03:00
Jérôme Gardou 6f2b94c023 [NTOS:MM] Wake up the balancer as soon as we are low on page.
Fixes installing on a system with 64MB of RAM, if you feel like it.
2021-02-03 13:42:39 +01:00
Jérôme Gardou cc9607e94e [NTOS:CC] Fix use of uninitialized variable 2021-02-03 13:35:17 +01:00
Jérôme Gardou 0699dcb50c [NTOS:EX] Restore sysinfo 2021-02-03 10:29:28 +01:00
Jérôme Gardou 14077e3f4e [NTOS:MM] Simplify a check 2021-02-03 09:41:24 +01:00
Jérôme Gardou b7eb0fddf3 Address PR review 2021-02-03 09:41:24 +01:00
Jérôme Gardou c0bf352069 [NTOS:MM] Fix regression of MmCanFileBeTruncated 2021-02-03 09:41:24 +01:00
Jérôme Gardou 7f7abc9838 [NTOS:MM] Simplify code & fix MSVC x64 build 2021-02-03 09:41:23 +01:00
Jérôme Gardou 2ba1926037 [NTOS:MM][NTOS:CC] Performance improvement again
Read files by 64kb chunks instead of page-sized chunks.
2021-02-03 09:41:23 +01:00
Jérôme Gardou 625f273361 [NTOS:MM] More fine-tuning of the memory balancer 2021-02-03 09:41:23 +01:00
Jérôme Gardou 41475dfcd7 [NTOS:CC] Performance improvements
Do not ditch the pages as soon as the section are unmapped
Improve MmBalancer "algorithm" (or whatever you call that)
Various needed fixes to get this going.
2021-02-03 09:41:23 +01:00
Jérôme Gardou 7fbf90d6fd [NTOS:CC] Fix a bug 2021-02-03 09:41:23 +01:00
Jérôme Gardou ea354c4bc7 [NTOS:MM] Unconditionally purge cache on image section creation. 2021-02-03 09:41:23 +01:00
Jérôme Gardou c1c51e31e4 [NTOS:MM] Keep a ref on the segment when mapping a page & keep trace of what is the highest offset mapped. 2021-02-03 09:41:23 +01:00
Jérôme Gardou 91a4e62376 [NTOS:MM] Improve MmCanFileBeTruncated 2021-02-03 09:41:23 +01:00
Jérôme Gardou 3e43aa1305 [NTOS:MM] Use 64-bit integer to count references on segments 2021-02-03 09:41:23 +01:00
Jérôme Gardou cc6bc02b91 [NTOS:CC] Make sure to purge the Mm side in CcPurgeCacheSection 2021-02-03 09:41:23 +01:00
Jérôme Gardou d0bf98663b [NTOS:CC] Be sure to flush the whole file in CcFlushCache 2021-02-03 09:41:23 +01:00
Jérôme Gardou 90c6a65efe [NTOS:MM] Introduce MmPurgeSegment & MmFlushSegment
Those will back CcFlushCache and CcPurgeCache.
2021-02-03 09:41:23 +01:00
Jérôme Gardou 8a8b4db447 [NTOS:MM] Make the page LRU list a real LRU list.
Also, implement flushing mapped sections to disk on shutdown.
2021-02-03 09:41:23 +01:00
Jérôme Gardou bde2ee571a [NTOS:FSRTL] Properly leave FsRtl when returning STATUS_CANT_WAIT 2021-02-03 09:41:23 +01:00
Jérôme Gardou 3efc5b1734 [NTOS:MM] Fix unlocking on failure path 2021-02-03 09:41:23 +01:00
Jérôme Gardou d23dbdda4c [NTOS:MM] Remove unused field 2021-02-03 09:41:23 +01:00
Jérôme Gardou f201b8af78 [NTOS:MM] Do not acquire Pfn lock in MmGetRmapListHead
All callers already hold it
2021-02-03 09:41:23 +01:00
Jérôme Gardou 727e73f253 |NTOS:MM] Simplify some code 2021-02-03 09:41:23 +01:00
Jérôme Gardou 48e1c8593f [NTOS:PO] Flush dirty pages after flushing volumes 2021-02-03 09:41:23 +01:00
Jérôme Gardou 5949d5095d [NTOS:CC][NTOS:MM] Try respecting ValidDataLength 2021-02-03 09:41:23 +01:00
Jérôme Gardou bdb73edab7 [NTOS:CC] Flush the whole VACB
Let Mm know what it has to do.
2021-02-03 09:41:23 +01:00
Jérôme Gardou 804f5a41ed [NTOS:CC] Improve trace messages 2021-02-03 09:41:23 +01:00
Jérôme Gardou 20fe42c9e9 [NTOS:CC] Simplify CcFlushCache implementation 2021-02-03 09:41:23 +01:00
Jérôme Gardou 9b6240ee03 [NTOS:CC] Get rid of ROS_VACB:Valid 2021-02-03 09:41:23 +01:00
Jérôme Gardou e46f1a9af3 [NTOS:MM] Disable APC while performing Paged Read 2021-02-03 09:41:23 +01:00
Jérôme Gardou 02167f2fb3 [NTOS:CC] Properly return the public BCBs 2021-02-03 09:41:23 +01:00
Jérôme Gardou 33cde28312 [NTOS:CC] Simplify CcRosDeleteFileCache 2021-02-03 09:41:23 +01:00
Jérôme Gardou a9193b5cc2 [NTOS:CC] Remove dead code 2021-02-03 09:41:23 +01:00
Jérôme Gardou 8ed15a49a7 [NTOS:MM] Fix a race 2021-02-03 09:41:23 +01:00
Jérôme Gardou 11eee4eeec [NTOS:MM] Check that we don't add rmap for NULL process 2021-02-03 09:41:23 +01:00
Jérôme Gardou caf89b9582 [NTOS:MM] Fix a race condition when unmapping sections views 2021-02-03 09:41:23 +01:00
Jérôme Gardou 57ee31ee33 [NTOS:CC] Perform sanity checks before doing anything else 2021-02-03 09:41:23 +01:00
Jérôme Gardou cff3c399c6 [NTOS:MM] Fix input validation/correction in MmMapViewInSystemSpace 2021-02-03 09:41:23 +01:00
Jérôme Gardou 8287a098b9 [NTOS:CC] Fix potnetial use-after-free 2021-02-03 09:41:23 +01:00
Jérôme Gardou 358d06c47c [NTOS:CC] Always honor WriteThrough parameter in CcUnpinRepinnedBcb 2021-02-03 09:41:23 +01:00
Jérôme Gardou 1505abbc09 [NTOS:CC] Do not write behind concurrently the same file 2021-02-03 09:41:23 +01:00
Jérôme Gardou 347a4f146b [NTOS] Loop again and again until the whole cache is empty when sutting down 2021-02-03 09:41:23 +01:00
Jérôme Gardou addf824d87 [NTOS:MM] Keep image maps & file maps coherent at the time of creating the image map 2021-02-03 09:41:23 +01:00
Jérôme Gardou 543112008a Fix physical memory section creation 2021-02-03 09:41:22 +01:00
Jérôme Gardou 91f6fa0259 Disable CcScheduleReadAhead call 2021-02-03 09:41:22 +01:00
Jérôme Gardou 6d97d8d2e1 [NTOS:CC] Fix some tests, complain where the current implementation won't let us do the right thing 2021-02-03 09:41:22 +01:00
Jérôme Gardou 674ab3dce3 [NTOS:MM] Remove a check for now 2021-02-03 09:41:22 +01:00
Jérôme Gardou 1f796267bc [NTOS:MM] Do not reference the section when mapping it.
Referencing the segment is enough.
2021-02-03 09:41:22 +01:00
Jérôme Gardou 3c2b1bf59b [NTOS:MM] Save the dirty bit when sharing a segment page 2021-02-03 09:41:22 +01:00
Jérôme Gardou 3141668724 [NTOS:MM] Various fixes.
Fix MmFlushImageSection behaviour
Remove an invalid ASSERT
2021-02-03 09:41:22 +01:00
Jérôme Gardou 30f71c7fc0 [NTOS] Zero data unconditionally after segment end, unless section is created with SEC_RESERVE
Use a SEC_RESERVE section in Cc
2021-02-03 09:41:22 +01:00
Jérôme Gardou a52bc6d179 [NTOS:CC] Restore read-ahead behaviour in CcCopyRead 2021-02-03 09:41:22 +01:00
Jérôme Gardou 4441b1cd44 [NTOS:CC] Fix some tests for CcCopyRead and CcCopyWrite
Most importantly: raise the right status when provided an invalid buffer.
2021-02-03 09:41:22 +01:00
Jérôme Gardou aab24ed1b1 [NTOS:MM] Have the legacy Mm be less greedy about the number of pages it wants 2021-02-03 09:41:22 +01:00
Jérôme Gardou fb07802956 [NTOS:MM] Make the situation about dirty pages in image map a bit clearer 2021-02-03 09:41:22 +01:00
Jérôme Gardou cd23d6e19a [NTOS:CC] Honor FO_WRITE_THROUGH flag in CcCopyWrite and fix it in CcZeroData 2021-02-03 09:41:22 +01:00
Jérôme Gardou f8aa14ce4e [NTOS:CC] Acquire file for flush when flushing if necessary 2021-02-03 09:41:22 +01:00
Jérôme Gardou d9f7459bb1 [NTOS:MM] Fix file object bad referencing 2021-02-03 09:41:22 +01:00
Jérôme Gardou 2d3454a809 [NTOS:IO] VFAT sucks less now 2021-02-03 09:41:22 +01:00
Jérôme Gardou cbfc04157d [NTOS:CC] File size check fix 2021-02-03 09:41:22 +01:00
Jérôme Gardou e39fc52d25 [NTOS/MM] Set FSRTL_MOD_WRITE_TOP_LEVEL_IRP top-level IRP when paging-out 2021-02-03 09:41:22 +01:00
Jérôme Gardou f114209782 [NTOS/MM] Do not zero out the tail of the segment if the mapping is not an image 2021-02-03 09:41:22 +01:00
Jérôme Gardou 7d70af61e8 [NTOS:MM] Acquire file lock when creating section 2021-02-03 09:41:22 +01:00
Jérôme Gardou d2fa434cb7 [NTOSKRNL] Address issues raised in PR 3361 review 2021-02-03 09:41:22 +01:00
Jérôme Gardou 70c62aa2c9 [NTOS:CC] Fix Vacb size usage & check 2021-02-03 09:41:22 +01:00
Jérôme Gardou c74cbf0c0b [NTOS/CC] Be more precise when notifying Mm about dirty pages 2021-02-03 09:41:22 +01:00
Jérôme Gardou c295d6b229 [NTOS:CC] Fix releasing VACB when an exception is raised in CcZeroData & CcCopyWrite 2021-02-03 09:41:22 +01:00
Jérôme Gardou 7f47f03296 [NTOS:CC] Rewrite the non-cached path of CcZeroData 2021-02-03 09:41:22 +01:00
Jérôme Gardou 36e18aab35 [NTOS:CC] Remove unused functions 2021-02-03 09:41:22 +01:00
Jérôme Gardou 7dab3583cc [NTOS/MM] Force flushing when the page is dirtified in user mode 2021-02-03 09:41:22 +01:00
Jérôme Gardou 91edefa11e [NTOS:MM] Do not limit ourselves in reading or writing the file 2021-02-03 09:41:22 +01:00
Jérôme Gardou 774a4c703f [NTOS/MM] Misc fixes
Purge data section object before creating an image mapping
Zero-out the tail of the page after reading from file
Properly map page as read-only when paging-in a COW memory map.
2021-02-03 09:41:22 +01:00
Jérôme Gardou 0933337404 [NTOS/MM] Do not dirtify section pages for system-space maps
Cc does it for itself.
2021-02-03 09:41:22 +01:00
Jérôme Gardou d440434a8e [NTOS/MM] Do not error when FS returns STATUS_END_OF_FILE for paged read.
Also remove a seemingly invalid ASSERT
2021-02-03 09:41:22 +01:00
Jérôme Gardou b46173edaf [NTOS/MM] DO not assert when being passed invalid parameters in MmCreateSection 2021-02-03 09:41:22 +01:00
Jérôme Gardou ba49c39041 [NTOS/MM] Assert there are no RMAP left before freeing the page 2021-02-03 09:41:22 +01:00
Jérôme Gardou d932bdb950 [NTOS:MM] Fix locking when paging out 2021-02-03 09:41:22 +01:00
Jérôme Gardou d8cdb89fb0 [NTOSKRNL] Overhaul Cc and Mm relationship
Previously, when creating a file section, Mm requested Cc to cache the file, then Cc would request pages from Mm, then Mm would request them back to serve its file-mapping role
Now, Mm does it all by itself. If file cahcing is requested by the FS driver, then Cc creates a file mapping and uses that to serve its purpose.

This is a rewrite of Cc
2021-02-03 09:41:22 +01:00
Jérôme Gardou e4047d1521 [NTOS/MM] Introduce MmArePagesResident and MmMakePagesResident 2021-02-03 09:41:22 +01:00
Jérôme Gardou f1631b44e1 [NTOS/MM] Introduce MmMapViewInSystemSpaceEx 2021-02-03 09:41:22 +01:00
Jérôme Gardou 4f6fd6c42b [NTOS/MM] Infer that the Memory Area is an image mapping from its VAD node 2021-02-03 09:41:21 +01:00
Jérôme Gardou c3bd70cfd1 [NTOSKRNL/MM] Fix a few wine tests 2021-02-03 09:41:21 +01:00
Jérôme Gardou 4abda863ce [NTOSKRNL/MM] Reduce use of MiIsRosSectionObject 2021-02-03 09:41:21 +01:00
Jérôme Gardou b7d988ae5b [NTOSKRNL] Get rid of MM_ROS_SECTION_OBJECT 2021-02-03 09:41:21 +01:00
Jérôme Gardou 8b98ff66ea [NTOSKRNL] Store File Object in the segment instead of Section object 2021-02-03 09:41:21 +01:00
Jérôme Gardou e980efebd4 [NTOSKRNL] Store the MM_IMAGE_SECTION_OBJECT pointer in SECTION::Segment 2021-02-03 09:41:21 +01:00
Jérôme Gardou c6a87f28bf [NTOSKRNL] Get rid of MEMORY_AREA::Protect
Use the VAD node instead
2021-02-03 09:41:21 +01:00
Jérôme Gardou c9f924940a [NTOSKRNL/MM] Get rid of useless members of MEMORY_AREA struct 2021-02-03 09:41:21 +01:00
Jérôme Gardou defbf63416 [NTOSKRNL] Use PSECTION struct where possible 2021-02-03 09:41:21 +01:00
Jérôme Gardou 462d9a0974 [NTOSKRNL] Unload the cargo: We only use tiny bits of "NEWCC" 2021-02-03 09:41:21 +01:00
Jérôme Gardou 25722e647e [NTOSKRNL] Embed a SECTION struct inside MM_ROS_SECTION_OBJECT 2021-02-03 09:41:21 +01:00
Jérôme Gardou c3ec5d801c [NTOSKRNL] Disable more unused code 2021-02-03 09:41:21 +01:00
Jérôme Gardou 10ac04ff6e [NTOSKRNL] Get rid of ROS_SECTION_OBJECT::AllocationAttributes in favor of MM_SECTION_FLAGS 2021-02-03 09:41:21 +01:00