reactos/reactos/dll/win32/shell32/shfldr_desktop.c

1488 lines
46 KiB
C
Raw Normal View History

/*
* Virtual Desktop Folder
*
* Copyright 1997 Marcus Meissner
* Copyright 1998, 1999, 2002 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <precomp.h>
WINE_DEFAULT_DEBUG_CHANNEL (shell);
/***********************************************************************
* Desktopfolder implementation
*/
typedef struct {
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
const IShellFolder2Vtbl *lpVtbl;
const IPersistFolder2Vtbl *lpPF2;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
const ISFHelperVtbl *lpvtblSFHelper;
Sync to Wine-20050725: Michael Jung <mjung@iss.tu-darmstadt.de> - Initial support for the IPersistFolder3 interface. - Use CP_UNIXCP instead of CP_ACP when converting paths (Pointed out by Troy Rollo). - Add file type column in detailed shell view. - Make the order of shell view columns 'prefix-compatible' with shfldr_fs. - Don't remove filename extensions for path pidls in GetDisplayNameOf. - Do filename postprocessing in GetDisplayNameOf (Hide filename extensions if appropriate). - Don't cache child pidls in UnixFolder, but create them on the fly. - Don't use unix filesystem specific attributes in UnixFolder's pidls. - Partially implemented UnixFolder's ISFHelper::CopyItems method. - Return correct HRESULT code in UnixFolder's IEnumIDList::Next. - Corresponding test. - Release shell folders only if they were successfully acquired. - Implemented UnixFolder's ISFHelper::DeleteItems interface. - Fail in SHGetDataFromIDList when called on special folder. - Return correct attributes in ParseDisplayName. - Register unixfs at desktop level in DllRegisterServer. - Fix two more corner cases in UNIXFS_get_unix_path and UNIXFS_path_to_pidl. - If the unixfs is rooted at the Desktop folder, forward ParseDisplayName calls to it instead of to MyComputer. - Only initialize shell folders via the IPersistFolder3 interface in SHELL32_CoCreateInitSF if the pidl which specifies the child is of type 'Folder'. Otherwise fall back to IPersistFolder. - Append filename extension if necessary in IShellFolder::SetNameOf. - Release parent shell folder in GetAttributesOf. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Robert Shearman <rob@codeweavers.com> - Implement ShellDDEInit. Michael Lin <mlin@corvu.com.au> Michael Jung <mjung@iss.tu-darmstadt.de> - Implemented UnixFolder's ISFHelper::AddFolder. - ISFHelper interface support for UnixFolder (currently only stubs). - Implemented UnixFolder's IShellFolder::SetNameOf. Vincent Béron <vberon@mecano.gme.usherb.ca> - Remove multiple declarations of the same function, keeping the public one as reference. Mike McCormack <mike@codeweavers.com> - gcc 4.0 -Wpointer-sign fixes (Reg* functions). - -Wpointer-sign fixes. Troy Rollo <wine@troy.rollo.name> - Return attributes for the correct file in the unixfs ParseDisplayName. - When using PATHMODE_UNIX, all files are in the file system. Marcelo Duarte <marcelotduarte@gmail.com> - Update shell32 resources for Portuguese. Detlef Riekenberg <wine.dev@web.de> - Printers_RegisterWindowW / Printers_UnregisterWindow implemented as stub. - Show the FIXME in Printer_LoadIconsW only when needed. - Printer_LoadIconsW: implemented minimal version. svn path=/trunk/; revision=17338
2005-08-12 18:04:51 +00:00
LONG ref;
/* both paths are parsible from the desktop */
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
LPITEMIDLIST pidlRoot; /* absolute pidl */
UINT cfShellIDList; /* clipboardformat for IDropTarget */
BOOL fAcceptFmt; /* flag for pending Drop */
} IGenericSFImpl, *LPIGenericSFImpl;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls);
int SHELL_ConfirmMsgBox(HWND hWnd, LPWSTR lpszText, LPWSTR lpszCaption, HICON hIcon, BOOL bYesToAll);
#define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
static const shvheader DesktopSFHeader[] = {
{IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
{IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN4, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12},
{IDS_SHV_COLUMN5, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5}
};
#define DESKTOPSHELLVIEWCOLUMNS 5
/**************************************************************************
* ISF_Desktop_fnQueryInterface
*
* NOTES supports not IPersist/IPersistFolder
*/
static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
*ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IShellFolder) ||
IsEqualIID (riid, &IID_IShellFolder2))
{
*ppvObj = This;
}
else if (IsEqualIID (riid, &IID_IPersistFolder) ||
IsEqualIID (riid, &IID_IPersistFolder2))
{
*ppvObj = (void *)&This->lpPF2;
}
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
else if (IsEqualIID(riid, &IID_ISFHelper))
{
*ppvObj = (void *)&This->lpvtblSFHelper;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
}
if (*ppvObj)
{
IUnknown_AddRef ((IUnknown *) (*ppvObj));
TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
return S_OK;
}
TRACE ("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
static LPIGenericSFImpl __inline impl_from_ISFHelper( ISFHelper *iface )
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
{
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpvtblSFHelper));
}
static ULONG WINAPI ISF_Desktop_fnAddRef (IShellFolder2 * iface)
{
return 2; /* non-heap based object */
}
static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
{
return 1; /* non-heap based object */
}
/**************************************************************************
* ISF_Desktop_fnParseDisplayName
*
* NOTES
* "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and "" binds
* to MyComputer
*/
static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
WCHAR szElement[MAX_PATH];
LPCWSTR szNext = NULL;
LPITEMIDLIST pidlTemp = NULL;
HRESULT hr = S_OK;
CLSID clsid;
TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
pchEaten, ppidl, pdwAttributes);
if (!lpszDisplayName || !ppidl)
return E_INVALIDARG;
*ppidl = 0;
if (pchEaten)
*pchEaten = 0; /* strange but like the original */
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
{
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement));
CLSIDFromString (szElement + 2, &clsid);
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
}
else if (PathGetDriveNumberW (lpszDisplayName) >= 0)
{
/* it's a filesystem path with a drive. Let MyComputer/UnixDosFolder parse it */
#if 0
if (UNIXFS_is_rooted_at_desktop())
pidlTemp = _ILCreateGuid(PT_GUID, &CLSID_UnixDosFolder);
else
#endif
pidlTemp = _ILCreateMyComputer ();
szNext = lpszDisplayName;
}
else if (PathIsUNCW(lpszDisplayName))
{
pidlTemp = _ILCreateNetwork();
szNext = lpszDisplayName;
}
else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) )
{
*ppidl = pidlTemp;
return S_OK;
}
else
{
/* it's a filesystem path on the desktop. Let a FSFolder parse it */
if (*lpszDisplayName)
{
WCHAR szPath[MAX_PATH];
LPWSTR pathPtr;
/* build a complete path to create a simple pidl */
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
lstrcpynW(szPath, This->sPathTarget, MAX_PATH);
pathPtr = PathAddBackslashW(szPath);
if (pathPtr)
{
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath));
hr = _ILCreateFromPathW(szPath, &pidlTemp);
}
else
{
/* should never reach here, but for completeness */
hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
}
}
else
pidlTemp = _ILCreateMyComputer();
szNext = NULL;
}
if (SUCCEEDED(hr) && pidlTemp)
{
if (szNext && *szNext)
{
hr = SHELL32_ParseNextElement(iface, hwndOwner, pbc,
&pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
}
else
{
if (pdwAttributes && *pdwAttributes)
hr = SHELL32_GetItemAttributes(_IShellFolder_ (This),
pidlTemp, pdwAttributes);
}
}
*ppidl = pidlTemp;
TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
return hr;
}
static const WCHAR ClassicStartMenuW[] = {'S','O','F','T','W','A','R','E','\\',
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r',
'\\','H','i','d','e','D','e','s','k','t','o','p','I','c','o','n','s','\\',
'C','l','a','s','s','i','c','S','t','a','r','t','M','e','n','u','\0' };
INT
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
IsNamespaceExtensionHidden(WCHAR *iid)
{
DWORD Result, dwResult;
dwResult = sizeof(DWORD);
if (RegGetValueW(HKEY_CURRENT_USER, /* FIXME use NewStartPanel when activated */
ClassicStartMenuW,
iid,
RRF_RT_DWORD,
NULL,
&Result,
&dwResult) != ERROR_SUCCESS)
{
return -1;
}
return Result;
}
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
static
VOID
SetNamespaceExtensionVisibleStatus(WCHAR * iid, DWORD dwStatus)
{
HKEY hKey;
if (RegOpenKeyExW(HKEY_CURRENT_USER, ClassicStartMenuW, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
{
RegSetValueExW(hKey, iid, 0, REG_DWORD, (LPBYTE)&dwStatus, sizeof(DWORD));
RegCloseKey(hKey);
}
}
/**************************************************************************
* CreateDesktopEnumList()
*/
static const WCHAR Desktop_NameSpaceW[] = { 'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l',
'o','r','e','r','\\','D','e','s','k','t','o','p','\\','N','a','m','e','s','p',
'a','c','e','\0' };
static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags)
{
BOOL ret = TRUE;
WCHAR szPath[MAX_PATH];
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
static WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
TRACE("(%p)->(flags=0x%08x)\n", list, dwFlags);
/* enumerate the root folders */
if (dwFlags & SHCONTF_FOLDERS)
{
HKEY hkey;
UINT i;
DWORD dwResult;
/* create the pidl for This item */
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
{
ret = AddToEnumList(list, _ILCreateMyDocuments());
}
ret = AddToEnumList(list, _ILCreateMyComputer());
for (i = 0; i < 2; i++)
{
if (i == 0)
dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Desktop_NameSpaceW, 0, KEY_READ, &hkey);
else
dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, Desktop_NameSpaceW, 0, KEY_READ, &hkey);
if (dwResult == ERROR_SUCCESS)
{
WCHAR iid[50];
LPITEMIDLIST pidl;
int i=0;
while (ret)
{
DWORD size;
LONG r;
size = sizeof (iid) / sizeof (iid[0]);
r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL);
if (ERROR_SUCCESS == r)
{
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
if (IsNamespaceExtensionHidden(iid) < 1)
{
pidl = _ILCreateGuidFromStrW(iid);
if (!HasItemWithCLSID(list, pidl))
{
ret = AddToEnumList(list, pidl);
}
else
{
SHFree(pidl);
}
}
}
else if (ERROR_NO_MORE_ITEMS == r)
break;
else
ret = FALSE;
i++;
}
RegCloseKey(hkey);
}
}
for (i = 0; i < 2; i++)
{
if (i == 0)
dwResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE, ClassicStartMenuW, 0, KEY_READ, &hkey);
else
dwResult = RegOpenKeyExW(HKEY_CURRENT_USER, ClassicStartMenuW, 0, KEY_READ, &hkey);
if (dwResult == ERROR_SUCCESS)
{
DWORD j = 0, dwVal, Val, dwType, dwIID;
LONG r;
WCHAR iid[50];
while(ret)
{
dwVal = sizeof(Val);
dwIID = sizeof(iid) / sizeof(WCHAR);
r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
if (r == ERROR_SUCCESS)
{
if (Val == 0 && dwType == REG_DWORD)
{
LPITEMIDLIST pidl = _ILCreateGuidFromStrW(iid);
if (!HasItemWithCLSID(list, pidl))
{
AddToEnumList(list, pidl);
}
else
{
SHFree(pidl);
}
}
}
else if (ERROR_NO_MORE_ITEMS == r)
break;
else
ret = FALSE;
}
}
}
}
/* enumerate the elements in %windir%\desktop */
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
ret = ret && CreateFolderEnumList(list, szPath, dwFlags);
ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_COMMON_DESKTOPDIRECTORY, FALSE);
ret = ret && CreateFolderEnumList(list, szPath, dwFlags);
return ret;
}
/**************************************************************************
* ISF_Desktop_fnEnumObjects
*/
static HRESULT WINAPI ISF_Desktop_fnEnumObjects (IShellFolder2 * iface,
HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n",
This, hwndOwner, dwFlags, ppEnumIDList);
*ppEnumIDList = IEnumIDList_Constructor();
if (*ppEnumIDList)
CreateDesktopEnumList(*ppEnumIDList, dwFlags);
TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
return *ppEnumIDList ? S_OK : E_OUTOFMEMORY;
}
/**************************************************************************
* ISF_Desktop_fnBindToObject
*/
static HRESULT WINAPI ISF_Desktop_fnBindToObject (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
Vitaliy Margolen <wine-patch@kievinfo.com> - Michael Jung <mjung@iss.tu-darmstadt.de> Set all capability flags supported by the shellfolder, disregarding the flag mask given to GetAttributesOf. Unit tests to demonstrate this behaviour. Michael Jung <mjung@iss.tu-darmstadt.de> - Added some comments to document unixfs. - Fixed crash in unixfs shellfolder handling with winamp. - Implemented UnixFolder's IPersistPropertyBag::Load method. - Initialize COM prior to displaying the SHBrowseForFolder dialog. - More robust code for querying ShellFolder attributes (some ShellFolders ignore the flag mask in GetAttributesOf). - Remove iconcache pre-initialization hack, it's not necessary any more. - Move target folder initialization to a dedicated function. - Use this function in BindToObject (should be faster). - Special handling for FolderShortcut objects in Initialize method. - Removed a todo_wine from a no longer failing unit test. - Replaced tabs with spaces. Robert Shearman <rob@codeweavers.com> - Convert SHELL32_BindToChild to Unicode and fix up the callers. Vincent Bén <vberon@mecano.gme.usherb.ca> - Unicodify systray.c. - Move functions a bit to get rid of a static declaration. Dmitry Timoshkov <dmitry@codeweavers.com> - Correctly handle flags parameter in SHAddToRecentDocs. Martin Fuchs <martin-fuchs@gmx.net> - Correct WINAPI position for MSVC portability. Mike McCormack <mike@codeweavers.com> - Partially implement and test the shelllink object's IShellLinkDataList::CopyDataBlock and GetFlags methods. - Use advapi32.CommandLineFromMsiDescriptor to get msi component paths. - Pass the correct verb. Add a space between extra parameters. Wait for ShellExecute to complete. - Handle MSI advertised shortcuts in the shelllink object. - Implement IContextMenu::QueryContextMenu and IContextMenu::InvokeCommand. - Add the IObjectWithSite interface. - Invoke shortcuts through IContextMenu, rather than trying to access them directly. - Fix a problem spotted by Dmitry and another one stopping correctly formatted lnk files from being generated. svn path=/trunk/; revision=19356
2005-11-20 08:41:46 +00:00
return SHELL32_BindToChild( This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut );
}
/**************************************************************************
* ISF_Desktop_fnBindToStorage
*/
static HRESULT WINAPI ISF_Desktop_fnBindToStorage (IShellFolder2 * iface,
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n",
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
*ppvOut = NULL;
return E_NOTIMPL;
}
/**************************************************************************
* ISF_Desktop_fnCompareIDs
*/
static HRESULT WINAPI ISF_Desktop_fnCompareIDs (IShellFolder2 * iface,
LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
int nReturn;
TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2);
TRACE ("-- %i\n", nReturn);
return nReturn;
}
/**************************************************************************
* ISF_Desktop_fnCreateViewObject
*/
static HRESULT WINAPI ISF_Desktop_fnCreateViewObject (IShellFolder2 * iface,
HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPSHELLVIEW pShellView;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(hwnd=%p,%s,%p)\n",
This, hwndOwner, shdebugstr_guid (riid), ppvOut);
if (!ppvOut)
return hr;
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IDropTarget))
{
WARN ("IDropTarget not implemented\n");
hr = E_NOTIMPL;
}
else if (IsEqualIID (riid, &IID_IContextMenu))
{
WARN ("IContextMenu not implemented\n");
hr = E_NOTIMPL;
}
else if (IsEqualIID (riid, &IID_IShellView))
{
pShellView = IShellView_Constructor ((IShellFolder *) iface);
if (pShellView)
{
hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
IShellView_Release (pShellView);
}
}
TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetAttributesOf
*/
static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface,
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
static const DWORD dwDesktopAttributes =
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR |
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
static const DWORD dwMyComputerAttributes =
Sync to Wine-0_9_3: Michael Jung <mjung@iss.tu-darmstadt.de> - Use the ANSI codepage in IShellFolder::GetDisplayNameOf. - Implemented scrolling during drag&drop for the shellview class. - Use GetUIObjectOf instead of BindToObject to get a IDropTarget object. - Register the shell view itself as the drop target, not it's parent folder. Forward drag&drop method calls to the folder currently under the cursor. - Initialize OLE instead of just COM, in order to enable Drag & Drop. - Modified KeyStateToDropEffect macro to match native shellview's behaviour. - Also scan HKEY_CURRENT_USER for shell namespace extensions in Desktop folder. Fixed a handle leak in case of failing AddToEnumList call. - Also scan HKEY_CURRENT_USER for shell namespace extensions in MyComputer. - Enhanced UnixFolder's IDropTarget implementation. Use STATIC_CAST macro more consistently. - Initial stubbed implementation of UnixFolder's IDropTarget interface. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Ge van Geldorp <gvg@reactos.org> - Load shortcut icon by resource id instead of by icon index. - Other code in shlexec.c (e.g. the extension handling code in ShellExecute_GetClassKey) expects sei->lpFile to not be enclosed in quotes. Martin Fuchs <martin-fuchs@gmx.net> - Correctly call HCR_GetFolderAttributes() in SHELL32_GetItemAttributes(). Directly return the correct "My Computer" attributes in ISF_Desktop_fnGetAttributesOf(). Remove "todo_wine" from the "My Computer" attributes test case. Add test case for retrieving the file system path from the CSIDL_PROGRAM_FILES PIDL using SHGetPathFromIDListW(). - Fix context menu handling for more than one entry in order to repair .lnk-file execution: Don't break at the first non-matching entry. Markus Gömmel <m.goemmel@compulab.de> - Added CSIDL_MYVIDEO|MYPICTURES|MYMUSIC to _SHRegisterUserShellFolders. svn path=/trunk/; revision=20168
2005-12-14 19:09:44 +00:00
SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET |
SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
Ge van Geldorp <gvg@reactos.com> - Overlay icons for .lnk files with a small arrow in the lower left corner. Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Fixes to IShellFolder::GetAttributesOf implementations, spotted by silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return - only log unsupported flags in ShellExecute - environment variables are expanded, so SEE_MASK_DOENVSUBST is supported Michael Jung <mjung@iss.tu-darmstadt.de> - Add a new CLSID for UnixDosFolder, which is identical to UnixFolder, but does unix <-> dos path conversion for GetDisplayNameOf and ParseDisplayName. - Make the root of the shell extension map to the root of the unix filesystem. - More robustly query the SHGDN_FORPARSING flag in the shell32's folders GetDisplayNameOf methods. - Fixed GetDisplayNameOf method to not depend on incorrect behaviour regarding the SHGDN_INFOLDER flag. - Fixed MyComputer's GetDisplayNameOf method. - Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. - Fixed incorrect IShellFolder::EnumOjects API usage. - Support for regular files (as opposed to directories). - Display a drive icon for the unix root directory. - Consider only the GIL_FORSHORTCUT flag in SIC_CompareEntries. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Mike McCormack <mike@codeweavers.com> - Split SHGetFileInfoW into two functions. - Remove static variables in SHBrowseForFolder implementation. - Split up the window procedure. - Remove some unused include files. - MSI advertised shortcuts don't require a product ID. Peter Berg Larsen <pebl@math.ku.dk> - Rewritten DoEnvironmentSubst16. Kouji Sasaki <taro-x@justsystem.co.jp> - Added the processing for determination of SFGAO_HASSUBFOLDER flag in SHELL32_GetItemAttribute function. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - It makes no sense to have a left pointing arrow as the desktop icon. Replace it with something more appropiate. Mike Hearn <mh@codeweavers.com> - Fix SHELL_GetPathFromIDList[AW] to return the desktop path given an empty PIDL. svn path=/trunk/; revision=15617
2005-05-28 21:30:32 +00:00
This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
Ge van Geldorp <gvg@reactos.com> - Overlay icons for .lnk files with a small arrow in the lower left corner. Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Fixes to IShellFolder::GetAttributesOf implementations, spotted by silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return - only log unsupported flags in ShellExecute - environment variables are expanded, so SEE_MASK_DOENVSUBST is supported Michael Jung <mjung@iss.tu-darmstadt.de> - Add a new CLSID for UnixDosFolder, which is identical to UnixFolder, but does unix <-> dos path conversion for GetDisplayNameOf and ParseDisplayName. - Make the root of the shell extension map to the root of the unix filesystem. - More robustly query the SHGDN_FORPARSING flag in the shell32's folders GetDisplayNameOf methods. - Fixed GetDisplayNameOf method to not depend on incorrect behaviour regarding the SHGDN_INFOLDER flag. - Fixed MyComputer's GetDisplayNameOf method. - Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. - Fixed incorrect IShellFolder::EnumOjects API usage. - Support for regular files (as opposed to directories). - Display a drive icon for the unix root directory. - Consider only the GIL_FORSHORTCUT flag in SIC_CompareEntries. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Mike McCormack <mike@codeweavers.com> - Split SHGetFileInfoW into two functions. - Remove static variables in SHBrowseForFolder implementation. - Split up the window procedure. - Remove some unused include files. - MSI advertised shortcuts don't require a product ID. Peter Berg Larsen <pebl@math.ku.dk> - Rewritten DoEnvironmentSubst16. Kouji Sasaki <taro-x@justsystem.co.jp> - Added the processing for determination of SFGAO_HASSUBFOLDER flag in SHELL32_GetItemAttribute function. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - It makes no sense to have a left pointing arrow as the desktop icon. Replace it with something more appropiate. Mike Hearn <mh@codeweavers.com> - Fix SHELL_GetPathFromIDList[AW] to return the desktop path given an empty PIDL. svn path=/trunk/; revision=15617
2005-05-28 21:30:32 +00:00
if (!rgfInOut)
return E_INVALIDARG;
if (cidl && !apidl)
return E_INVALIDARG;
if (*rgfInOut == 0)
*rgfInOut = ~0;
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
if(cidl == 0) {
*rgfInOut &= dwDesktopAttributes;
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
} else {
while (cidl > 0 && *apidl) {
pdump (*apidl);
if (_ILIsDesktop(*apidl)) {
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
*rgfInOut &= dwDesktopAttributes;
Sync to Wine-0_9_3: Michael Jung <mjung@iss.tu-darmstadt.de> - Use the ANSI codepage in IShellFolder::GetDisplayNameOf. - Implemented scrolling during drag&drop for the shellview class. - Use GetUIObjectOf instead of BindToObject to get a IDropTarget object. - Register the shell view itself as the drop target, not it's parent folder. Forward drag&drop method calls to the folder currently under the cursor. - Initialize OLE instead of just COM, in order to enable Drag & Drop. - Modified KeyStateToDropEffect macro to match native shellview's behaviour. - Also scan HKEY_CURRENT_USER for shell namespace extensions in Desktop folder. Fixed a handle leak in case of failing AddToEnumList call. - Also scan HKEY_CURRENT_USER for shell namespace extensions in MyComputer. - Enhanced UnixFolder's IDropTarget implementation. Use STATIC_CAST macro more consistently. - Initial stubbed implementation of UnixFolder's IDropTarget interface. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Ge van Geldorp <gvg@reactos.org> - Load shortcut icon by resource id instead of by icon index. - Other code in shlexec.c (e.g. the extension handling code in ShellExecute_GetClassKey) expects sei->lpFile to not be enclosed in quotes. Martin Fuchs <martin-fuchs@gmx.net> - Correctly call HCR_GetFolderAttributes() in SHELL32_GetItemAttributes(). Directly return the correct "My Computer" attributes in ISF_Desktop_fnGetAttributesOf(). Remove "todo_wine" from the "My Computer" attributes test case. Add test case for retrieving the file system path from the CSIDL_PROGRAM_FILES PIDL using SHGetPathFromIDListW(). - Fix context menu handling for more than one entry in order to repair .lnk-file execution: Don't break at the first non-matching entry. Markus Gömmel <m.goemmel@compulab.de> - Added CSIDL_MYVIDEO|MYPICTURES|MYMUSIC to _SHRegisterUserShellFolders. svn path=/trunk/; revision=20168
2005-12-14 19:09:44 +00:00
} else if (_ILIsMyComputer(*apidl)) {
*rgfInOut &= dwMyComputerAttributes;
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
} else {
SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
}
apidl++;
cidl--;
}
}
Ge van Geldorp <gvg@reactos.com> - Overlay icons for .lnk files with a small arrow in the lower left corner. Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Fixes to IShellFolder::GetAttributesOf implementations, spotted by silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return - only log unsupported flags in ShellExecute - environment variables are expanded, so SEE_MASK_DOENVSUBST is supported Michael Jung <mjung@iss.tu-darmstadt.de> - Add a new CLSID for UnixDosFolder, which is identical to UnixFolder, but does unix <-> dos path conversion for GetDisplayNameOf and ParseDisplayName. - Make the root of the shell extension map to the root of the unix filesystem. - More robustly query the SHGDN_FORPARSING flag in the shell32's folders GetDisplayNameOf methods. - Fixed GetDisplayNameOf method to not depend on incorrect behaviour regarding the SHGDN_INFOLDER flag. - Fixed MyComputer's GetDisplayNameOf method. - Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. - Fixed incorrect IShellFolder::EnumOjects API usage. - Support for regular files (as opposed to directories). - Display a drive icon for the unix root directory. - Consider only the GIL_FORSHORTCUT flag in SIC_CompareEntries. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Mike McCormack <mike@codeweavers.com> - Split SHGetFileInfoW into two functions. - Remove static variables in SHBrowseForFolder implementation. - Split up the window procedure. - Remove some unused include files. - MSI advertised shortcuts don't require a product ID. Peter Berg Larsen <pebl@math.ku.dk> - Rewritten DoEnvironmentSubst16. Kouji Sasaki <taro-x@justsystem.co.jp> - Added the processing for determination of SFGAO_HASSUBFOLDER flag in SHELL32_GetItemAttribute function. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - It makes no sense to have a left pointing arrow as the desktop icon. Replace it with something more appropiate. Mike Hearn <mh@codeweavers.com> - Fix SHELL_GetPathFromIDList[AW] to return the desktop path given an empty PIDL. svn path=/trunk/; revision=15617
2005-05-28 21:30:32 +00:00
/* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
*rgfInOut &= ~SFGAO_VALIDATE;
TRACE ("-- result=0x%08x\n", *rgfInOut);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetUIObjectOf
*
* PARAMETERS
* HWND hwndOwner, //[in ] Parent window for any output
* UINT cidl, //[in ] array size
* LPCITEMIDLIST* apidl, //[in ] simple pidl array
* REFIID riid, //[in ] Requested Interface
* UINT* prgfInOut, //[ ] reserved
* LPVOID* ppvObject) //[out] Resulting Interface
*
*/
static HRESULT WINAPI ISF_Desktop_fnGetUIObjectOf (IShellFolder2 * iface,
HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPITEMIDLIST pidl;
IUnknown *pObj = NULL;
HRESULT hr = E_INVALIDARG;
TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
if (!ppvOut)
return hr;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu))
{
hr = CDefFolderMenu_Create2(This->pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)iface, NULL, 0, NULL, (IContextMenu**)&pObj);
}
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
{
pObj = (LPUNKNOWN) IDataObject_Constructor( hwndOwner,
This->pidlRoot, apidl, cidl);
hr = S_OK;
}
else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]);
pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
SHFree (pidl);
hr = S_OK;
}
else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
{
hr = IShellFolder_QueryInterface (iface,
&IID_IDropTarget, (LPVOID *) & pObj);
}
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
SHFree (pidl);
}
else
hr = E_NOINTERFACE;
if (SUCCEEDED(hr) && !pObj)
hr = E_OUTOFMEMORY;
*ppvOut = pObj;
TRACE ("(%p)->hr=0x%08x\n", This, hr);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnGetDisplayNameOf
*
* NOTES
* special case: pidl = null gives desktop-name back
*/
static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
LPWSTR pszPath;
TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet);
pdump (pidl);
if (!strRet)
return E_INVALIDARG;
pszPath = CoTaskMemAlloc((MAX_PATH +1) * sizeof(WCHAR));
if (!pszPath)
return E_OUTOFMEMORY;
if (_ILIsDesktop (pidl))
{
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
Ge van Geldorp <gvg@reactos.com> - Overlay icons for .lnk files with a small arrow in the lower left corner. Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Fixes to IShellFolder::GetAttributesOf implementations, spotted by silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return - only log unsupported flags in ShellExecute - environment variables are expanded, so SEE_MASK_DOENVSUBST is supported Michael Jung <mjung@iss.tu-darmstadt.de> - Add a new CLSID for UnixDosFolder, which is identical to UnixFolder, but does unix <-> dos path conversion for GetDisplayNameOf and ParseDisplayName. - Make the root of the shell extension map to the root of the unix filesystem. - More robustly query the SHGDN_FORPARSING flag in the shell32's folders GetDisplayNameOf methods. - Fixed GetDisplayNameOf method to not depend on incorrect behaviour regarding the SHGDN_INFOLDER flag. - Fixed MyComputer's GetDisplayNameOf method. - Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. - Fixed incorrect IShellFolder::EnumOjects API usage. - Support for regular files (as opposed to directories). - Display a drive icon for the unix root directory. - Consider only the GIL_FORSHORTCUT flag in SIC_CompareEntries. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Mike McCormack <mike@codeweavers.com> - Split SHGetFileInfoW into two functions. - Remove static variables in SHBrowseForFolder implementation. - Split up the window procedure. - Remove some unused include files. - MSI advertised shortcuts don't require a product ID. Peter Berg Larsen <pebl@math.ku.dk> - Rewritten DoEnvironmentSubst16. Kouji Sasaki <taro-x@justsystem.co.jp> - Added the processing for determination of SFGAO_HASSUBFOLDER flag in SHELL32_GetItemAttribute function. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - It makes no sense to have a left pointing arrow as the desktop icon. Replace it with something more appropiate. Mike Hearn <mh@codeweavers.com> - Fix SHELL_GetPathFromIDList[AW] to return the desktop path given an empty PIDL. svn path=/trunk/; revision=15617
2005-05-28 21:30:32 +00:00
(GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
wcscpy(pszPath, This->sPathTarget);
else
HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH);
}
else if (_ILIsPidlSimple (pidl))
{
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
GUID const *clsid;
if ((clsid = _ILGetGUIDPointer (pidl)))
{
Ge van Geldorp <gvg@reactos.com> - Overlay icons for .lnk files with a small arrow in the lower left corner. Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. - Removed unnecessary code in the 16-bit DllEntryPoint function of some dlls, and also fixed its ordinal in a few places. - Comment out stub WEP entry points so that we can call WEP for builtin dlls too. Juan Lang <juan_lang@yahoo.com> - Fixes to IShellFolder::GetAttributesOf implementations, spotted by silverblade_: - a count of zero is allowed to GetAttributesOf if apidl is NULL - SFGAO_VALIDATE must be cleared upon return - only log unsupported flags in ShellExecute - environment variables are expanded, so SEE_MASK_DOENVSUBST is supported Michael Jung <mjung@iss.tu-darmstadt.de> - Add a new CLSID for UnixDosFolder, which is identical to UnixFolder, but does unix <-> dos path conversion for GetDisplayNameOf and ParseDisplayName. - Make the root of the shell extension map to the root of the unix filesystem. - More robustly query the SHGDN_FORPARSING flag in the shell32's folders GetDisplayNameOf methods. - Fixed GetDisplayNameOf method to not depend on incorrect behaviour regarding the SHGDN_INFOLDER flag. - Fixed MyComputer's GetDisplayNameOf method. - Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. - Fixed incorrect IShellFolder::EnumOjects API usage. - Support for regular files (as opposed to directories). - Display a drive icon for the unix root directory. - Consider only the GIL_FORSHORTCUT flag in SIC_CompareEntries. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Mike McCormack <mike@codeweavers.com> - Split SHGetFileInfoW into two functions. - Remove static variables in SHBrowseForFolder implementation. - Split up the window procedure. - Remove some unused include files. - MSI advertised shortcuts don't require a product ID. Peter Berg Larsen <pebl@math.ku.dk> - Rewritten DoEnvironmentSubst16. Kouji Sasaki <taro-x@justsystem.co.jp> - Added the processing for determination of SFGAO_HASSUBFOLDER flag in SHELL32_GetItemAttribute function. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Huw Davies <huw@codeweavers.com> - It makes no sense to have a left pointing arrow as the desktop icon. Replace it with something more appropiate. Mike Hearn <mh@codeweavers.com> - Fix SHELL_GetPathFromIDList[AW] to return the desktop path given an empty PIDL. svn path=/trunk/; revision=15617
2005-05-28 21:30:32 +00:00
if (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)
{
int bWantsForParsing;
/*
* We can only get a filesystem path from a shellfolder if the
* value WantsFORPARSING in CLSID\\{...}\\shellfolder exists.
*
* Exception: The MyComputer folder doesn't have this key,
* but any other filesystem backed folder it needs it.
*/
if (IsEqualIID (clsid, &CLSID_MyComputer))
{
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
bWantsForParsing = TRUE;
}
else
{
/* get the "WantsFORPARSING" flag from the registry */
static const WCHAR clsidW[] =
{ 'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] =
{ '\\','s','h','e','l','l','f','o','l','d','e','r',0 };
static const WCHAR wantsForParsingW[] =
{ 'W','a','n','t','s','F','o','r','P','a','r','s','i','n',
'g',0 };
WCHAR szRegPath[100];
LONG r;
wcscpy (szRegPath, clsidW);
SHELL32_GUIDToStringW (clsid, &szRegPath[6]);
wcscat (szRegPath, shellfolderW);
r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath,
wantsForParsingW, NULL, NULL, NULL);
if (r == ERROR_SUCCESS)
bWantsForParsing = TRUE;
else
bWantsForParsing = FALSE;
}
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
bWantsForParsing)
{
/*
* we need the filesystem path to the destination folder.
* Only the folder itself can know it
*/
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags,
pszPath,
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
MAX_PATH);
}
else
{
/* parsing name like ::{...} */
pszPath[0] = ':';
pszPath[1] = ':';
SHELL32_GUIDToStringW (clsid, &pszPath[2]);
}
}
else
{
/* user friendly name */
HCR_GetClassNameW (clsid, pszPath, MAX_PATH);
}
}
else
{
Sync to Wine-20050830: Michael Jung <mjung@iss.tu-darmstadt.de> - Initialize all members in UnixFolder constructor. Support NULL value pidls in GetDisplayNameOf method. - Implemented IPersist::GetClassID. - Use wine_get_dos_file_name instead of GetFullPathName. - Implemented 'My Documents' folder. - Added stubbed implementation of IPersistPropertyBag interface. Register unixfs as CLSID_FolderShortcut. - Clone pidlLast before free'ing pidl after call to SHBindToParent. - Use FIXME's in stubs instead of TRACE's. Infer pathmode from CLSID in UnixFolderConstructor. Fail in IShellFolder::BindToObject, if folder does not initialize. - Use StringFromGUID2 instead of StringFromCLSID in UNIXFS_is_rooted_at_desktop. Michael Jung <mjung@iss.tu-darmstadt.de> Ge van Geldorp <gvg@reactos.com> - Prepend Desktop folder path for files/directories stored in the filesystem Desktop folder when GetDisplayNameOf is called with the SHGDN_FORPARSING flags. - Add testcases. Ge van Geldorp <gvg@reactos.com> - Fix resource leak on error paths. - Do not load all shell32 icons during initialization, it wastes a lot of memory Alexandre Julliard <julliard@winehq.org> - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. - Use ERR instead of DPRINTF in dump_pidl_hex. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Get rid of the _ICOM_THIS macros and call the inline function directly instead. - Removed the broken mmap64 configure check, and moved the _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that need the define include it. - Added missing ntdll imports. Francois Gouget <fgouget@codeweavers.com> - Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6. - Update the conformance tests accordingly. - Tweak a trace because it's very confusing to see the path with no escaped quotes in ShellExecuteA() and then with escaped quotes in ShellExecuteExW32() (due to debugstr_w()). - Fix the return value of SHELL_Argify() so it once again returns true if a '%1' or equivalent placeholder was found. This fixes ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile"). - Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not disjoint flags. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. Jozef Stefanka <jstefanka@codeweavers.com> - Fixed browsing to other directories in Word 2003 file open dialog. Double clicking on a folder in the File->Open dialog works now. Steven Edwards <steven_ed4153@yahoo.com> - Correct definition of SFGAO_STORAGEANCESTOR. Jason Edmeades <us@edmeades.me.uk> - Add the time to the file display dialog modified column. - Handle context menu->refresh, and F5 to initiate a refresh of the file dialog. svn path=/trunk/; revision=17714
2005-09-07 08:43:45 +00:00
int cLen = 0;
Sync to Wine-20050830: Michael Jung <mjung@iss.tu-darmstadt.de> - Initialize all members in UnixFolder constructor. Support NULL value pidls in GetDisplayNameOf method. - Implemented IPersist::GetClassID. - Use wine_get_dos_file_name instead of GetFullPathName. - Implemented 'My Documents' folder. - Added stubbed implementation of IPersistPropertyBag interface. Register unixfs as CLSID_FolderShortcut. - Clone pidlLast before free'ing pidl after call to SHBindToParent. - Use FIXME's in stubs instead of TRACE's. Infer pathmode from CLSID in UnixFolderConstructor. Fail in IShellFolder::BindToObject, if folder does not initialize. - Use StringFromGUID2 instead of StringFromCLSID in UNIXFS_is_rooted_at_desktop. Michael Jung <mjung@iss.tu-darmstadt.de> Ge van Geldorp <gvg@reactos.com> - Prepend Desktop folder path for files/directories stored in the filesystem Desktop folder when GetDisplayNameOf is called with the SHGDN_FORPARSING flags. - Add testcases. Ge van Geldorp <gvg@reactos.com> - Fix resource leak on error paths. - Do not load all shell32 icons during initialization, it wastes a lot of memory Alexandre Julliard <julliard@winehq.org> - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. - Use ERR instead of DPRINTF in dump_pidl_hex. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Get rid of the _ICOM_THIS macros and call the inline function directly instead. - Removed the broken mmap64 configure check, and moved the _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that need the define include it. - Added missing ntdll imports. Francois Gouget <fgouget@codeweavers.com> - Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6. - Update the conformance tests accordingly. - Tweak a trace because it's very confusing to see the path with no escaped quotes in ShellExecuteA() and then with escaped quotes in ShellExecuteExW32() (due to debugstr_w()). - Fix the return value of SHELL_Argify() so it once again returns true if a '%1' or equivalent placeholder was found. This fixes ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile"). - Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not disjoint flags. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. Jozef Stefanka <jstefanka@codeweavers.com> - Fixed browsing to other directories in Word 2003 file open dialog. Double clicking on a folder in the File->Open dialog works now. Steven Edwards <steven_ed4153@yahoo.com> - Correct definition of SFGAO_STORAGEANCESTOR. Jason Edmeades <us@edmeades.me.uk> - Add the time to the file display dialog modified column. - Handle context menu->refresh, and F5 to initiate a refresh of the file dialog. svn path=/trunk/; revision=17714
2005-09-07 08:43:45 +00:00
/* file system folder or file rooted at the desktop */
if ((GET_SHGDN_FOR(dwFlags) == SHGDN_FORPARSING) &&
(GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER))
{
lstrcpynW(pszPath, This->sPathTarget, MAX_PATH - 1);
PathAddBackslashW(pszPath);
cLen = wcslen(pszPath);
Sync to Wine-20050830: Michael Jung <mjung@iss.tu-darmstadt.de> - Initialize all members in UnixFolder constructor. Support NULL value pidls in GetDisplayNameOf method. - Implemented IPersist::GetClassID. - Use wine_get_dos_file_name instead of GetFullPathName. - Implemented 'My Documents' folder. - Added stubbed implementation of IPersistPropertyBag interface. Register unixfs as CLSID_FolderShortcut. - Clone pidlLast before free'ing pidl after call to SHBindToParent. - Use FIXME's in stubs instead of TRACE's. Infer pathmode from CLSID in UnixFolderConstructor. Fail in IShellFolder::BindToObject, if folder does not initialize. - Use StringFromGUID2 instead of StringFromCLSID in UNIXFS_is_rooted_at_desktop. Michael Jung <mjung@iss.tu-darmstadt.de> Ge van Geldorp <gvg@reactos.com> - Prepend Desktop folder path for files/directories stored in the filesystem Desktop folder when GetDisplayNameOf is called with the SHGDN_FORPARSING flags. - Add testcases. Ge van Geldorp <gvg@reactos.com> - Fix resource leak on error paths. - Do not load all shell32 icons during initialization, it wastes a lot of memory Alexandre Julliard <julliard@winehq.org> - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. - Use ERR instead of DPRINTF in dump_pidl_hex. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Get rid of the _ICOM_THIS macros and call the inline function directly instead. - Removed the broken mmap64 configure check, and moved the _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that need the define include it. - Added missing ntdll imports. Francois Gouget <fgouget@codeweavers.com> - Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6. - Update the conformance tests accordingly. - Tweak a trace because it's very confusing to see the path with no escaped quotes in ShellExecuteA() and then with escaped quotes in ShellExecuteExW32() (due to debugstr_w()). - Fix the return value of SHELL_Argify() so it once again returns true if a '%1' or equivalent placeholder was found. This fixes ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile"). - Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not disjoint flags. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. Jozef Stefanka <jstefanka@codeweavers.com> - Fixed browsing to other directories in Word 2003 file open dialog. Double clicking on a folder in the File->Open dialog works now. Steven Edwards <steven_ed4153@yahoo.com> - Correct definition of SFGAO_STORAGEANCESTOR. Jason Edmeades <us@edmeades.me.uk> - Add the time to the file display dialog modified column. - Handle context menu->refresh, and F5 to initiate a refresh of the file dialog. svn path=/trunk/; revision=17714
2005-09-07 08:43:45 +00:00
}
_ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen);
if (!_ILIsFolder(pidl))
SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags);
if (GetFileAttributes(pszPath) == INVALID_FILE_ATTRIBUTES)
{
/* file system folder or file rooted at the AllUsers desktop */
if ((GET_SHGDN_FOR(dwFlags) == SHGDN_FORPARSING) &&
(GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER))
{
SHGetSpecialFolderPathW(0, pszPath, CSIDL_COMMON_DESKTOPDIRECTORY, FALSE);
PathAddBackslashW(pszPath);
cLen = wcslen(pszPath);
}
_ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen);
if (!_ILIsFolder(pidl))
SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags);
}
}
}
else
{
/* a complex pidl, let the subfolder do the work */
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags,
pszPath, MAX_PATH);
}
if (SUCCEEDED(hr))
{
/* Win9x always returns ANSI strings, NT always returns Unicode strings */
if (GetVersion() & 0x80000000)
{
strRet->uType = STRRET_CSTR;
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->u.cStr, MAX_PATH,
NULL, NULL))
strRet->u.cStr[0] = '\0';
CoTaskMemFree(pszPath);
}
else
{
strRet->uType = STRRET_WSTR;
strRet->u.pOleStr = pszPath;
}
}
else
CoTaskMemFree(pszPath);
TRACE ("-- (%p)->(%s,0x%08x)\n", This,
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
strRet->uType == STRRET_CSTR ? strRet->u.cStr :
debugstr_w(strRet->u.pOleStr), hr);
return hr;
}
/**************************************************************************
* ISF_Desktop_fnSetNameOf
* Changes the name of a file object or subfolder, possibly changing its item
* identifier in the process.
*
* PARAMETERS
* HWND hwndOwner, //[in ] Owner window for output
* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
* LPCOLESTR lpszName, //[in ] the items new display name
* DWORD dwFlags, //[in ] SHGNO formatting flags
* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
*/
static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface,
HWND hwndOwner, LPCITEMIDLIST pidl, /* simple pidl */
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
IShellFolder2 * psf;
HRESULT hr;
WCHAR szSrc[MAX_PATH + 1], szDest[MAX_PATH + 1];
LPWSTR ptr;
BOOL bIsFolder = _ILIsFolder (ILFindLastID (pidl));
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
TRACE ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl,
debugstr_w (lpName), dwFlags, pPidlOut);
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
if (_ILGetGUIDPointer(pidl))
{
if (SUCCEEDED(IShellFolder2_BindToObject(iface, pidl, NULL, &IID_IShellFolder2, (LPVOID*)&psf)))
{
hr = IShellFolder2_SetNameOf(psf, hwndOwner, pidl, lpName, dwFlags, pPidlOut);
IShellFolder2_Release(psf);
return hr;
}
}
/* build source path */
lstrcpynW(szSrc, This->sPathTarget, MAX_PATH);
ptr = PathAddBackslashW (szSrc);
if (ptr)
_ILSimpleGetTextW (pidl, ptr, MAX_PATH + 1 - (ptr - szSrc));
/* build destination path */
if (dwFlags == SHGDN_NORMAL || dwFlags & SHGDN_INFOLDER) {
lstrcpynW(szDest, This->sPathTarget, MAX_PATH);
ptr = PathAddBackslashW (szDest);
if (ptr)
lstrcpynW(ptr, lpName, MAX_PATH + 1 - (ptr - szDest));
} else
lstrcpynW(szDest, lpName, MAX_PATH);
if(!(dwFlags & SHGDN_FORPARSING) && SHELL_FS_HideExtension(szSrc)) {
WCHAR *ext = PathFindExtensionW(szSrc);
if(*ext != '\0') {
INT len = wcslen(szDest);
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
lstrcpynW(szDest + len, ext, MAX_PATH - len);
}
}
if (!memcmp(szSrc, szDest, (wcslen(szDest)+1) * sizeof(WCHAR)))
{
/* src and destination is the same */
hr = S_OK;
if (pPidlOut)
hr = _ILCreateFromPathW(szDest, pPidlOut);
return hr;
}
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest));
if (MoveFileW (szSrc, szDest))
{
hr = S_OK;
if (pPidlOut)
hr = _ILCreateFromPathW(szDest, pPidlOut);
SHChangeNotify (bIsFolder ? SHCNE_RENAMEFOLDER : SHCNE_RENAMEITEM,
SHCNF_PATHW, szSrc, szDest);
return hr;
}
return E_FAIL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface,
GUID * pguid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnEnumSearches (IShellFolder2 *iface,
IEnumExtraSearch ** ppenum)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn (IShellFolder2 * iface,
DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (pSort)
*pSort = 0;
if (pDisplay)
*pDisplay = 0;
return S_OK;
}
static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState (
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (!pcsFlags || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
return E_INVALIDARG;
*pcsFlags = DesktopSFHeader[iColumn].pcsFlags;
return S_OK;
}
static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx (IShellFolder2 * iface,
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
HRESULT hr = S_OK;
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS)
return E_INVALIDARG;
if (!pidl)
{
psd->fmt = DesktopSFHeader[iColumn].fmt;
psd->cxChar = DesktopSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, DesktopSFHeader[iColumn].colnameid,
psd->str.u.cStr, MAX_PATH);
return S_OK;
}
/* the data from the pidl */
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
psd->str.uType = STRRET_CSTR;
switch (iColumn)
{
case 0: /* name */
hr = IShellFolder_GetDisplayNameOf(iface, pidl,
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break;
case 1: /* size */
_ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 2: /* type */
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 3: /* date */
_ILGetFileDate (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 4: /* attributes */
_ILGetFileAttributes (pidl, psd->str.u.cStr, MAX_PATH);
break;
}
return hr;
}
static HRESULT WINAPI ISF_Desktop_fnMapColumnToSCID (
IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 =
{
ISF_Desktop_fnQueryInterface,
ISF_Desktop_fnAddRef,
ISF_Desktop_fnRelease,
ISF_Desktop_fnParseDisplayName,
ISF_Desktop_fnEnumObjects,
ISF_Desktop_fnBindToObject,
ISF_Desktop_fnBindToStorage,
ISF_Desktop_fnCompareIDs,
ISF_Desktop_fnCreateViewObject,
ISF_Desktop_fnGetAttributesOf,
ISF_Desktop_fnGetUIObjectOf,
ISF_Desktop_fnGetDisplayNameOf,
ISF_Desktop_fnSetNameOf,
/* ShellFolder2 */
ISF_Desktop_fnGetDefaultSearchGUID,
ISF_Desktop_fnEnumSearches,
ISF_Desktop_fnGetDefaultColumn,
ISF_Desktop_fnGetDefaultColumnState,
ISF_Desktop_fnGetDetailsEx,
ISF_Desktop_fnGetDetailsOf,
ISF_Desktop_fnMapColumnToSCID
};
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
{
return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2));
}
static HRESULT WINAPI
ISF_Desktop_PersistFolder2_fnQueryInterface (IPersistFolder2 * iface, REFIID iid,
LPVOID * ppvObj)
{
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
return ISF_Desktop_fnQueryInterface ((IShellFolder2*)This, iid, ppvObj);
}
static ULONG WINAPI
ISF_Desktop_PersistFolder2_fnAddRef (IPersistFolder2 * iface)
{
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return ISF_Desktop_fnAddRef((IShellFolder2*)This);
}
static ULONG WINAPI
ISF_Desktop_PersistFolder2_fnRelease (IPersistFolder2 * iface)
{
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return ISF_Desktop_fnRelease ((IShellFolder2*)This);
}
static HRESULT WINAPI
ISF_Desktop_PersistFolder2_fnGetClassID (IPersistFolder2 * iface, CLSID * lpClassId)
{
static GUID const CLSID_Desktop =
{ 0x00021400, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
if (!lpClassId)
return E_POINTER;
memcpy(lpClassId, &CLSID_Desktop, sizeof(GUID));
return S_OK;
}
static HRESULT WINAPI
ISF_Desktop_PersistFolder2_fnInitialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, pidl);
return E_NOTIMPL;
}
static HRESULT WINAPI
ISF_Desktop_PersistFolder2_fnGetCurFolder (IPersistFolder2 * iface,
LPITEMIDLIST * pidl)
{
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, pidl);
if (!pidl) return E_POINTER;
*pidl = ILClone (This->pidlRoot);
return S_OK;
}
static const IPersistFolder2Vtbl vt_FSFldr_PersistFolder2 =
{
ISF_Desktop_PersistFolder2_fnQueryInterface,
ISF_Desktop_PersistFolder2_fnAddRef,
ISF_Desktop_PersistFolder2_fnRelease,
ISF_Desktop_PersistFolder2_fnGetClassID,
ISF_Desktop_PersistFolder2_fnInitialize,
ISF_Desktop_PersistFolder2_fnGetCurFolder,
};
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
static HRESULT WINAPI
ISF_Desktop_ISFHelper_fnQueryInterface (ISFHelper * iface, REFIID riid, LPVOID * ppvObj)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return ISF_Desktop_fnQueryInterface ((IShellFolder2*)This, riid, ppvObj);
}
static ULONG WINAPI
ISF_Desktop_ISFHelper_fnAddRef (ISFHelper * iface)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return ISF_Desktop_fnAddRef((IShellFolder2*)This);
}
static ULONG WINAPI
ISF_Desktop_ISFHelper_fnRelease (ISFHelper * iface)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
TRACE ("(%p)\n", This);
return ISF_Desktop_fnRelease ((IShellFolder2*)This);
}
static HRESULT WINAPI
ISF_Desktop_ISFHelper_fnGetUniqueName (ISFHelper * iface, LPWSTR pwszName, UINT uLen)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
IEnumIDList *penum;
HRESULT hr;
WCHAR wszText[MAX_PATH];
WCHAR wszNewFolder[25];
const WCHAR wszFormat[] = {'%','s',' ','%','d',0 };
LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, sizeof(wszNewFolder)/sizeof(WCHAR));
TRACE ("(%p)(%p %u)\n", This, pwszName, uLen);
if (uLen < sizeof(wszNewFolder)/sizeof(WCHAR) + 3)
return E_POINTER;
lstrcpynW (pwszName, wszNewFolder, uLen);
hr = IShellFolder_EnumObjects ((IShellFolder2*)This, 0,
SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penum);
if (penum) {
LPITEMIDLIST pidl;
DWORD dwFetched;
int i = 1;
next:
IEnumIDList_Reset (penum);
while (S_OK == IEnumIDList_Next (penum, 1, &pidl, &dwFetched) &&
dwFetched) {
_ILSimpleGetTextW (pidl, wszText, MAX_PATH);
if (0 == lstrcmpiW (wszText, pwszName)) {
_snwprintf (pwszName, uLen, wszFormat, wszNewFolder, i++);
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
if (i > 99) {
hr = E_FAIL;
break;
}
goto next;
}
}
IEnumIDList_Release (penum);
}
return hr;
}
static HRESULT WINAPI
ISF_Desktop_ISFHelper_fnAddFolder (ISFHelper * iface, HWND hwnd, LPCWSTR pwszName,
LPITEMIDLIST * ppidlOut)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
WCHAR wszNewDir[MAX_PATH];
DWORD bRes;
HRESULT hres = E_FAIL;
TRACE ("(%p)(%s %p)\n", This, debugstr_w(pwszName), ppidlOut);
wszNewDir[0] = 0;
if (This->sPathTarget)
lstrcpynW(wszNewDir, This->sPathTarget, MAX_PATH);
PathAppendW(wszNewDir, pwszName);
bRes = CreateDirectoryW (wszNewDir, NULL);
if (bRes)
{
SHChangeNotify (SHCNE_MKDIR, SHCNF_PATHW, wszNewDir, NULL);
hres = S_OK;
if (ppidlOut)
hres = _ILCreateFromPathW(wszNewDir, ppidlOut);
}
return hres;
}
static HRESULT WINAPI
ISF_Desktop_ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
{
IGenericSFImpl *This = impl_from_ISFHelper(iface);
UINT i;
SHFILEOPSTRUCTW op;
WCHAR wszPath[MAX_PATH];
WCHAR wszCaption[50];
WCHAR *wszPathsList;
HRESULT ret;
WCHAR *wszCurrentPath;
UINT bRestoreWithDeskCpl = FALSE;
int res;
TRACE ("(%p)(%u %p)\n", This, cidl, apidl);
if (cidl==0) return S_OK;
for(i = 0; i < cidl; i++)
{
if (_ILIsMyComputer(apidl[i]))
bRestoreWithDeskCpl++;
else if (_ILIsNetHood(apidl[i]))
bRestoreWithDeskCpl++;
else if (_ILIsMyDocuments(apidl[i]))
bRestoreWithDeskCpl++;
}
if (bRestoreWithDeskCpl)
{
/* FIXME use FormatMessage
* use a similar message resource as in windows
*/
LoadStringW(shell32_hInstance, IDS_DELETEMULTIPLE_TEXT, wszPath, sizeof(wszPath)/sizeof(WCHAR));
wszPath[(sizeof(wszPath)/sizeof(WCHAR))-1] = 0;
LoadStringW(shell32_hInstance, IDS_DELETEITEM_CAPTION, wszCaption, sizeof(wszCaption)/sizeof(WCHAR));
wszCaption[(sizeof(wszCaption)/sizeof(WCHAR))-1] = 0;
res = SHELL_ConfirmMsgBox(GetActiveWindow(), wszPath, wszCaption, NULL, cidl > 1);
if (res == IDD_YESTOALL || res == IDYES)
{
for(i = 0; i < cidl; i++)
{
if (_ILIsMyComputer(apidl[i]))
SetNamespaceExtensionVisibleStatus(L"{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 0x1);
else if (_ILIsNetHood(apidl[i]))
SetNamespaceExtensionVisibleStatus(L"{208D2C60-3AEA-1069-A2D7-08002B30309D}", 0x1);
else if (_ILIsMyDocuments(apidl[i]))
SetNamespaceExtensionVisibleStatus(L"{450D8FBA-AD25-11D0-98A8-0800361B1103}", 0x1);
}
}
}
if (This->sPathTarget)
lstrcpynW(wszPath, This->sPathTarget, MAX_PATH);
else
wszPath[0] = '\0';
PathAddBackslashW(wszPath);
wszPathsList = build_paths_list(wszPath, cidl, apidl);
ZeroMemory(&op, sizeof(op));
op.hwnd = GetActiveWindow();
op.wFunc = FO_DELETE;
op.pFrom = wszPathsList;
op.fFlags = FOF_ALLOWUNDO;
if (SHFileOperationW(&op))
{
WARN("SHFileOperation failed\n");
ret = E_FAIL;
}
else
ret = S_OK;
/* we currently need to manually send the notifies */
wszCurrentPath = wszPathsList;
for (i = 0; i < cidl; i++)
{
LONG wEventId;
if (_ILIsFolder(apidl[i]))
wEventId = SHCNE_RMDIR;
else if (_ILIsValue(apidl[i]))
wEventId = SHCNE_DELETE;
else
continue;
/* check if file exists */
if (GetFileAttributesW(wszCurrentPath) == INVALID_FILE_ATTRIBUTES)
{
LPITEMIDLIST pidl = ILCombine(This->pidlRoot, apidl[i]);
SHChangeNotify(wEventId, SHCNF_IDLIST, pidl, NULL);
SHFree(pidl);
}
wszCurrentPath += wcslen(wszCurrentPath)+1;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
}
HeapFree(GetProcessHeap(), 0, wszPathsList);
return ret;
}
static HRESULT WINAPI
ISF_Desktop_ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl)
{
IPersistFolder2 *ppf2 = NULL;
WCHAR szSrcPath[MAX_PATH];
WCHAR szTargetPath[MAX_PATH];
SHFILEOPSTRUCTW op;
LPITEMIDLIST pidl;
LPWSTR pszSrc, pszTarget, pszSrcList, pszTargetList, pszFileName;
int res, length;
STRRET strRet;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
IGenericSFImpl *This = impl_from_ISFHelper(iface);
TRACE ("(%p)->(%p,%u,%p)\n", This, pSFFrom, cidl, apidl);
IShellFolder_QueryInterface (pSFFrom, &IID_IPersistFolder2, (LPVOID *) & ppf2);
if (ppf2)
{
if (FAILED(IPersistFolder2_GetCurFolder (ppf2, &pidl)))
{
IPersistFolder2_Release(ppf2);
return E_FAIL;
}
IPersistFolder2_Release(ppf2);
if (FAILED(IShellFolder_GetDisplayNameOf(pSFFrom, pidl, SHGDN_FORPARSING, &strRet)))
{
SHFree (pidl);
return E_FAIL;
}
if (FAILED(StrRetToBufW(&strRet, pidl, szSrcPath, MAX_PATH)))
{
SHFree (pidl);
return E_FAIL;
}
SHFree (pidl);
pszSrc = PathAddBackslashW (szSrcPath);
wcscpy(szTargetPath, This->sPathTarget);
pszTarget = PathAddBackslashW (szTargetPath);
pszSrcList = build_paths_list(szSrcPath, cidl, apidl);
pszTargetList = build_paths_list(szTargetPath, cidl, apidl);
if (!pszSrcList || !pszTargetList)
{
if (pszSrcList)
HeapFree(GetProcessHeap(), 0, pszSrcList);
if (pszTargetList)
HeapFree(GetProcessHeap(), 0, pszTargetList);
SHFree (pidl);
IPersistFolder2_Release (ppf2);
return E_OUTOFMEMORY;
}
ZeroMemory(&op, sizeof(op));
if (!pszSrcList[0])
{
/* remove trailing backslash */
pszSrc--;
pszSrc[0] = L'\0';
op.pFrom = szSrcPath;
}
else
{
op.pFrom = pszSrcList;
}
if (!pszTargetList[0])
{
/* remove trailing backslash */
if (pszTarget - szTargetPath > 3)
{
pszTarget--;
pszTarget[0] = L'\0';
}
else
{
pszTarget[1] = L'\0';
}
op.pTo = szTargetPath;
}
else
{
op.pTo = pszTargetList;
}
op.hwnd = GetActiveWindow();
op.wFunc = FO_COPY;
op.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR;
res = SHFileOperationW(&op);
if (res == DE_SAMEFILE)
{
length = wcslen(szTargetPath);
pszFileName = wcsrchr(pszSrcList, '\\');
pszFileName++;
if (LoadStringW(shell32_hInstance, IDS_COPY_OF, pszTarget, MAX_PATH - length))
{
wcscat(szTargetPath, L" ");
}
wcscat(szTargetPath, pszFileName);
op.pTo = szTargetPath;
res = SHFileOperationW(&op);
}
HeapFree(GetProcessHeap(), 0, pszSrcList);
HeapFree(GetProcessHeap(), 0, pszTargetList);
if (res)
return E_FAIL;
else
return S_OK;
}
return E_FAIL;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
}
static const ISFHelperVtbl vt_FSFldr_ISFHelper =
{
ISF_Desktop_ISFHelper_fnQueryInterface,
ISF_Desktop_ISFHelper_fnAddRef,
ISF_Desktop_ISFHelper_fnRelease,
ISF_Desktop_ISFHelper_fnGetUniqueName,
ISF_Desktop_ISFHelper_fnAddFolder,
ISF_Desktop_ISFHelper_fnDeleteItems,
ISF_Desktop_ISFHelper_fnCopyItems
};
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
/**************************************************************************
* ISF_Desktop_Constructor
*/
HRESULT WINAPI ISF_Desktop_Constructor (
IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
static IGenericSFImpl *cached_sf;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
WCHAR szMyPath[MAX_PATH];
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
if (!ppv)
return E_POINTER;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
if (!cached_sf)
{
IGenericSFImpl *sf;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
return E_UNEXPECTED;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
sf = LocalAlloc( LMEM_ZEROINIT, sizeof (IGenericSFImpl) );
if (!sf)
return E_OUTOFMEMORY;
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
sf->ref = 1;
sf->lpVtbl = &vt_MCFldr_ShellFolder2;
sf->lpPF2 = &vt_FSFldr_PersistFolder2;
- Do not pass SHGDN_INFOLDER flag - Implement IPersistFolder2 for control panel shell folder - Replace _InsertMenuItem with unicode - Pass the pidl of shellfolder and selected drive to SH_ShowDriveProperties to construct a valid IDataObject which is passed to drive PropertySheet handlers - Release HPSX array only if it was constructed - Optimize AddShellPropSheetExCallback for file property dialog - Pass the pidl of the parent shell folder and selected item to SH_ShowPropertiesDialog and construct a IDataObject from it - Check for success for created IDataObject and HPSX array - Add a lot of buffer checks for the OpenNew shell extension - Pass the full filename of the item from Admin Tools shellfolder when IShellFolder_GetDisplayNameOf is called with SHGDN_FORPARSING - Implement initializing the AdminTools folder - Implement IShellFolder_SetNameOf for the desktop shell folder to support renaming desktop items and sub folders - Implement ISFHelper interface for desktop shell folder to support deleting with backspace key and fixes the new item shell service for items and directories - Implement hiding (deleting) shell extensions from desktop - Display a messagebox if shell extensions should be really deleted - Fix the IShellFolder_GetAttributesOf for the Mycomputer shell folder - Implement changing drive name with rename verb using IShellFolder_SetNameOf (MyComputer) - Implement Initializing the MyComputer shell folder properly - Fix Shellfolder attributes for MyDocuments shell folder - Fix Shellfolder attributes for Netplaces shell folder - Implement Initializing the Netplaces shell folder properly - Remove the 'properties' and 'open' verb from recycle bin shell folder, these verbs are statically generated - Directories cannot have the link attribute - Implement IShellExtInit interface for the new item shell service - Implement the default context menu based on the existing item context menu and background context menu and delete old implementation - Implement copy&paste of files and directories - Implement creating links to files - Check if a dynamic shell extension has already been loaded - Free static / dynamic shell extensions on release svn path=/trunk/; revision=35476
2008-08-20 13:47:47 +00:00
sf->lpvtblSFHelper = &vt_FSFldr_ISFHelper;
sf->pidlRoot = _ILCreateDesktop(); /* my qualified pidl */
sf->sPathTarget = SHAlloc( (wcslen(szMyPath) + 1)*sizeof(WCHAR) );
wcscpy( sf->sPathTarget, szMyPath );
if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL)
{
/* some other thread already been here */
SHFree( sf->pidlRoot );
SHFree( sf->sPathTarget );
LocalFree( sf );
}
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
}
return IUnknown_QueryInterface( _IUnknown_(cached_sf), riid, ppv );
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
}