Part 1: Page Fault Path Fixes
[NTOS]: As an optimization, someone seems to have had changed the MiResolveDemandZeroFault prototype not to require a PTE, and to instead take a protection mask directly. While clever, this broke support for ARM3 sections, because the code was now assuming that the protection of the PTE for the input address should be used -- while in NT Sections we instead use what are called ProtoType PTEs. This was very annoying to debug, but since the cause has been fixed, I've reverted back to the old convention in which the PTE is passed-in, and this can be a different PTE than the PTE for the address, as it should be.
[NTOS]: Due to the reverting of the original path, another optimization, in which MiResolveDemandZeroFault was being called directly instead of going through MiDispatchFault and writing an invalid demand-zero PDE has also been removed. PDE faults are now going through the correct, expected path.
[NTOS]: MiResolveDemandZeroFault was always creating Kernel PTEs. It should create User PTEs when necessary.
[NTOS]: MiDeletePte was assuming any prototype PTE is a forked PTE. Forked PTEs only happen when the addresses in the PTE don't match, so check for that too.
Part 2: ARM3 Section Object Fixes
[NTOS]: Fix issue when trying to make both ROS_SECTION_OBJECTs and NT's SECTION co-exist. We relied on the *caller* knowing what kind of section this is, and that can't be a good idea. Now, when the caller requests an ARM3 section vs a ROS section, we use a marker to detect what kind of section this is for later APIs.
[NTOS]: For section VADs, we were storing the ReactOS MEMORY_AREA in the ControlArea... however, the mappings of one individual section object share a single control area, even though they have multiple MEMORY_AREAs (one for each mapping). As such, we overwrote the MEMORY_AREA continously, and at free-time, double or triple-freed the same memory area.
[NTOS]: Moved the MEMORY_AREA to the "Banked" field of the long VAD, instead of the ControlArea. Allocate MMVAD_LONGs for ARM3 sections for now, to support this. Also, after deleting the MEMORY_AREA while parsing VADs, we now use a special marker to detect double-frees, and we also use a special marker to make sure we have a Long VAD as expected.
svn path=/trunk/; revision=56035
- Give freeldr its own RtlAssert to avoid linking to the one in rtl. Makes it possible to use the DbgPrompt version (currently #if 0-ed) of RtlAssert in ntdll/ntos without breaking freeldr linking.
svn path=/trunk/; revision=56028
Fix my lock implementation to a degree.
- Have a single list associated with the CSQ.
- Remove some confusion from when the lock information was a
generic table.
- Make the compare function not be confused by attempts to
give strange offsets and lengths.
- Make the uninitialize function complete all lock requests
as specified.
- Remove my unneeded attempt to shoehorn in an eresource.
svn path=/trunk/; revision=56026
Fix paging out.
- We know we're in a wait entry in the section. What we really want to know
is if it's safe to evict this address space when withdrawing the mappings.
- We don't want to corrupt our wait entry in the section page table to keep
accumulating dirty state into the page out process until it's time to finally
evict.
svn path=/trunk/; revision=56024
- Add more items to taskbar popup menu. Patch by Edijs Kolesnikovičs <terminedijs at yahoo dot com>
See issue #6242 for more details.
svn path=/trunk/; revision=56017
- Fix a major bug in the failure path of IoCreateDevice that would cause corruption of kernel memory if IopCreateVpb failed
svn path=/trunk/; revision=56014
- Fix folder properties dialog. Patch by Edijs Kolesnikovičs <terminedijs at yahoo dot com>
See issue #6832 for more details.
svn path=/trunk/; revision=56013
- Improve shortcut properties dialog. Patch by Edijs Kolesnikovičs <terminedijs at yahoo dot com>
See issue #6848 for more details.
svn path=/trunk/; revision=56011
- Using a dead stack lookaside list for up to 5 dead kernel thread stacks. 1500% improvement when rapidly destroying/creating threads, such as during second stage setup and many winetests.
- Using a free pool page lookaside list for up to 12 free non-paged or paged pool pages. 800% improvement when allocating big pages from the pool, as well as during pool expansion.
- Using a bucketized per-processor and local list (in the KPRCB) for block sizes between 1 and 32 bytes. 1000% improvement when rapidly allocating/freeing small pool allocations, and 8x reduction in pool fragmentation.
svn path=/trunk/; revision=56000
- Fix a possible integer overflow in NtGdiCreateBitmap
- Don't cast length of LARGE_STRING (ULONG) to USHORT, instead truncate to MAXUSHORT. This is still hacky, but better than before.
- Fix MSVC warnings
svn path=/trunk/; revision=55993
- Fix bug while scanning endpoint descriptors
- Do not assume interface info has the correct number of pipes set
- Fix alternate interface handling
- Tested in VBox + USB Audio Device
svn path=/trunk/; revision=55992
[NTOS]: The fix above was due to fixing "EndingAddress" which was being initialized to zero too late (after writing to it!). This caused allocations with a fixed base address that were already on top of another allocation not to be seen as a conflict, then we tried inserting a VAD and received an ASSERT saying we've already found a VAD there. After fixing the sizing code, the bug above creeped up.
Whoever wrote the NtFreeVirtualMemory test is a godsend. It has been nailing bug after bug in the VAD implementation. Thank you.
svn path=/trunk/; revision=55990