Author: hpoussin
Date: Sun May 18 13:07:00 2008
New Revision: 33592
URL:
http://svn.reactos.org/svn/reactos?rev=33592&view=rev
Log:
Display again the 'New' context menu, which was broken in r30366
See issue #3183 for more details.
Modified:
trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c
trunk/reactos/dll/win32/shell32/shv_item_new.c
Modified: trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_bg_c…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shv_bg_cmenu.c [iso-8859-1] Sun May 18 13:07:00 2008
@@ -170,6 +170,8 @@
* ISVBgCm_fnQueryContextMenu()
*/
+VOID INewItem_SetParent(LPSHELLFOLDER pSFParent); /* FIXME: remove that, shouldn't be
needed */
+
static HRESULT WINAPI ISVBgCm_fnQueryContextMenu(
IContextMenu2 *iface,
HMENU hMenu,
@@ -225,8 +227,7 @@
* FIXME
* load other shell extensions
*/
-#if 0
- if (SUCCEEDED(INewItem_Constructor(This->pSFParent, &IID_IContextMenu2,
(LPVOID*)&icm)))
+ if (SUCCEEDED(INewItem_Constructor(NULL, &IID_IContextMenu2,
(LPVOID*)&icm)))
{
if (SUCCEEDED(IContextMenu_QueryContextMenu(icm, hMenu, 10, idCmdFirst,
idCmdLast, uFlags)))
{
@@ -238,7 +239,10 @@
This->icm_new = NULL;
}
}
-#endif
+
+ /* Prepare 'New item' shell extension */
+ /* FIXME: shouldn't be needed... */
+ INewItem_SetParent(This->pSFParent);
if (This->bDesktop)
{
Modified: trunk/reactos/dll/win32/shell32/shv_item_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shv_item…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shv_item_new.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shv_item_new.c [iso-8859-1] Sun May 18 13:07:00 2008
@@ -756,8 +756,8 @@
LPARAM lParam)
{
INewMenuImpl *This = impl_from_IContextMenu(iface);
- DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam;
- MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam;
+ //DRAWITEMSTRUCT * lpids = (DRAWITEMSTRUCT*) lParam;
+ //MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) lParam;
TRACE("INewItem_IContextMenu_fnHandleMenuMsg (%p)->(msg=%x wp=%lx
lp=%lx)\n",This, uMsg, wParam, lParam);
@@ -789,11 +789,11 @@
INewItem_IContextMenu_fnHandleMenuMsg
};
+static INewMenuImpl *cached_ow;
HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv)
{
INewMenuImpl * ow;
HRESULT res;
- static INewMenuImpl *cached_ow;
if (!cached_ow)
{
@@ -814,13 +814,17 @@
}
TRACE("(%p)->()\n",cached_ow);
+
+ res = INewItem_fnQueryInterface( cached_ow, riid, ppv );
+ return res;
+}
+
+VOID INewItem_SetParent(LPSHELLFOLDER pSFParent)
+{
if (cached_ow->pSFParent)
{
IShellFolder_Release(cached_ow->pSFParent);
}
- // cached_ow->pSFParent = pSFParent;
- // IShellFolder_AddRef(pSFParent);
-
- res = INewItem_fnQueryInterface( cached_ow, riid, ppv );
- return res;
-}
+ cached_ow->pSFParent = pSFParent;
+ IShellFolder_AddRef(pSFParent);
+}