Changelog * dlls/shell32/changenotify.c * dlls/shell32/shfldr_fs.c * dlls/shell32/shlfileop.c * include/shlobj.h * dlls/shell32/shell32.spec Change SHChangeNotify to be Unicode and ANSI indifferent, as the type of parameters is really defined by uFlags parameter License: X11/LGPL Rolf Kalbermatter Index: dlls/shell32/changenotify.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/changenotify.c,v retrieving revision 1.19 diff -u -r1.19 changenotify.c --- dlls/shell32/changenotify.c 13 Dec 2002 00:36:52 -0000 1.19 +++ dlls/shell32/changenotify.c 20 Jan 2003 20:39:18 -0000 @@ -185,8 +185,7 @@ * SHChangeNotifyDeregister [SHELL32.4] */ BOOL WINAPI -SHChangeNotifyDeregister( - HANDLE hNotify) +SHChangeNotifyDeregister(HANDLE hNotify) { TRACE("(%p)\n",hNotify); @@ -209,50 +208,7 @@ /************************************************************************* * SHChangeNotify [SHELL32.@] */ -void WINAPI SHChangeNotifyW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) -{ - LPITEMIDLIST pidl1=(LPITEMIDLIST)dwItem1, pidl2=(LPITEMIDLIST)dwItem2; - LPNOTIFICATIONLIST ptr; - - TRACE("(0x%08lx,0x%08x,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2); - - /* convert paths in IDLists*/ - if(uFlags & SHCNF_PATHA) - { - DWORD dummy; - if (dwItem1) SHILCreateFromPathA((LPCSTR)dwItem1, &pidl1, &dummy); - if (dwItem2) SHILCreateFromPathA((LPCSTR)dwItem2, &pidl2, &dummy); - } - - EnterCriticalSection(&SHELL32_ChangenotifyCS); - - /* loop through the list */ - ptr = head.next; - while(ptr != &tail) - { - TRACE("trying %p\n", ptr); - - if(wEventId & ptr->wEventMask) - { - TRACE("notifying\n"); - SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM)pidl1, (LPARAM)pidl2); - } - ptr = ptr->next; - } - - LeaveCriticalSection(&SHELL32_ChangenotifyCS); - - if(uFlags & SHCNF_PATHA) - { - if (pidl1) SHFree(pidl1); - if (pidl2) SHFree(pidl2); - } -} - -/************************************************************************* - * SHChangeNotify [SHELL32.@] - */ -void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) +void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) { LPITEMIDLIST Pidls[2]; LPNOTIFICATIONLIST ptr; @@ -263,22 +219,32 @@ TRACE("(0x%08lx,0x%08x,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2); /* convert paths in IDLists*/ - if(uFlags & SHCNF_PATHA) + if (uFlags & SHCNF_PATHA) { DWORD dummy; - if (Pidls[0]) SHILCreateFromPathA((LPCSTR)dwItem1, &Pidls[0], &dummy); - if (Pidls[1]) SHILCreateFromPathA((LPCSTR)dwItem2, &Pidls[1], &dummy); + if (dwItem1) SHILCreateFromPathA((LPCSTR)dwItem1, &Pidls[0], &dummy); + if (dwItem2) SHILCreateFromPathA((LPCSTR)dwItem2, &Pidls[1], &dummy); + } + else if (uFlags & SHCNF_PATHW) + { + DWORD dummy; + if (dwItem1) SHILCreateFromPathW((LPCSTR)dwItem1, &Pidls[0], &dummy); + if (dwItem2) SHILCreateFromPathW((LPCSTR)dwItem2, &Pidls[1], &dummy); + } + else if (uFlags & (SHCNF_PRINTERW || SHCNF_PRINTERW) + { + FIXME("SHChangeNotify with (uFlags & SHCNF_PRINTER)"); } EnterCriticalSection(&SHELL32_ChangenotifyCS); /* loop through the list */ ptr = head.next; - while(ptr != &tail) + while (ptr != &tail) { TRACE("trying %p\n", ptr); - if(wEventId & ptr->wEventMask) + if (wEventId & ptr->wEventMask) { TRACE("notifying\n"); SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM)&Pidls, (LPARAM)wEventId); @@ -289,22 +255,11 @@ LeaveCriticalSection(&SHELL32_ChangenotifyCS); /* if we allocated it, free it */ - if(uFlags & SHCNF_PATHA) + if (uFlags & SHCNF_PATHA || uFlags & SHCNF_PATHW) { - if (Pidls[0]) SHFree(Pidls[0]); - if (Pidls[1]) SHFree(Pidls[1]); + if (Pidls[0]) SHFree(Pidls[0]); + if (Pidls[1]) SHFree(Pidls[1]); } -} - -/************************************************************************* - * SHChangeNotify [SHELL32.@] - */ -void WINAPI SHChangeNotifyAW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) -{ - if(SHELL_OsIsUnicode()) - SHChangeNotifyW (wEventId, uFlags, dwItem1, dwItem2); - else - SHChangeNotifyA (wEventId, uFlags, dwItem1, dwItem2); } /************************************************************************* Index: dlls/shell32/shfldr_fs.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shfldr_fs.c,v retrieving revision 1.7 diff -u -r1.7 shfldr_fs.c --- dlls/shell32/shfldr_fs.c 7 Jan 2003 20:36:24 -0000 1.7 +++ dlls/shell32/shfldr_fs.c 20 Jan 2003 20:50:08 -0000 @@ -706,7 +706,7 @@ if (MoveFileA (szSrc, szDest)) { if (pPidlOut) *pPidlOut = SHSimpleIDListFromPathA (szDest); - SHChangeNotifyA (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest); + SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM, SHCNF_PATHA, szSrc, szDest); return S_OK; } return E_FAIL; @@ -940,7 +940,7 @@ pidlitem = SHSimpleIDListFromPathA (lpstrNewDir); pidl = ILCombine (This->pidlRoot, pidlitem); - SHChangeNotifyA (SHCNE_MKDIR, SHCNF_IDLIST, pidl, NULL); + SHChangeNotify (SHCNE_MKDIR, SHCNF_IDLIST, pidl, NULL); SHFree (pidl); if (ppidlOut) @@ -999,7 +999,7 @@ return E_FAIL; } pidl = ILCombine (This->pidlRoot, apidl[i]); - SHChangeNotifyA (SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL); + SHChangeNotify (SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL); SHFree (pidl); } else if (_ILIsValue (apidl[i])) { LPITEMIDLIST pidl; @@ -1010,7 +1010,7 @@ return E_FAIL; } pidl = ILCombine (This->pidlRoot, apidl[i]); - SHChangeNotifyA (SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL); + SHChangeNotify (SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL); SHFree (pidl); } Index: dlls/shell32/shlfileop.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shlfileop.c,v retrieving revision 1.22 diff -u -r1.22 shlfileop.c --- dlls/shell32/shlfileop.c 19 Dec 2002 04:11:22 -0000 1.22 +++ dlls/shell32/shlfileop.c 20 Jan 2003 20:52:09 -0000 @@ -141,7 +141,7 @@ TRACE("(%p,%s)\n",sec,path); if ((ret = CreateDirectoryA(path,sec))) { - SHChangeNotifyA(SHCNE_MKDIR, SHCNF_PATHA, path, NULL); + SHChangeNotify(SHCNE_MKDIR, SHCNF_PATHA, path, NULL); } return ret; } @@ -152,17 +152,15 @@ * Deletes a file. Also triggers a change notify if one exists. * * FIXME: - * Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be - * ANSI. Is this Unicode on NT? - * + * Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI. + * This is Unicode on NT/2000 */ - BOOL WINAPI Win32DeleteFile(LPSTR fName) { TRACE("%p(%s)\n", fName, fName); DeleteFileA(fName); - SHChangeNotifyA(SHCNE_DELETE, SHCNF_PATHA, fName, NULL); + SHChangeNotify(SHCNE_DELETE, SHCNF_PATHA, fName, NULL); return TRUE; } Index: include/shlobj.h =================================================================== RCS file: /home/wine/wine/include/shlobj.h,v retrieving revision 1.57 diff -u -r1.57 shlobj.h --- include/shlobj.h 3 Jan 2003 03:07:21 -0000 1.57 +++ include/shlobj.h 20 Jan 2003 20:46:02 -0000 @@ -495,9 +495,7 @@ #define SHCNF_FLUSH 0x1000 #define SHCNF_FLUSHNOWAIT 0x2000 -void WINAPI SHChangeNotifyA(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2); -void WINAPI SHChangeNotifyW(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2); -#define SHChangeNotify WINELIB_NAME_AW(SHChangeNotify) +void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2); /**************************************************************************** * SHGetSpecialFolderLocation API Index: dlls/shell32/shell32.spec =================================================================== RCS file: /home/wine/wine/dlls/shell32/shell32.spec,v retrieving revision 1.61 diff -u -r1.61 shell32.spec --- dlls/shell32/shell32.spec 13 Dec 2002 02:17:54 -0000 1.61 +++ dlls/shell32/shell32.spec 20 Jan 2003 20:42:50 -0000 @@ -68,7 +68,7 @@ 74 stdcall SHCreateStdEnumFmtEtc(long ptr ptr) SHCreateStdEnumFmtEtc 75 stdcall PathYetAnotherMakeUniqueName(ptr ptr ptr ptr) PathYetAnotherMakeUniqueNameA 76 stub DragQueryInfo - 77 stdcall SHMapPIDLToSystemImageListIndex(long long long) SHMapPIDLToSystemImageListIndex + 77 stdcall SHMapPIDLToSystemImageListIndex(ptr ptr ptr) SHMapPIDLToSystemImageListIndex 78 stdcall OleStrToStrN(str long wstr long) OleStrToStrNAW 79 stdcall StrToOleStrN(wstr long str long) StrToOleStrNAW 80 stdcall DragFinish(long) DragFinish @@ -79,7 +79,7 @@ 85 forward OpenRegStream shlwapi.SHOpenRegStreamA 86 stdcall SHRegisterDragDrop(long ptr) SHRegisterDragDrop 87 stdcall SHRevokeDragDrop(long) SHRevokeDragDrop - 88 stdcall SHDoDragDrop(long long long long long) SHDoDragDrop + 88 stdcall SHDoDragDrop(long ptr ptr long ptr) SHDoDragDrop 89 stdcall SHCloneSpecialIDList(long long long) SHCloneSpecialIDList 90 stub SHFindFiles 91 stub SHFindComputer @@ -87,7 +87,7 @@ 93 stub Win32CreateDirectory 94 stub Win32RemoveDirectory 95 stdcall SHLogILFromFSIL (ptr) SHLogILFromFSIL - 96 stdcall StrRetToStrN (long long long long) StrRetToStrNAW + 96 stdcall StrRetToStrN (ptr long ptr ptr) StrRetToStrNAW 97 stdcall SHWaitForFileToOpen (long long long) SHWaitForFileToOpen 98 stdcall SHGetRealIDL (long long long) SHGetRealIDL 99 stdcall SetAppStartingCursor (long long) SetAppStartingCursor @@ -354,7 +354,7 @@ @ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA @ stdcall SHBrowseForFolderA(ptr) SHBrowseForFolderA @ stdcall SHBrowseForFolderW(ptr) SHBrowseForFolderW -@ stdcall SHChangeNotify (long long ptr ptr) SHChangeNotifyAW +@ stdcall SHChangeNotify (long long ptr ptr) SHChangeNotify @ stub ShellHookProc @ stub SHEmptyRecycleBinA@12 @ stub SHEmptyRecycleBinW@12 @@ -371,8 +371,8 @@ @ stdcall SHGetMalloc(ptr)SHGetMalloc @ stub SHGetNewLinkInfo@20 @ stdcall SHGetPathFromIDList(ptr ptr)SHGetPathFromIDListAW -@ stdcall SHGetPathFromIDListA(long long)SHGetPathFromIDListA -@ stdcall SHGetPathFromIDListW(long long)SHGetPathFromIDListW +@ stdcall SHGetPathFromIDListA(ptr ptr)SHGetPathFromIDListA +@ stdcall SHGetPathFromIDListW(ptr ptr)SHGetPathFromIDListW @ stdcall SHGetSettings(ptr long) SHGetSettings @ stdcall SHGetSpecialFolderLocation(long long ptr)SHGetSpecialFolderLocation @ stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLL