Repository navigation
Commit 844da62
authored
Fix Explorer crash when Open-Shell exits while the menu is open (#2576)
CleanStartMenuDLL called CloseManagers() before CMenuContainer::CloseStartMenu().
When the start menu was still open at exit, destroying it ran
CMenuContainer::OnDestroy -> g_SearchManager.CloseMenu(), which locks the
search manager's critical section. CloseManagers had already deleted that
lock, so Explorer crashed with an access violation in
ntdll!RtlpWaitOnCriticalSection. This order dates back to at least the
Classic Shell -> Open-Shell rebrand and is in 4.4.198 and current master.
The menu, the settings window and the owner window are now closed before
the managers are shut down.
Found with a crash dump (WER LocalDumps + full page heap on explorer.exe):
StartMenuDLL!CSearchManager::CloseMenu+0x2d (SearchManager.cpp:139)
StartMenuDLL!CMenuContainer::OnDestroy+0x361
...
StartMenuDLL!CMenuContainer::CloseStartMenu+0xa0
StartMenuDLL!CleanStartMenuDLL+0x605
StartMenuDLL!HookDesktopThread+0x7e6
FAILURE_BUCKET_ID: NULL_CLASS_PTR_WRITE_AVRF_c0000005_StartMenuDLL.dll!CSearchManager::CloseMenu
Reproduce: start StartMenu.exe, run "StartMenu.exe -open", and while the
menu is visible run "StartMenu.exe -exit". Explorer restarts.
Verified on Windows 11 (26100): unmodified master crashed Explorer in every
run with the menu open at exit; with this change, 5 of 5 such runs exited
cleanly.1 parent 9dfa7fa commit 844da62
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3314 | 3314 | | |
3315 | 3315 | | |
3316 | 3316 | | |
3317 | | - | |
3318 | | - | |
3319 | | - | |
3320 | | - | |
| 3317 | + | |
| 3318 | + | |
3321 | 3319 | | |
3322 | 3320 | | |
3323 | 3321 | | |
3324 | 3322 | | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
3325 | 3328 | | |
3326 | 3329 | | |
3327 | 3330 | | |
| |||
0 commit comments