From 70d4604ac9ad73e389829dceb369dc2b23c90934 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Fri, 23 Jan 2004 20:46:09 +0000 Subject: [PATCH] - ISF_Desktop_fnGetUIObjectOf(): allow context menu on the desktop without any selected item; preserve return error codes. - ISF_Desktop_fnGetDisplayNameOf(): don't initialize whole character array with zero. --- dlls/shell32/shfldr_desktop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index f8015ee5b56..9a32873fa46 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -75,8 +75,6 @@ typedef struct { #define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl) #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) -HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); - static struct ICOM_VTABLE (IShellFolder2) vt_MCFldr_ShellFolder2; static shvheader DesktopSFHeader[] = { @@ -417,7 +415,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, if (ppvOut) { *ppvOut = NULL; - if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) { + if (IsEqualIID (riid, &IID_IContextMenu)) { pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); hr = S_OK; } else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) { @@ -444,7 +442,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface, hr = E_NOINTERFACE; } - if (!pObj) + if (SUCCEEDED(hr) && !pObj) hr = E_OUTOFMEMORY; *ppvOut = pObj; @@ -464,10 +462,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, { ICOM_THIS (IGenericSFImpl, iface); - CHAR szPath[MAX_PATH] = ""; + CHAR szPath[MAX_PATH]; GUID const *clsid; HRESULT hr = S_OK; + *szPath = '\0'; + TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This, pidl, dwFlags, strRet); pdump (pidl);