Hi, There are still a whole set of RecycleBin APIs that need to be implemented to query and empty the trash but this should work for explorer sending files to the trash. Also note someone else will need to implement the RecycleBin ShellFolder.
Thanks Steven __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
? shell32.diff ? trashcan-20050414-2.diff ? trashcan-20050414.diff ? trashcan-4.13.05.patch2 ? dlls/advapi32/security.c.diff ? dlls/shell32/shfldr_trash.c ? dlls/shell32/trashcan-4.13.05.patch ? programs/shfld Index: dlls/shell32/folders.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/folders.c,v retrieving revision 1.59 diff -u -r1.59 folders.c --- dlls/shell32/folders.c 12 Apr 2005 12:00:40 -0000 1.59 +++ dlls/shell32/folders.c 14 Apr 2005 16:19:47 -0000 @@ -264,6 +264,8 @@ *piIndex = -IDI_SHELL_FOLDER; else if(IsEqualGUID(riid, &CLSID_NetworkPlaces)) *piIndex = -IDI_SHELL_MY_NETWORK_PLACES; + else if(IsEqualGUID(riid, &CLSID_RecycleBin)) + *piIndex = -IDI_SHELL_FOLDER; else *piIndex = -IDI_SHELL_FOLDER; } Index: dlls/shell32/regsvr.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/regsvr.c,v retrieving revision 1.8 diff -u -r1.8 regsvr.c --- dlls/shell32/regsvr.c 13 Apr 2005 11:07:49 -0000 1.8 +++ dlls/shell32/regsvr.c 14 Apr 2005 16:19:48 -0000 @@ -508,6 +508,12 @@ "shell32.dll", "Apartment" }, + { &CLSID_RecycleBin, + "RecycleBin", + NULL, + "shell32.dll", + "Apartment" + }, { NULL } /* list terminator */ }; Index: dlls/shell32/shell32_main.h =================================================================== RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v retrieving revision 1.95 diff -u -r1.95 shell32_main.h --- dlls/shell32/shell32_main.h 19 Mar 2005 17:08:52 -0000 1.95 +++ dlls/shell32/shell32_main.h 14 Apr 2005 16:19:48 -0000 @@ -93,6 +93,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI UnixFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); +HRESULT WINAPI RecycleBin_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); extern HRESULT CPanel_GetIconLocationW(LPITEMIDLIST, LPWSTR, UINT, int*); HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); Index: dlls/shell32/shellpath.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shellpath.c,v retrieving revision 1.100 diff -u -r1.100 shellpath.c --- dlls/shell32/shellpath.c 16 Mar 2005 11:37:46 -0000 1.100 +++ dlls/shell32/shellpath.c 14 Apr 2005 16:19:50 -0000 @@ -788,6 +788,7 @@ static const WCHAR ProgramFilesDirW[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r','\0'}; static const WCHAR ProgramsW[] = {'P','r','o','g','r','a','m','s','\0'}; static const WCHAR RecentW[] = {'R','e','c','e','n','t','\0'}; +static const WCHAR RecycledW[] = {'R','e','c','y','c','l','e','d,'\0'}; static const WCHAR ResourcesW[] = {'R','e','s','o','u','r','c','e','s','\0'}; static const WCHAR SendToW[] = {'S','e','n','d','T','o','\0'}; static const WCHAR StartUpW[] = {'S','t','a','r','t','U','p','\0'}; @@ -879,8 +880,8 @@ }, { /* 0x0a - CSIDL_BITBUCKET - Recycle Bin */ CSIDL_Type_Disallowed, - NULL, - NULL, + RecycledW, + NULL }, { /* 0x0b - CSIDL_STARTMENU */ CSIDL_Type_User, Index: dlls/shell32/shlfileop.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shlfileop.c,v retrieving revision 1.53 diff -u -r1.53 shlfileop.c --- dlls/shell32/shlfileop.c 21 Feb 2005 18:37:33 -0000 1.53 +++ dlls/shell32/shlfileop.c 14 Apr 2005 16:19:52 -0000 @@ -904,6 +904,9 @@ * implemented flags: * FOF_MULTIDESTFILES, FOF_NOCONFIRMATION, FOF_FILESONLY * + * implemented but not well tested + * FOF_ALLOWUNDO + * * unimplememented and ignored flags: * FOF_CONFIRMMOUSE, FOF_SILENT, FOF_NOCONFIRMMKDIR, * FOF_SIMPLEPROGRESS, FOF_NOCOPYSECURITYATTRIBS @@ -912,7 +915,7 @@ * FOF_RENAMEONCOLLISION * * unimplemented and break if any other flag set: - * FOF_ALLOWUNDO, FOF_WANTMAPPINGHANDLE + * FOF_WANTMAPPINGHANDLE */ static int shfileops_check_flags(SHFILEOPSTRUCTW nFileOp) @@ -925,7 +928,7 @@ debug_shfileops_action(FuncSwitch), level, nFileOp.fFlags); /* OFl &= (-1 - (FOF_MULTIDESTFILES | FOF_FILESONLY)); */ /* OFl ^= (FOF_SILENT | FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS | FOF_NOCONFIRMMKDIR); */ - OFl &= (~(FOF_MULTIDESTFILES | FOF_NOCONFIRMATION | FOF_FILESONLY)); /* implemented */ + OFl &= (~(FOF_ALLOWUNDO | FOF_MULTIDESTFILES | FOF_NOCONFIRMATION | FOF_FILESONLY)); /* implemented */ OFl ^= (FOF_SILENT | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_NOCOPYSECURITYATTRIBS); /* ignored, if one */ OFl &= (~FOF_SIMPLEPROGRESS); /* ignored, only with FOF_SILENT */ if (OFl) @@ -1163,6 +1166,31 @@ /* for all */ /* ??? b_Mask = (!SHFileStrICmpA(&pFromFile[1], &wfd.cFileName[0], HIGH_ADR, HIGH_ADR)); */ + + if(!pTo && nFileOp.fFlags == FOF_ALLOWUNDO) /* Move to the trash */ + { + /* At the momemnt this assumes you have C:\Trash */ + static WCHAR wTrashFile[MAX_PATH] = {'C',':','\\','T','r','a','s','h'}; + WCHAR *pTrashed; + pTrashed = wTrashFile; + + /* Create the new filename+location for once we live in the trash */ + PathAppendW(pTrashed, pFromFile); + TRACE("Filename once we trash %p\n", debugstr_w(pTrashed)); + + /* FIXME: Our behavior differs in that we always move to trash on + * FOF_ALLOWUNDO where Windows only does if you give the full path + */ + /* we use SHNotifyMoveFile() instead MoveFileW */ + + if (SHNotifyMoveFileW(pFrom, wTrashFile) != ERROR_SUCCESS) + { + /* we need still the value for the returncode, we use the mostly assumed */ + retCode = ERROR_ALREADY_EXISTS; + goto shfileop_end; + } + } + if (!pTo) /* FO_DELETE */ { retCode = shfileops_delete(&wfd,nFileOp,pFromFile,pTempFrom,&hFind); Index: tools/wineprefixcreate.in =================================================================== RCS file: /home/wine/wine/tools/wineprefixcreate.in,v retrieving revision 1.7 diff -u -r1.7 wineprefixcreate.in --- tools/wineprefixcreate.in 16 Dec 2004 14:22:37 -0000 1.7 +++ tools/wineprefixcreate.in 14 Apr 2005 16:19:55 -0000 @@ -132,7 +132,8 @@ "$CROOT/windows/Start Menu/Programs" \ "$CROOT/windows/Start Menu/Programs/Startup" \ "$CROOT/windows/system" \ - "$CROOT/windows/temp" + "$CROOT/windows/temp" \ + "$CROOT/trash" do [ -d "$i" ] || mkdir "$i" done