reactos/ntoskrnl/include
George Bișoc fe23a4aaeb
[NTOS:CM] Lock the entire registry down when we unload a hive
The PR #6649 which fixed an issue with orphaned KCBs leaking in memory which also pointed to unloaded registry hives, it also brought a problem.
In CmpEnumerateOpenSubKeys there is a risk of getting hit by a deadlock as we enumerate the cache table to remove empty cache entries.

Fundamentally CmpEnumerateOpenSubKeys locks down a KCB from cache for exclusive use in order to tear down its contents from memory but it doesn't address the fact a KCB might have already been locked in the same calling thread, leading to a recursion.
This leads to random hangs when unloading a hive during system startup (tipically on a clean install).

The solution here is to simply lock the whole registry when we unload a hive so that we don't have to worry the KCBs are getting tampered by anybody else. This also simplifies the code.
Although locking the entire registry while other apps are doing registry related operations to other hives can cause overhead. If this turns out to be bad then we have to rethink the locking mechanism here.

CORE-19539
2024-06-01 16:17:47 +02:00
..
internal [NTOS:CM] Lock the entire registry down when we unload a hive 2024-06-01 16:17:47 +02:00
config.h [NTOSKRNL] include/config.h: Sync it to current code (#3263) 2020-10-17 18:09:11 +02:00
ntoskrnl.h [NTOS:KD:KDBG] Integration into KD framework (Part 2/3) 2023-08-31 16:09:49 +02:00
resource.h [NTOS:INBV:PO] Consolidate shutdown logo routines where all the boot theming is implemented. 2023-12-25 21:43:20 +01:00
sysfuncs.h Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
sysfuncs64.h Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00