From c7b79d1742a143b0b697cf7b7ad5d80cedc037f3 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Tue, 6 Jan 2004 22:40:53 +0000 Subject: [PATCH] hopefully the last fix for _SHGetPathFromIDListA/W() to be compatible with MS Windows and make control panel icons reappear svn path=/trunk/; revision=7495 --- reactos/lib/shell32/pidl.c | 63 ++++++++++++++------------------- reactos/lib/shell32/shlcpanel.c | 14 ++++---- 2 files changed, 33 insertions(+), 44 deletions(-) diff --git a/reactos/lib/shell32/pidl.c b/reactos/lib/shell32/pidl.c index fb6f1b0c86b..38269b87277 100644 --- a/reactos/lib/shell32/pidl.c +++ b/reactos/lib/shell32/pidl.c @@ -1297,16 +1297,17 @@ HRESULT _SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize) LPSTR pstr; LPSTR end = pszPath + uOutSize; - if (_ILIsMyComputer(pidl)) { /* optimized loop to retrieve file system paths */ + /* If the item ID list begins at "My Computer", we can use + an optimized loop to retrieve file system paths. */ + if (_ILIsMyComputer(pidl)) { LPCITEMIDLIST p = ILGetNext(pidl); LPSTR txt; pstr = pszPath; - end = pszPath + MAX_PATH; while(p && p->mkid.cb && pstrmkid.cb && pstrlpVtblPersistFolder2))) -#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This =(class*)(((char*)name)-_IPersistFolder2_Offset); +#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset); #define IShellExecuteHookW_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookW))) -#define _ICOM_THIS_From_IShellExecuteHookW(class, name) class* This =(class*)(((char*)name)-IShellExecuteHookW_Offset); +#define _ICOM_THIS_From_IShellExecuteHookW(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookW_Offset); #define IShellExecuteHookA_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookA))) -#define _ICOM_THIS_From_IShellExecuteHookA(class, name) class* This =(class*)(((char*)name)-IShellExecuteHookA_Offset); +#define _ICOM_THIS_From_IShellExecuteHookA(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookA_Offset); /* @@ -381,19 +381,19 @@ ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface, *ppvOut = NULL; if (IsEqualIID(riid, &IID_IContextMenu) &&(cidl >= 1)) { - pObj =(LPUNKNOWN) ISvItemCm_Constructor((IShellFolder *) iface, This->pidlRoot, apidl, cidl); + pObj = (LPUNKNOWN) ISvItemCm_Constructor((IShellFolder *) iface, This->pidlRoot, apidl, cidl); hr = S_OK; } else if (IsEqualIID(riid, &IID_IDataObject) &&(cidl >= 1)) { - pObj =(LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); + pObj = (LPUNKNOWN) IDataObject_Constructor(hwndOwner, This->pidlRoot, apidl, cidl); hr = S_OK; } else if (IsEqualIID(riid, &IID_IExtractIconA) &&(cidl == 1)) { pidl = ILCombine(This->pidlRoot, apidl[0]); - pObj =(LPUNKNOWN) IExtractIconA_Constructor(pidl); + pObj = (LPUNKNOWN) IExtractIconA_Constructor(pidl); SHFree(pidl); hr = S_OK; } else if (IsEqualIID(riid, &IID_IExtractIconW) &&(cidl == 1)) { pidl = ILCombine(This->pidlRoot, apidl[0]); - pObj =(LPUNKNOWN) IExtractIconW_Constructor(pidl); + pObj = (LPUNKNOWN) IExtractIconW_Constructor(pidl); SHFree(pidl); hr = S_OK; } else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))