From 2a493336bdba3d4022d6fff280da3b17756b6c70 Mon Sep 17 00:00:00 2001 From: Rolf Kalbermatter Date: Mon, 15 Sep 2003 22:09:46 +0000 Subject: [PATCH] SHChangeNotify should use SHSimpleIDListFromPath as this function should not fail on paths that do not exist anymore. --- dlls/shell32/changenotify.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index faf6a267c37..258f542d861 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -276,7 +276,6 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID { LPITEMIDLIST Pidls[2]; LPNOTIFICATIONLIST ptr; - DWORD dummy; UINT typeFlag = uFlags & SHCNF_TYPE; Pidls[0] = NULL; @@ -313,12 +312,12 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID 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 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID 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]); -- 2.11.4.GIT