Skip to content

Commit

Permalink
[SHELL32] Initialize MenuItemInfoW struct in AddStaticContextMenusToM…
Browse files Browse the repository at this point in the history
…enu (#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.
  • Loading branch information
cbialorucki committed Apr 13, 2024
1 parent b8abfa7 commit 78dc504
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dll/win32/shell32/CDefaultContextMenu.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 78dc504

Please sign in to comment.