mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
[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 svn path=/trunk/; revision=61094
This commit is contained in:
parent
c61dbc2626
commit
a24db78920
3 changed files with 22 additions and 17 deletions
|
@ -110,7 +110,6 @@ static const shvheader GenericSFHeader[] = {
|
||||||
*/
|
*/
|
||||||
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
|
LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
|
||||||
{
|
{
|
||||||
static WCHAR szfsbc[] = L"File System Bind Data";
|
|
||||||
IFileSystemBindData *fsbd = NULL;
|
IFileSystemBindData *fsbd = NULL;
|
||||||
LPITEMIDLIST pidl = NULL;
|
LPITEMIDLIST pidl = NULL;
|
||||||
IUnknown *param = NULL;
|
IUnknown *param = NULL;
|
||||||
|
@ -123,7 +122,7 @@ LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* see if the caller bound File System Bind Data */
|
/* 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))
|
if (FAILED(r))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -198,20 +197,27 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
|
||||||
if (pchEaten)
|
if (pchEaten)
|
||||||
*pchEaten = 0; /* strange but like the original */
|
*pchEaten = 0; /* strange but like the original */
|
||||||
|
|
||||||
pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName);
|
if (*lpszDisplayName)
|
||||||
if (!pidlTemp && *lpszDisplayName)
|
|
||||||
{
|
{
|
||||||
/* get the next element */
|
/* get the next element */
|
||||||
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
|
||||||
|
|
||||||
/* build the full pathname to the element */
|
pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, szElement);
|
||||||
lstrcpynW(szPath, sPathTarget, MAX_PATH - 1);
|
if (pidlTemp != NULL)
|
||||||
PathAddBackslashW(szPath);
|
{
|
||||||
len = wcslen(szPath);
|
hr = S_OK;
|
||||||
lstrcpynW(szPath + len, szElement, MAX_PATH - len);
|
}
|
||||||
|
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 */
|
/* get the pidl */
|
||||||
hr = _ILCreateFromPathW(szPath, &pidlTemp);
|
hr = _ILCreateFromPathW(szPath, &pidlTemp);
|
||||||
|
}
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,9 +49,6 @@ BEGIN_COM_MAP(IFileSystemBindDataImpl)
|
||||||
END_COM_MAP()
|
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)
|
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
|
||||||
{
|
{
|
||||||
CComPtr<IFileSystemBindData> fileSystemBindData;
|
CComPtr<IFileSystemBindData> fileSystemBindData;
|
||||||
|
@ -83,7 +80,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC
|
||||||
hResult = bindContext->SetBindOptions(&bindOpts);
|
hResult = bindContext->SetBindOptions(&bindOpts);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
hResult = bindContext->RegisterObjectParam((LPOLESTR)wFileSystemBindData, fileSystemBindData);
|
hResult = bindContext->RegisterObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, fileSystemBindData);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
|
||||||
|
@ -103,7 +100,7 @@ HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd)
|
||||||
if (!pfd)
|
if (!pfd)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
ret = pbc->GetObjectParam((LPOLESTR)wFileSystemBindData, &pUnk);
|
ret = pbc->GetObjectParam((LPOLESTR)STR_FILE_SYS_BIND_DATA, &pUnk);
|
||||||
if (SUCCEEDED(ret))
|
if (SUCCEEDED(ret))
|
||||||
{
|
{
|
||||||
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
|
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
|
||||||
|
@ -121,7 +118,7 @@ HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *
|
||||||
|
|
||||||
TRACE("%p, %p\n", pbc, pfd);
|
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))
|
if (SUCCEEDED(ret))
|
||||||
{
|
{
|
||||||
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
|
ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
|
||||||
|
|
|
@ -1833,6 +1833,8 @@ interface IShellChangeNotify : IUnknown
|
||||||
[in] LPCITEMIDLIST pidl2);
|
[in] LPCITEMIDLIST pidl2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cpp_quote("#define STR_FILE_SYS_BIND_DATA L\"File System Bind Data\"")
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* IFileSystemBindData interface
|
* IFileSystemBindData interface
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue