shell32 (part4): Let SHChangeNotify use SHSimpleIDListFromPath instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changelog
  - dlls/shell32/pidl.c
    SHChangeNotify should use SHSimpleIDListFromPath as this function should not
    fail on paths that do not exist anymore, think about delete change notifications!
    (SHSimpleIDListFromPath does actually still the same as SHILCreateFromPath ATM,
    after the previous shell32 patches have been applied, but that is going to change)

License: X11/LGPL

Rolf Kalbermatter

Index: dlls/shell32/changenotify.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/changenotify.c,v
retrieving revision 1.26
diff -u -r1.26 changenotify.c
--- dlls/shell32/changenotify.c	5 Sep 2003 23:08:31 -0000	1.26
+++ dlls/shell32/changenotify.c	11 Sep 2003 18:03:17 -0000
@@ -276,7 +276,6 @@
 {
     LPITEMIDLIST Pidls[2];
     LPNOTIFICATIONLIST ptr;
-    DWORD dummy;
     UINT typeFlag = uFlags & SHCNF_TYPE;
 
     Pidls[0] = NULL;
@@ -313,12 +312,12 @@
     switch (typeFlag)
     {
     case SHCNF_PATHA:
-        if (dwItem1) SHILCreateFromPathA((LPCSTR)dwItem1, &Pidls[0], &dummy);
-        if (dwItem2) SHILCreateFromPathA((LPCSTR)dwItem2, &Pidls[1], &dummy);
+        if (dwItem1) Pidls[0] = SHSimpleIDListFromPathA((LPCSTR)dwItem1);
+        if (dwItem2) Pidls[1] = SHSimpleIDListFromPathA((LPCSTR)dwItem2);
         break;
     case SHCNF_PATHW:
-        if (dwItem1) SHILCreateFromPathW((LPCWSTR)dwItem1, &Pidls[0], &dummy);
-        if (dwItem2) SHILCreateFromPathW((LPCWSTR)dwItem2, &Pidls[1], &dummy);
+        if (dwItem1) Pidls[0] = SHSimpleIDListFromPathW((LPCWSTR)dwItem1);
+        if (dwItem2) Pidls[1] = SHSimpleIDListFromPathW((LPCWSTR)dwItem2);
         break;
     case SHCNF_IDLIST:
         Pidls[0] = (LPITEMIDLIST)dwItem1;
@@ -392,8 +391,8 @@
     TRACE("notify Done\n");
     LeaveCriticalSection(&SHELL32_ChangenotifyCS);
     
-    /* if we allocated it, free it */
-    if ((typeFlag == SHCNF_PATHA) || (typeFlag == SHCNF_PATHW))
+    /* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
+    if ((typeFlag & SHCNF_PATHA) || (typeFlag & SHCNF_PRINTERA))
     {
         if (Pidls[0]) SHFree(Pidls[0]);
         if (Pidls[1]) SHFree(Pidls[1]);




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux