Author: gadamopoulos
Date: Sun Nov 24 21:42:28 2013
New Revision: 61094
URL:
http://svn.reactos.org/svn/reactos?rev=61094&view=rev
Log:
[shell32]
- define STR_FILE_SYS_BIND_DATA in the public headers and use it in
IFileSystemBindDataImpl and CFSFolder. Now we use the same string to store the
IFileSystemBindDataImpl in the bind context.
- Fix CFSFolder::ParseDisplayName to properly parse paths with a IBindCtx
- Should fix creating pidls that represent files that don't exist and fix
SHChangeNotify tests that hanged for a whole minute in our test suite
Modified:
trunk/reactos/dll/win32/shell32/folders/fs.cpp
trunk/reactos/dll/win32/shell32/shlfsbind.cpp
trunk/reactos/include/psdk/shobjidl.idl
Modified: trunk/reactos/dll/win32/shell32/folders/fs.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Sun Nov 24 21:42:28 2013
@@ -110,7 +110,6 @@
*/
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
{
- static WCHAR szfsbc[] = L"File System Bind Data";
IFileSystemBindData *fsbd = NULL;
LPITEMIDLIST pidl = NULL;
IUnknown *param = NULL;
@@ -123,7 +122,7 @@
return NULL;
/* see if the caller bound File System Bind Data */
- r = pbc->GetObjectParam((LPOLESTR)szfsbc, ¶m);
+ r = pbc->GetObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, ¶m);
if (FAILED(r))
return NULL;
@@ -198,20 +197,27 @@
if (pchEaten)
*pchEaten = 0; /* strange but like the original */
- pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName);
- if (!pidlTemp && *lpszDisplayName)
+ if (*lpszDisplayName)
{
/* get the next element */
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
- /* build the full pathname to the element */
- lstrcpynW(szPath, sPathTarget, MAX_PATH - 1);
- PathAddBackslashW(szPath);
- len = wcslen(szPath);
- lstrcpynW(szPath + len, szElement, MAX_PATH - len);
-
- /* get the pidl */
- hr = _ILCreateFromPathW(szPath, &pidlTemp);
+ pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, szElement);
+ if (pidlTemp != NULL)
+ {
+ hr = S_OK;
+ }
+ else
+ {
+ /* build the full pathname to the element */
+ lstrcpynW(szPath, sPathTarget, MAX_PATH - 1);
+ PathAddBackslashW(szPath);
+ len = wcslen(szPath);
+ lstrcpynW(szPath + len, szElement, MAX_PATH - len);
+
+ /* get the pidl */
+ hr = _ILCreateFromPathW(szPath, &pidlTemp);
+ }
if (SUCCEEDED(hr))
{
Modified: trunk/reactos/dll/win32/shell32/shlfsbind.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfsbin…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] Sun Nov 24 21:42:28 2013
@@ -49,9 +49,6 @@
END_COM_MAP()
};
-static const WCHAR wFileSystemBindData[] = {
- 'F','i','l','e','
','S','y','s','t','e','m','
','B','i','n','d','D','a','t','a',0};
-
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
{
CComPtr<IFileSystemBindData> fileSystemBindData;
@@ -83,7 +80,7 @@
hResult = bindContext->SetBindOptions(&bindOpts);
if (FAILED(hResult))
return hResult;
- hResult = bindContext->RegisterObjectParam((LPOLESTR)wFileSystemBindData,
fileSystemBindData);
+ hResult = bindContext->RegisterObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA,
fileSystemBindData);
if (FAILED(hResult))
return hResult;
@@ -103,7 +100,7 @@
if (!pfd)
return E_INVALIDARG;
- ret = pbc->GetObjectParam((LPOLESTR)wFileSystemBindData, &pUnk);
+ ret = pbc->GetObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, &pUnk);
if (SUCCEEDED(ret))
{
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
@@ -121,7 +118,7 @@
TRACE("%p, %p\n", pbc, pfd);
- ret = pbc->GetObjectParam((LPOLESTR)wFileSystemBindData, &pUnk);
+ ret = pbc->GetObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, &pUnk);
if (SUCCEEDED(ret))
{
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
Modified: trunk/reactos/include/psdk/shobjidl.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shobjidl.idl?…
==============================================================================
--- trunk/reactos/include/psdk/shobjidl.idl [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shobjidl.idl [iso-8859-1] Sun Nov 24 21:42:28 2013
@@ -1833,6 +1833,8 @@
[in] LPCITEMIDLIST pidl2);
}
+cpp_quote("#define STR_FILE_SYS_BIND_DATA L\"File System Bind
Data\"")
+
/*****************************************************************************
* IFileSystemBindData interface
*/