https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0ba94c83b5bbc0edb3235…
commit 0ba94c83b5bbc0edb3235e7c950a9aa251ba8a73
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sun Dec 17 22:20:06 2023 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Dec 17 22:20:06 2023 +0100
[SHELL32] AddStaticContextMenusToMenu(): Fix 3 MSVC 'warning C4805' (#6177)
- Use 'bool' type.
- Do not abuse '|=' operator.
Addendum to commit 7fb91d98f
---
dll/win32/shell32/CDefaultContextMenu.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp
b/dll/win32/shell32/CDefaultContextMenu.cpp
index af57d92d3bb..72913f36918 100644
--- a/dll/win32/shell32/CDefaultContextMenu.cpp
+++ b/dll/win32/shell32/CDefaultContextMenu.cpp
@@ -540,7 +540,7 @@ CDefaultContextMenu::AddStaticContextMenusToMenu(
}
UINT cmdFlags = 0;
- BOOL hide = FALSE;
+ bool hide = false;
HKEY hkVerb;
if (idResource > 0)
{
@@ -585,12 +585,13 @@ CDefaultContextMenu::AddStaticContextMenusToMenu(
// FIXME: GetAsyncKeyState should not be called here, clients
// need to be updated to set the CMF_EXTENDEDVERBS flag.
if (!(uFlags & CMF_EXTENDEDVERBS) && GetAsyncKeyState(VK_SHIFT)
>= 0)
- hide |= RegValueExists(hkVerb, L"Extended");
+ hide = RegValueExists(hkVerb, L"Extended");
- hide |= RegValueExists(hkVerb, L"ProgrammaticAccessOnly");
+ if (!hide)
+ hide = RegValueExists(hkVerb, L"ProgrammaticAccessOnly");
- if (!(uFlags & CMF_DISABLEDVERBS))
- hide |= RegValueExists(hkVerb, L"LegacyDisable");
+ if (!hide && !(uFlags & CMF_DISABLEDVERBS))
+ hide = RegValueExists(hkVerb, L"LegacyDisable");
if (RegValueExists(hkVerb, L"NeverDefault"))
fState &= ~MFS_DEFAULT;