[PATCH 5/5] shell32: Remove old shell notification workaround.

Nigel Baillie metreckk at gmail.com
Tue Feb 26 18:19:26 CST 2019


Converting PIDLs to unixfs in ShellView is no longer necessary with
SHCNRF_InterruptLevel working properly. The conversion was a workaround
that fixed pasted items not showing up, but caused new folders to
sometimes not show up instead.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30752
Signed-off-by: Nigel Baillie <metreckk at gmail.com>
---
 dlls/shell32/shlview.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 478a78ee2d..56c40753ac 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -700,31 +700,17 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This)
     hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppf2);
     if (hr == S_OK)
     {
-        LPITEMIDLIST raw_pidl;
+        LPITEMIDLIST cur_folder_pidl;
         SHChangeNotifyEntry ntreg;
 
-        hr = IPersistFolder2_GetCurFolder(ppf2, &raw_pidl);
+        hr = IPersistFolder2_GetCurFolder(ppf2, &cur_folder_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.pidl = cur_folder_pidl;
             ntreg.fRecursive = TRUE;
-            This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNRF_InterruptLevel, SHCNE_ALLEVENTS,
+            This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNRF_InterruptLevel | SHCNRF_ShellLevel, SHCNE_ALLEVENTS,
                                                    SHV_CHANGE_NOTIFY, 1, &ntreg);
             SHFree((LPITEMIDLIST)ntreg.pidl);
-            SHFree(computer_pidl);
         }
         IPersistFolder2_Release(ppf2);
     }
-- 
2.20.1




More information about the wine-devel mailing list