From cde4993d625decec31d25485c7a588a3b772ef8b Mon Sep 17 00:00:00 2001 From: Jay Yang Date: Mon, 11 Jul 2011 17:35:35 -0400 Subject: [PATCH] shell32: Have the default shell view call SHChangeNotifyRegister with unixfs pidls. --- dlls/shell32/shlview.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 1367afb6912..da613da9756 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -728,13 +728,28 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This) hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppf2); if (hr == S_OK) { + LPITEMIDLIST raw_pidl; SHChangeNotifyEntry ntreg; - hr = IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&ntreg.pidl); - if (hr == S_OK) + hr = IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&raw_pidl); + if(SUCCEEDED(hr)) { + LPITEMIDLIST computer_pidl; + SHGetFolderLocation(NULL,CSIDL_DRIVES,NULL,0,&computer_pidl); + if(ILIsParent(computer_pidl,raw_pidl,FALSE)) + { + /* Normalize the pidl to unixfs to workaround an issue with + * sending notifications on dos paths + */ + WCHAR path[MAX_PATH]; + SHGetPathFromIDListW(raw_pidl,path); + SHParseDisplayName(path,NULL,(LPITEMIDLIST*)&ntreg.pidl,0,NULL); + SHFree(raw_pidl); + } + else + ntreg.pidl = raw_pidl; ntreg.fRecursive = TRUE; - This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNF_IDLIST, SHCNE_ALLEVENTS, + This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNRF_InterruptLevel, SHCNE_ALLEVENTS, SHV_CHANGE_NOTIFY, 1, &ntreg); SHFree((LPITEMIDLIST)ntreg.pidl); }