Author: gadamopoulos Date: Sun Sep 27 10:52:10 2015 New Revision: 69369
URL: http://svn.reactos.org/svn/reactos?rev=69369&view=rev Log: [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.
Modified: trunk/reactos/dll/win32/shell32/shfldr.h trunk/reactos/dll/win32/shell32/shlfolder.cpp trunk/reactos/dll/win32/shell32/wine/pidl.c trunk/reactos/include/reactos/undocshell.h
Modified: trunk/reactos/dll/win32/shell32/shfldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr.h?... ============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shfldr.h [iso-8859-1] Sun Sep 27 10:52:10 2015 @@ -66,7 +66,7 @@
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,
Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolder... ============================================================================== --- trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Sun Sep 27 10:52:10 2015 @@ -682,7 +682,7 @@ return nReturn; }
-HRESULT SH_ParseGuidDisplayName(IShellFolder * pFolder, +HRESULT SH_ParseGuidDisplayName(IShellFolder2 * pFolder, HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, @@ -701,17 +701,14 @@ *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 @@ } 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;
Modified: trunk/reactos/dll/win32/shell32/wine/pidl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/pidl... ============================================================================== --- trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] Sun Sep 27 10:52:10 2015 @@ -1654,6 +1654,7 @@ return pidlOut; }
+#ifndef __REACTOS__ LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID) { IID iid; @@ -1665,12 +1666,17 @@ } 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;
Modified: trunk/reactos/include/reactos/undocshell.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/undocshell.... ============================================================================== --- trunk/reactos/include/reactos/undocshell.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/undocshell.h [iso-8859-1] Sun Sep 27 10:52:10 2015 @@ -550,6 +550,11 @@
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, ...) {