Skip to content

Commit

Permalink
Disable OpenNcThemeData detour on ARM64
Browse files Browse the repository at this point in the history
This detour was causing an illegal instruction (0xc000001d) crash on
ARM64. Note that because the detour is now disabled on ARM64, some
scrollbars (e.g. the listview scrollbar) will appear light when dark
mode is enabled on ARM64.

This fixes #478.
  • Loading branch information
derceg committed Sep 20, 2024
1 parent 6d98be0 commit 8ac0220
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Explorer++/Explorer++/DarkModeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ void DarkModeHelper::EnableForApp(bool enable)
FlushMenuThemes();
RefreshImmersiveColorPolicyState();

// This detour seemingly causes an illegal instruction (0xc000001d) crash on ARM64 (see #478),
// which is the reason for the check here. Note that while disabling this detour on ARM64
// prevents the crash, it also means some scrollbars (e.g. the listview scrollbar) will appear
// light when dark mode is enabled on ARM64.
#if !defined(BUILD_ARM64)
LONG res;

if (enable)
Expand All @@ -124,6 +129,7 @@ void DarkModeHelper::EnableForApp(bool enable)
}

DCHECK_EQ(res, NO_ERROR);
#endif

m_darkModeEnabled = enable;

Expand Down

0 comments on commit 8ac0220

Please sign in to comment.