Bug 685847 - Crash in [@ ILFindLastID ]. r=jimm

This commit is contained in:
Brian R. Bondy
2011-09-12 07:25:41 -07:00
parent a5d072eef1
commit 557693b9f7
2 changed files with 8 additions and 15 deletions

View File

@@ -105,7 +105,6 @@ unsigned char *_mbsstr( const unsigned char *str,
#endif
ILCreateFromPathWPtr nsLocalFile::sILCreateFromPathW = NULL;
ILFreePtr nsLocalFile::sILFree = NULL;
SHOpenFolderAndSelectItemsPtr nsLocalFile::sSHOpenFolderAndSelectItems = NULL;
PRLibrary *nsLocalFile::sLibShell = NULL;
@@ -2739,8 +2738,7 @@ nsLocalFile::RevealUsingShell()
{
// All of these shell32.dll related pointers should be non NULL
// on XP and later.
if (!sLibShell || !sILCreateFromPathW ||
!sILFree || !sSHOpenFolderAndSelectItems) {
if (!sLibShell || !sILCreateFromPathW || !sSHOpenFolderAndSelectItems) {
return NS_ERROR_FAILURE;
}
@@ -2757,11 +2755,11 @@ nsLocalFile::RevealUsingShell()
}
const ITEMIDLIST* selection[] = { dir };
UINT count = sizeof(selection) / sizeof(ITEMIDLIST);
UINT count = PR_ARRAY_SIZE(selection);
//Perform the open of the directory.
hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0);
sILFree(dir);
CoTaskMemFree(dir);
}
else {
// Obtain the parent path of the item we are revealing.
@@ -2781,18 +2779,18 @@ nsLocalFile::RevealUsingShell()
// Set the item in the directory to select to the file we want to reveal.
ITEMIDLIST *item = sILCreateFromPathW(mResolvedPath.get());
if (!item) {
sILFree(dir);
CoTaskMemFree(dir);
return NS_ERROR_FAILURE;
}
const ITEMIDLIST* selection[] = { item };
UINT count = sizeof(selection) / sizeof(ITEMIDLIST);
UINT count = PR_ARRAY_SIZE(selection);
//Perform the selection of the file.
hr = sSHOpenFolderAndSelectItems(dir, count, selection, 0);
sILFree(dir);
sILFree(item);
CoTaskMemFree(dir);
CoTaskMemFree(item);
}
if (SUCCEEDED(hr)) {
@@ -3106,9 +3104,6 @@ nsLocalFile::GlobalInit()
PR_FindFunctionSymbol(sLibShell,
"ILCreateFromPathW");
// ILFree is available in XP and up.
sILFree = (ILFreePtr) PR_FindFunctionSymbol(sLibShell, "ILFree");
// SHOpenFolderAndSelectItems is available in XP and up.
sSHOpenFolderAndSelectItems = (SHOpenFolderAndSelectItemsPtr)
PR_FindFunctionSymbol(sLibShell,