https://bugs.winehq.org/show_bug.cgi?id=39841
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- Let's examine the scarcity of menu options when right-clicking a file.
Starting as before, but now in platform/win/ushellcontextmenu.pas: constructor TShellContextMenu.Create() calls GetShellContextMenu() calls GetForegroundContextMenu() runs Folder.GetUIObjectOf(Handle, Files.Count, PItemIDList(List^), IID_IContextMenu, nil, Result); which calls Wine's ShellFolder2_GetUIObjectOf() with IID_IContextMenu, in dlls/shell32/shfldr_unixfs.c which runs:
---snip--- if (IsEqualIID(&IID_IContextMenu, riid)) { return ItemMenu_Constructor((IShellFolder*)iface, This->m_pidlLocation, apidl, cidl, riid, ppvOut); ---snip---
Once created, we go back to TShellContextMenu.Create(), which runs OleCheckUTF8(FShellMenu1.QueryContextMenu(FShellMenu, 0, 1, USER_CMD_ID - 1, UFlags)); which is Wine's ItemMenu_QueryContextMenu() in dlls/shell32/shlview_cmenu.c.
This seems to return an unpopulated menu. Then TShellContextMenu.Create() will return, and TShellContextMenu.PopUp() will get called, which just adds the "Actions" submenu with "View" and "Edit" subitems.
Where were the missing menu options meant to be added?
0024:trace:shell:ItemMenu_QueryContextMenu (0x6270108)->(0xd01e2 0 0x1 0xfff 0x14 )
uFlags were 0x14 == CMF_CANRENAME | CMF_EXPLORE
That idCmdLast == 0xfff seems to be wrong, as when I hack ItemMenu_QueryContextMenu() to use 0xffff instead, I get the full list of context menu items:
Open Actions Cut Copy Create Link Delete Rename Properties
But why are they otherwise absent? That idCmdLast == 0xfff (or my "better" 0xffff) is passed to Shell_MergeMenus(). Is Shell_MergeMenus() behaving incorrectly? Maybe it should ignore idCmdLast when the destination is empty?