Commit 81b7509f authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard

Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList.

parent 0901b232
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment