Fix an IE crash and make the "Create Folder" functionality in Favorites work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

this patch fixes a crash in IE (Favorites->Organize Favorites->Create Folder)
and brings that functionality to life.

The crash was caused by the fact that LPSHELLVIEW was left uninitialized after
the IShellBrowser_QueryActiveShellView() call, hWndSV was left uninitialized
as well. DoNewFolder copes with LPSHELLVIEW being NULL on its own.

I didn't reindent the ISVBgCm_fnInvokeCommand() function body to keep
the patch small, although it's in a big mess.

Changelog:
    Dmitry Timoshkov <dmitry@xxxxxxxxxxxxxxx>
    Fix an IE crash and make the "Create Folder" functionality in Favorites
    work.

--- cvs/hq/wine/dlls/shell32/shv_bg_cmenu.c	2003-09-14 18:57:00.000000000 +0900
+++ wine/dlls/shell32/shv_bg_cmenu.c	2004-01-08 21:45:05.000000000 +0800
@@ -307,6 +307,7 @@ static BOOL DoPaste(
 #endif
 	return bSuccess;
 }
+
 /**************************************************************************
 * ISVBgCm_fnInvokeCommand()
 */
@@ -317,8 +318,8 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCo
 	ICOM_THIS(BgCmImpl, iface);
 
 	LPSHELLBROWSER	lpSB;
-	LPSHELLVIEW	lpSV;
-	HWND	hWndSV;
+	LPSHELLVIEW lpSV = NULL;
+	HWND hWndSV = 0;
 
 	TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd);
 
@@ -331,15 +332,13 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCo
 	  }
 	}
 
-	if(lpSV)
-	{
 	  if(HIWORD(lpcmi->lpVerb))
 	  {
 	    TRACE("%s\n",lpcmi->lpVerb);
 
 	    if (! strcmp(lpcmi->lpVerb,CMDSTR_NEWFOLDERA))
 	    {
-	      if(lpSV) DoNewFolder(iface, lpSV);
+                DoNewFolder(iface, lpSV);
 	    }
 	    else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWLISTA))
 	    {
@@ -371,8 +370,9 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCo
 	    }
 	  }
 
+        if (lpSV)
 	  IShellView_Release(lpSV);	/* QueryActiveShellView does AddRef*/
-	}
+
 	return NOERROR;
 }
 





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux