[REGEDIT] Fix condition of enabling load/unload hive menu item (#6251)

Based on KRosUser's regedit_loadfix.patch.
JIRA issue: CORE-19298
Fix the condition of enabling/disabling the
"Load Hive" and Unload Hive menu items.
This commit is contained in:
Katayama Hirofumi MZ 2023-12-29 20:56:01 +09:00 committed by GitHub
parent d46d3167a3
commit 1aeac0bf24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -272,8 +272,8 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath, BOOL bSelectNone)
EnableMenuItem(hMenuFrame, ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(hMenuFrame, ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_GRAYED);
/* compare the strings to see if we should enable/disable the "Load Hive" menus accordingly */
if (_wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") != 0 ||
_wcsicmp(rootName, L"HKEY_USERS") != 0)
if (_wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") == 0 ||
_wcsicmp(rootName, L"HKEY_USERS") == 0)
{
/*
* enable the unload menu item if at the root, otherwise