Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList.

This commit is contained in:
Michael Jung 2005-06-14 19:17:41 +00:00 committed by Alexandre Julliard
parent 0901b23206
commit 81b7509f3b
3 changed files with 10 additions and 9 deletions

View File

@ -176,7 +176,7 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
char szTemp[MAX_PATH], *szFileName;
LPITEMIDLIST pidl;
HGLOBAL hGlobal;
HRESULT hr;
BOOL bSuccess;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
@ -185,9 +185,9 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
if (!pidl)
return 0;
hr = SHELL_GetPathFromIDListA(pidl, szTemp, MAX_PATH);
bSuccess = SHGetPathFromIDListA(pidl, szTemp);
SHFree(pidl);
if (FAILED(hr))
if (!bSuccess)
return 0;
size = strlen(szTemp) + 1;
@ -208,7 +208,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
WCHAR szTemp[MAX_PATH], *szFileName;
LPITEMIDLIST pidl;
HGLOBAL hGlobal;
HRESULT hr;
BOOL bSuccess;
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
@ -217,9 +217,9 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
if (!pidl)
return 0;
hr = SHELL_GetPathFromIDListW(pidl, szTemp, MAX_PATH);
bSuccess = SHGetPathFromIDListW(pidl, szTemp);
SHFree(pidl);
if (FAILED(hr))
if (!bSuccess)
return 0;
size = (strlenW(szTemp)+1) * sizeof(WCHAR);

View File

@ -1973,6 +1973,7 @@ static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR
static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags)
{
HRESULT hr = S_OK;
BOOL bSuccess;
_ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface);
@ -1983,9 +1984,9 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
if (!This->sPath && This->pPidl) {
WCHAR buffer[MAX_PATH];
hr = SHELL_GetPathFromIDListW(This->pPidl, buffer, MAX_PATH);
bSuccess = SHGetPathFromIDListW(This->pPidl, buffer);
if (SUCCEEDED(hr) && *buffer) {
if (bSuccess && *buffer) {
This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
if (!This->sPath)
return E_OUTOFMEMORY;

View File

@ -296,7 +296,7 @@ static HRESULT SHELL_ResolveShortCutW(LPWSTR wcmd, LPWSTR wargs, LPWSTR wdir, HW
if (SUCCEEDED(hr) && *ppidl) {
/* We got a PIDL instead of a file system path - try to translate it. */
if (SUCCEEDED(SHELL_GetPathFromIDListW(*ppidl, wcmd, MAX_PATH))) {
if (SHGetPathFromIDListW(*ppidl, wcmd)) {
SHFree(*ppidl);
*ppidl = NULL;
}