reactos/sdk/lib/cmlib
maharmstone e6a9aafe58 [CMLIB] Clean volatile registry entries in the same manner as Windows (#1883)
This fixes the crashes in HvpGetCellMapped on Windows Server 2003 when booting from Freeloader, as mentioned in maharmstone/btrfs#16.

When the bootloader loads the system hive, it cleans the data pertaining to any volatile keys. The Windows bootloader does this by setting SubKeyCounts[Volatile] to 0. After boot, the kernel marks any cell where this is 0 but SubKeyLists[Volatile] isn't HCELL_NIL as dirty, meaning that the sanitized version will then get flushed to the disk.

Because Freeloader sets SubKeyLists[Volatile] to HCELL_NIL straightaway, Windows thinks the cell is clean, and can unload it without flushing. If it then reads it from the disk, it will crash in HvpGetCellMapped due to the stale volatile pointers.

If you break on nt!CmpInitializeSystemHive on Windows and "gu" to the let the function run, you'll see that DirtyVector of the HHIVE has only the first 8 bits set. If you run it using the official bootloader, it'll have a lot more than that.
2019-08-27 02:39:27 +02:00
..
CMakeLists.txt
cmdata.h
cmindex.c [CMLIB] Simplify an ASSERTMSG() as an ASSERT(). 2018-08-08 21:45:46 +02:00
cminit.c [CMLIB] Clean volatile registry entries in the same manner as Windows (#1883) 2019-08-27 02:39:27 +02:00
cmkeydel.c
cmlib.h [CMLIB] Adjust parameter types and annotations. Add diagnostic assertions. 2018-10-14 15:59:31 +02:00
cmname.c [CMLIB] Adjust parameter types and annotations. Add diagnostic assertions. 2018-10-14 15:59:31 +02:00
cmse.c
cmvalue.c [CMLIB] Adjust parameter types and annotations. Add diagnostic assertions. 2018-10-14 15:59:31 +02:00
hivebin.c [TOOLS] Fix/suppress all MSVC/x64 warnings (#1525) 2019-04-28 23:21:48 +02:00
hivecell.c
hivedata.h [CMLIB] Assign a signature to the in-memory HHIVE registry hive structure. CORE-15753 2019-02-17 01:21:37 +01:00
hiveinit.c [CMLIB] Assign a signature to the in-memory HHIVE registry hive structure. CORE-15753 2019-02-17 01:21:37 +01:00
hivesum.c
hivewrt.c