From 78dc504e72219dc9bfb256409ec508b66dc50c62 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Sat, 13 Apr 2024 16:12:35 -0600 Subject: [PATCH] [SHELL32] Initialize MenuItemInfoW struct in AddStaticContextMenusToMenu (#6737) This prevents an issue where clicking on most of the icons on the desktop that isn't the file explorer causes explorer to throw an exception, and also prevents another issue where most applications won't launch from the start menu; at least on MSVC builds running on VirtualBox 5.2.44. ^- I am pretty sure, that this was not always the case. The guilty rev is yet unknown though. --- dll/win32/shell32/CDefaultContextMenu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp b/dll/win32/shell32/CDefaultContextMenu.cpp index 31231af1db9..2bd9b833c46 100644 --- a/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/dll/win32/shell32/CDefaultContextMenu.cpp @@ -493,13 +493,12 @@ CDefaultContextMenu::AddStaticContextMenusToMenu( UINT uFlags) { UINT ntver = RosGetProcessEffectiveVersion(); - MENUITEMINFOW mii; + MENUITEMINFOW mii = { sizeof(mii) }; UINT idResource; WCHAR wszVerb[40]; UINT fState; UINT cIds = 0, indexFirst = *pIndexMenu; - mii.cbSize = sizeof(mii); mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; mii.fType = MFT_STRING; mii.dwTypeData = NULL;