mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:05:43 +00:00
[SHELL32]
- Fix SH_ParseGuidDisplayName which was completely broken when I committed it. - Use GUIDFromStringW instead of SHCLSIDFromStringW in _ILCreateGuidFromStrW. The latter needs the string to terminate right after the guid. svn path=/trunk/; revision=69369
This commit is contained in:
parent
88e5d9fb36
commit
466e9a0571
4 changed files with 19 additions and 14 deletions
|
@ -66,7 +66,7 @@ HRESULT SHELL32_SetNameOfGuidItem(PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD
|
|||
|
||||
HRESULT SHELL32_GetDetailsOfGuidItem(IShellFolder2* psf, PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
|
||||
|
||||
HRESULT SH_ParseGuidDisplayName(IShellFolder * pFolder,
|
||||
HRESULT SH_ParseGuidDisplayName(IShellFolder2 * pFolder,
|
||||
HWND hwndOwner,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
|
|
|
@ -682,7 +682,7 @@ HRESULT SHELL32_CompareIDs(IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pi
|
|||
return nReturn;
|
||||
}
|
||||
|
||||
HRESULT SH_ParseGuidDisplayName(IShellFolder * pFolder,
|
||||
HRESULT SH_ParseGuidDisplayName(IShellFolder2 * pFolder,
|
||||
HWND hwndOwner,
|
||||
LPBC pbc,
|
||||
LPOLESTR lpszDisplayName,
|
||||
|
@ -701,17 +701,14 @@ HRESULT SH_ParseGuidDisplayName(IShellFolder * pFolder,
|
|||
*pchEaten = 0;
|
||||
|
||||
UINT cch = wcslen(lpszDisplayName);
|
||||
if (cch < 40)
|
||||
return E_FAIL;
|
||||
|
||||
if (lpszDisplayName[0] != L':' || lpszDisplayName[1] != L':' || lpszDisplayName[2] != L'{' || lpszDisplayName[40] != L'}')
|
||||
if (cch < 39 || lpszDisplayName[0] != L':' || lpszDisplayName[1] != L':')
|
||||
return E_FAIL;
|
||||
|
||||
pidl = _ILCreateGuidFromStrW(lpszDisplayName + 2);
|
||||
if (pidl == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
if (cch < 42)
|
||||
if (cch < 41)
|
||||
{
|
||||
*ppidl = pidl;
|
||||
if (pdwAttributes && *pdwAttributes)
|
||||
|
@ -721,15 +718,12 @@ HRESULT SH_ParseGuidDisplayName(IShellFolder * pFolder,
|
|||
}
|
||||
else
|
||||
{
|
||||
IShellFolder* psf;
|
||||
LPITEMIDLIST pidlChild;
|
||||
HRESULT hres;
|
||||
|
||||
hres = SHELL32_BindToGuidItem(NULL, pidl, NULL, IID_PPV_ARG(IShellFolder, &psf));
|
||||
if (SUCCEEDED(hres))
|
||||
HRESULT hr = SHELL32_ParseNextElement(pFolder, hwndOwner, pbc, &pidl, lpszDisplayName + 41, pchEaten, pdwAttributes);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
return psf->ParseDisplayName(hwndOwner, pbc, lpszDisplayName + 42, pchEaten, &pidlChild, pdwAttributes);
|
||||
*ppidl = pidl;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
|
|
@ -1654,6 +1654,7 @@ LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
|
|||
return pidlOut;
|
||||
}
|
||||
|
||||
#ifndef __REACTOS__
|
||||
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID)
|
||||
{
|
||||
IID iid;
|
||||
|
@ -1665,12 +1666,17 @@ LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID)
|
|||
}
|
||||
return _ILCreateGuid(PT_GUID, &iid);
|
||||
}
|
||||
#endif
|
||||
|
||||
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
|
||||
{
|
||||
IID iid;
|
||||
|
||||
#ifndef __REACTOS__
|
||||
if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
|
||||
#else
|
||||
if (!GUIDFromStringW(szGUID, &iid))
|
||||
#endif
|
||||
{
|
||||
ERR("%s is not a GUID\n", debugstr_w(szGUID));
|
||||
return NULL;
|
||||
|
|
|
@ -550,6 +550,11 @@ INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateD
|
|||
|
||||
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv);
|
||||
|
||||
BOOL WINAPI GUIDFromStringW(
|
||||
_In_ PCWSTR psz,
|
||||
_Out_ LPGUID pguid
|
||||
);
|
||||
|
||||
static inline ULONG
|
||||
Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue