[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.
This commit is contained in:
Carl J. Bialorucki 2024-04-13 16:12:35 -06:00 committed by GitHub
parent b8abfa76ca
commit 78dc504e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -493,13 +493,12 @@ CDefaultContextMenu::AddStaticContextMenusToMenu(
UINT uFlags) UINT uFlags)
{ {
UINT ntver = RosGetProcessEffectiveVersion(); UINT ntver = RosGetProcessEffectiveVersion();
MENUITEMINFOW mii; MENUITEMINFOW mii = { sizeof(mii) };
UINT idResource; UINT idResource;
WCHAR wszVerb[40]; WCHAR wszVerb[40];
UINT fState; UINT fState;
UINT cIds = 0, indexFirst = *pIndexMenu; UINT cIds = 0, indexFirst = *pIndexMenu;
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA; mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA;
mii.fType = MFT_STRING; mii.fType = MFT_STRING;
mii.dwTypeData = NULL; mii.dwTypeData = NULL;