Commit graph

958 commits

Author SHA1 Message Date
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