mirror of
https://github.com/reactos/reactos.git
synced 2024-09-29 05:54:05 +00:00
[SHELL32] Remove some mostly dead code from CShellLink
This commit is contained in:
parent
0a8ade5dd4
commit
608cb60e44
|
@ -349,14 +349,10 @@ HRESULT STDMETHODCALLTYPE CShellLink::Save(LPCOLESTR pszFileName, BOOL fRemember
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
if (pszFileName != m_sLinkPath)
|
if (m_sLinkPath)
|
||||||
{
|
HeapFree(GetProcessHeap(), 0, m_sLinkPath);
|
||||||
if (m_sLinkPath)
|
|
||||||
HeapFree(GetProcessHeap(), 0, m_sLinkPath);
|
|
||||||
|
|
||||||
m_sLinkPath = strdupW(pszFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
m_sLinkPath = strdupW(pszFileName);
|
||||||
m_bDirty = FALSE;
|
m_bDirty = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1416,12 +1412,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::Resolve(HWND hwnd, DWORD fFlags)
|
||||||
bSuccess = SHGetPathFromIDListW(m_pPidl, buffer);
|
bSuccess = SHGetPathFromIDListW(m_pPidl, buffer);
|
||||||
if (bSuccess && *buffer)
|
if (bSuccess && *buffer)
|
||||||
{
|
{
|
||||||
if (buffer != m_sPath)
|
m_sPath = strdupW(buffer);
|
||||||
{
|
if (!m_sPath)
|
||||||
m_sPath = strdupW(buffer);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sPath)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_bDirty = TRUE;
|
m_bDirty = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1434,12 +1427,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::Resolve(HWND hwnd, DWORD fFlags)
|
||||||
// FIXME: Strange to do that here...
|
// FIXME: Strange to do that here...
|
||||||
if (!m_sIcoPath && m_sPath)
|
if (!m_sIcoPath && m_sPath)
|
||||||
{
|
{
|
||||||
if (m_sIcoPath != m_sPath)
|
m_sIcoPath = strdupW(m_sPath);
|
||||||
{
|
if (!m_sIcoPath)
|
||||||
m_sIcoPath = strdupW(m_sPath);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sIcoPath)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Header.nIconIndex = 0;
|
m_Header.nIconIndex = 0;
|
||||||
|
|
||||||
|
@ -1565,12 +1555,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetDescription(LPCWSTR pszName)
|
||||||
HeapFree(GetProcessHeap(), 0, m_sDescription);
|
HeapFree(GetProcessHeap(), 0, m_sDescription);
|
||||||
if (pszName)
|
if (pszName)
|
||||||
{
|
{
|
||||||
if (m_sDescription != pszName)
|
m_sDescription = strdupW(pszName);
|
||||||
{
|
if (!m_sDescription)
|
||||||
m_sDescription = strdupW(pszName);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sDescription)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_sDescription = NULL;
|
m_sDescription = NULL;
|
||||||
|
@ -1600,12 +1587,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetWorkingDirectory(LPCWSTR pszDir)
|
||||||
HeapFree(GetProcessHeap(), 0, m_sWorkDir);
|
HeapFree(GetProcessHeap(), 0, m_sWorkDir);
|
||||||
if (pszDir)
|
if (pszDir)
|
||||||
{
|
{
|
||||||
if (m_sWorkDir != pszDir)
|
m_sWorkDir = strdupW(pszDir);
|
||||||
{
|
if (!m_sWorkDir)
|
||||||
m_sWorkDir = strdupW(pszDir);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sWorkDir)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_sWorkDir = NULL;
|
m_sWorkDir = NULL;
|
||||||
|
@ -1635,12 +1619,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetArguments(LPCWSTR pszArgs)
|
||||||
HeapFree(GetProcessHeap(), 0, m_sArgs);
|
HeapFree(GetProcessHeap(), 0, m_sArgs);
|
||||||
if (pszArgs)
|
if (pszArgs)
|
||||||
{
|
{
|
||||||
if (m_sArgs != pszArgs)
|
m_sArgs = strdupW(pszArgs);
|
||||||
{
|
if (!m_sArgs)
|
||||||
m_sArgs = strdupW(pszArgs);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sArgs)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_sArgs = NULL;
|
m_sArgs = NULL;
|
||||||
|
@ -1675,12 +1656,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::GetIconLocation(LPWSTR pszIconPath, INT cc
|
||||||
|
|
||||||
SHExpandEnvironmentStringsW(pInfo->szwTarget, szPath, _countof(szPath));
|
SHExpandEnvironmentStringsW(pInfo->szwTarget, szPath, _countof(szPath));
|
||||||
|
|
||||||
if (m_sIcoPath != szPath)
|
m_sIcoPath = strdupW(szPath);
|
||||||
{
|
if (!m_sIcoPath)
|
||||||
m_sIcoPath = strdupW(szPath);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sIcoPath)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Header.dwFlags |= SLDF_HAS_ICONLOCATION;
|
m_Header.dwFlags |= SLDF_HAS_ICONLOCATION;
|
||||||
|
|
||||||
|
@ -1954,12 +1932,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT i
|
||||||
HeapFree(GetProcessHeap(), 0, m_sIcoPath);
|
HeapFree(GetProcessHeap(), 0, m_sIcoPath);
|
||||||
m_sIcoPath = NULL;
|
m_sIcoPath = NULL;
|
||||||
|
|
||||||
if (m_sIcoPath != pszIconPath)
|
m_sIcoPath = strdupW(pszIconPath);
|
||||||
{
|
if (!m_sIcoPath)
|
||||||
m_sIcoPath = strdupW(pszIconPath);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sIcoPath)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Header.dwFlags |= SLDF_HAS_ICONLOCATION;
|
m_Header.dwFlags |= SLDF_HAS_ICONLOCATION;
|
||||||
}
|
}
|
||||||
|
@ -1979,12 +1954,9 @@ HRESULT STDMETHODCALLTYPE CShellLink::SetRelativePath(LPCWSTR pszPathRel, DWORD
|
||||||
HeapFree(GetProcessHeap(), 0, m_sPathRel);
|
HeapFree(GetProcessHeap(), 0, m_sPathRel);
|
||||||
if (pszPathRel)
|
if (pszPathRel)
|
||||||
{
|
{
|
||||||
if (m_sPathRel != pszPathRel)
|
m_sPathRel = strdupW(pszPathRel);
|
||||||
{
|
if (!m_sPathRel)
|
||||||
m_sPathRel = strdupW(pszPathRel);
|
return E_OUTOFMEMORY;
|
||||||
if (!m_sPathRel)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_sPathRel = NULL;
|
m_sPathRel = NULL;
|
||||||
|
@ -2327,12 +2299,12 @@ HRESULT CShellLink::SetTargetFromPIDLOrPath(LPCITEMIDLIST pidl, LPCWSTR pszFile)
|
||||||
/* Update the cached path (for link info) */
|
/* Update the cached path (for link info) */
|
||||||
ShellLink_GetVolumeInfo(pszFile, &volume);
|
ShellLink_GetVolumeInfo(pszFile, &volume);
|
||||||
|
|
||||||
if (m_sPath != pszFile)
|
if (m_sPath)
|
||||||
{
|
HeapFree(GetProcessHeap(), 0, m_sPath);
|
||||||
m_sPath = strdupW(pszFile);
|
|
||||||
if (!m_sPath)
|
m_sPath = strdupW(pszFile);
|
||||||
return E_OUTOFMEMORY;
|
if (!m_sPath)
|
||||||
}
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
m_bDirty = TRUE;
|
m_bDirty = TRUE;
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in a new issue