diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp index f6cb992dbb6..9c8edff1822 100644 --- a/dll/win32/browseui/shellbrowser.cpp +++ b/dll/win32/browseui/shellbrowser.cpp @@ -2387,12 +2387,33 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::QueryService(REFGUID guidService, REFII return E_NOINTERFACE; } +static BOOL _ILIsNetworkPlace(LPCITEMIDLIST pidl) +{ + WCHAR szPath[MAX_PATH]; + return SHGetPathFromIDListWrapW(pidl, szPath) && PathIsUNCW(szPath); +} + HRESULT STDMETHODCALLTYPE CShellBrowser::GetPropertyBag(long flags, REFIID riid, void **ppvObject) { if (ppvObject == NULL) return E_POINTER; + *ppvObject = NULL; - return E_NOTIMPL; + + LPITEMIDLIST pidl; + HRESULT hr = GetPidl(&pidl); + if (FAILED_UNEXPECTEDLY(hr)) + return E_FAIL; + + // FIXME: pidl for Internet etc. + + if (_ILIsNetworkPlace(pidl)) + flags |= SHGVSPB_ROAM; + + hr = SHGetViewStatePropertyBag(pidl, L"Shell", flags, riid, ppvObject); + + ILFree(pidl); + return hr; } HRESULT STDMETHODCALLTYPE CShellBrowser::GetTypeInfoCount(UINT *pctinfo) diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index cd427170815..1cb5a064631 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -276,6 +276,7 @@ BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich); BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich); VOID WINAPI FixSlashesAndColonW(LPWSTR); BOOL WINAPI PathIsValidCharW(WCHAR c, DWORD dwClass); +BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl, LPWSTR pszPath); #ifdef __cplusplus } /* extern "C" */