Add This PC and Desktop to Nav Top: defer injection to avoid early conflicts#4282
Add This PC and Desktop to Nav Top: defer injection to avoid early conflicts#4282rodboev wants to merge 8 commits into
Conversation
Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. I'm not sure if Removing the force-load also removed the implicit pin on The fix keeps the per-process pin you actually need without reintroducing the system-wide preload you're removing — pin it at the point you commit to hooking, in // keep ExplorerFrame.dll resident for as long as our hooks live in it
HMODULE pin = nullptr;
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, L"ExplorerFrame.dll", &pin);Optional improvements
Minor polish — none of this affects users, so it's your call.
|
…ocation doesn't change when items get inserted or moved
|
Got it. ExplorerFrame.dll is now pinned via GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN) in both the late-load and already-loaded paths, and the unreachable kernelbase fallback is removed. Also addressing #4293 by preventing the tree selection from shifting when the mod inserts or removes items. This was causing navigation in Explorer. Genuine user navigation is unaffected. This really speeds things up. |
Changed the injection strategy to hook kernelbase!LoadLibraryExW instead of force-loading ExplorerFrame.dll in Wh_ModInit. Processes that don't use ExplorerFrame.dll no longer get it loaded at startup.
A user reported instability on 25H2 in #4280 (browser tabs crashing, Explorer becoming unresponsive after restart). I haven't been able to reproduce it, but the previous approach loaded ExplorerFrame.dll into every injected process at startup, which is unnecessarily aggressive. Deferring to the kernelbase hook (per @m417z's suggestion in #4159) avoids that entirely.