size optimization

it's official. even msdn now says SHGetMalloc returns the same allocator CoTaskMemFree uses and a little debugging backs this even on Windows 95


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5004 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-03-20 21:33:28 +00:00
parent b3310a3170
commit 08de3671da
4 changed files with 8 additions and 16 deletions

View file

@ -683,10 +683,7 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify)
mySetWindowText(pField->hwnd, szBrowsePath);
}
LPMALLOC pMalloc;
if (!SHGetMalloc(&pMalloc)) {
pMalloc->Free(pResult);
}
CoTaskMemFree(pResult);
break;
}

View file

@ -14,6 +14,7 @@ libs = Split("""
gdi32
shell32
comdlg32
ole32
""")
examples = Split("""

View file

@ -13,6 +13,7 @@ libs = Split("""
user32
gdi32
shell32
ole32
""")
examples = Split("""

View file

@ -398,20 +398,13 @@ void AddFolderFromReg(int nFolder)
//DWORD idx;
WIN32_FIND_DATA FileData;
HANDLE hSearch;
LPITEMIDLIST ppidl;
LPMALLOC ppMalloc;
if (SHGetMalloc(&ppMalloc) == NOERROR)
buf[0] = 0;
if (SHGetSpecialFolderLocation(hwParent, nFolder, &ppidl) == S_OK)
{
LPITEMIDLIST ppidl;
buf[0] = 0;
if (SHGetSpecialFolderLocation(hwParent, nFolder, &ppidl) == S_OK)
{
SHGetPathFromIDList(ppidl, buf);
ppMalloc->lpVtbl->Free(ppMalloc, ppidl);
}
ppMalloc->lpVtbl->Release(ppMalloc);
SHGetPathFromIDList(ppidl, buf);
CoTaskMemFree(ppidl);
}
if (!buf[0])