mirror of
https://github.com/reactos/reactos.git
synced 2025-05-01 03:29:37 +00:00
[SHELL32] - Remove "retrieve display name from control panel app" FIXME - it's already done + minor code improvements.
svn path=/trunk/; revision=54419
This commit is contained in:
parent
aefaa2f4f9
commit
ccdac7c24c
1 changed files with 19 additions and 20 deletions
|
@ -566,11 +566,11 @@ HRESULT WINAPI CControlPanelFolder::GetUIObjectOf(HWND hwndOwner,
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||||
{
|
{
|
||||||
CHAR szPath[MAX_PATH];
|
CHAR szName[MAX_PATH];
|
||||||
WCHAR wszPath[MAX_PATH+1]; /* +1 for potential backslash */
|
WCHAR wszName[MAX_PATH+1]; /* +1 for potential backslash */
|
||||||
PIDLCPanelStruct* pcpanel;
|
PIDLCPanelStruct *pCPanel;
|
||||||
|
|
||||||
*szPath = '\0';
|
*szName = '\0';
|
||||||
|
|
||||||
TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
|
TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", this, pidl, dwFlags, strRet);
|
||||||
pdump(pidl);
|
pdump(pidl);
|
||||||
|
@ -578,14 +578,13 @@ HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD d
|
||||||
if (!pidl || !strRet)
|
if (!pidl || !strRet)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
pcpanel = _ILGetCPanelPointer(pidl);
|
pCPanel = _ILGetCPanelPointer(pidl);
|
||||||
|
|
||||||
if (pcpanel)
|
if (pCPanel)
|
||||||
{
|
{
|
||||||
lstrcpyA(szPath, pcpanel->szName+pcpanel->offsDispName);
|
/* copy display name from pidl - it was retrived from applet before;
|
||||||
|
SHGDN_FORPARSING does not need special handling */
|
||||||
if (!(dwFlags & SHGDN_FORPARSING))
|
lstrcpyA(szName, pCPanel->szName + pCPanel->offsDispName);
|
||||||
FIXME("retrieve display name from control panel app\n");
|
|
||||||
}
|
}
|
||||||
/* take names of special folders only if it's only this folder */
|
/* take names of special folders only if it's only this folder */
|
||||||
else if (_ILIsSpecialFolder(pidl))
|
else if (_ILIsSpecialFolder(pidl))
|
||||||
|
@ -594,7 +593,7 @@ HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD d
|
||||||
|
|
||||||
if (bSimplePidl)
|
if (bSimplePidl)
|
||||||
{
|
{
|
||||||
_ILSimpleGetTextW(pidl, wszPath, MAX_PATH); /* append my own path */
|
_ILSimpleGetTextW(pidl, wszName, MAX_PATH); /* append my own path */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -606,29 +605,29 @@ HRESULT WINAPI CControlPanelFolder::GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD d
|
||||||
/* go deeper if needed */
|
/* go deeper if needed */
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
PathAddBackslashW(wszPath);
|
PathAddBackslashW(wszName);
|
||||||
len = wcslen(wszPath);
|
len = wcslen(wszName);
|
||||||
|
|
||||||
if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, wszPath + len, MAX_PATH + 1 - len)))
|
if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(this, pidl, dwFlags, wszName + len, MAX_PATH + 1 - len)))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL))
|
if (!WideCharToMultiByte(CP_ACP, 0, wszName, -1, szName, MAX_PATH, NULL, NULL))
|
||||||
wszPath[0] = '\0';
|
wszName[0] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bSimplePidl)
|
if (bSimplePidl)
|
||||||
{
|
{
|
||||||
if (!WideCharToMultiByte(CP_ACP, 0, wszPath, -1, szPath, MAX_PATH, NULL, NULL))
|
if (!WideCharToMultiByte(CP_ACP, 0, wszName, -1, szName, MAX_PATH, NULL, NULL))
|
||||||
wszPath[0] = '\0';
|
wszName[0] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strRet->uType = STRRET_CSTR;
|
strRet->uType = STRRET_CSTR;
|
||||||
lstrcpynA(strRet->cStr, szPath, MAX_PATH);
|
lstrcpynA(strRet->cStr, szName, MAX_PATH);
|
||||||
|
|
||||||
TRACE("--(%p)->(%s)\n", this, szPath);
|
TRACE("--(%p)->(%s)\n", this, szName);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue