reactos/reactos/dll/win32/shell32/shfldr_mycomp.c

1039 lines
33 KiB
C
Raw Normal View History

/*
* Virtual Workplace 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);
/***********************************************************************
* IShellFolder 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;
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;
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 IPersistFolder2Vtbl *lpVtblPersistFolder2;
/* both paths are parsible from the desktop */
LPITEMIDLIST pidlRoot; /* absolute pidl */
LPWSTR sName;
} IGenericSFImpl, *LPIGenericSFImpl;
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_ShellFolder2;
static const IPersistFolder2Vtbl vt_PersistFolder2;
static LPIGenericSFImpl __inline impl_from_IPersistFolder2( IPersistFolder2 *iface )
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
{
return (LPIGenericSFImpl)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2));
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
}
/*
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
converts This to an interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
#define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl)
#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2)
#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2)
#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
/***********************************************************************
* IShellFolder [MyComputer] implementation
*/
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 shvheader MyComputerSFHeader[] = {
{IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
{IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN6, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
{IDS_SHV_COLUMN7, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
};
#define MYCOMPUTERSHELLVIEWCOLUMNS 4
/**************************************************************************
* ISF_MyComputer_Constructor
*/
HRESULT WINAPI ISF_MyComputer_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
{
IGenericSFImpl *sf;
DWORD dwSize;
WCHAR szName[MAX_PATH];
TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
if (!ppv)
return E_POINTER;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
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;
sf->ref = 0;
sf->lpVtbl = &vt_ShellFolder2;
sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
sf->pidlRoot = _ILCreateMyComputer (); /* my qualified pidl */
if (FAILED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv)))
{
IUnknown_Release (_IUnknown_ (sf));
return E_NOINTERFACE;
}
dwSize = sizeof(szName);
if (RegGetValueW(HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
NULL,
RRF_RT_REG_SZ,
NULL,
szName,
&dwSize) == ERROR_SUCCESS)
{
szName[MAX_PATH-1] = 0;
sf->sName = SHAlloc((wcslen(szName)+1) * sizeof(WCHAR));
if (sf->sName)
{
wcscpy( sf->sName, szName );
}
TRACE("sName %s\n", debugstr_w(sf->sName));
}
TRACE ("--(%p)\n", sf);
return S_OK;
}
/**************************************************************************
* ISF_MyComputer_fnQueryInterface
*
* NOTES supports not IPersist/IPersistFolder
*/
static HRESULT WINAPI ISF_MyComputer_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_IPersist) ||
IsEqualIID (riid, &IID_IPersistFolder) ||
IsEqualIID (riid, &IID_IPersistFolder2))
{
*ppvObj = _IPersistFolder2_ (This);
}
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 ULONG WINAPI ISF_MyComputer_fnAddRef (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE ("(%p)->(count=%u)\n", This, refCount - 1);
return refCount;
}
static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE ("(%p)->(count=%u)\n", This, refCount + 1);
if (!refCount)
{
TRACE ("-- destroying IShellFolder(%p)\n", This);
SHFree (This->pidlRoot);
LocalFree (This);
}
return refCount;
}
/**************************************************************************
* ISF_MyComputer_fnParseDisplayName
*/
static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName,
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL;
WCHAR szElement[MAX_PATH];
LPITEMIDLIST pidlTemp = NULL;
CLSID clsid;
TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
pchEaten, ppidl, pdwAttributes);
*ppidl = 0;
if (pchEaten)
*pchEaten = 0; /* strange but like the original */
/* handle CLSID paths */
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);
}
/* do we have an absolute path name ? */
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 &&
lpszDisplayName[2] == (WCHAR) '\\')
{
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
/* make drive letter uppercase to enable PIDL comparison */
szElement[0] = toupper(szElement[0]);
pidlTemp = _ILCreateDrive (szElement);
}
if (szNext && *szNext)
{
hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp,
(LPOLESTR) szNext, pchEaten, pdwAttributes);
}
else
{
if (pdwAttributes && *pdwAttributes)
SHELL32_GetItemAttributes (_IShellFolder_ (This),
pidlTemp, pdwAttributes);
hr = S_OK;
}
*ppidl = pidlTemp;
TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr);
return hr;
}
/**************************************************************************
* CreateMyCompEnumList()
*/
static const WCHAR MyComputer_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','\\','M','y','C','o','m','p','u','t','e','r','\\','N','a','m',
'e','s','p','a','c','e','\0' };
static BOOL CreateMyCompEnumList(IEnumIDList *list, DWORD dwFlags)
{
BOOL ret = TRUE;
TRACE("(%p)->(flags=0x%08x)\n", list, dwFlags);
/* enumerate the folders */
if (dwFlags & SHCONTF_FOLDERS)
{
WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
DWORD dwDrivemap = GetLogicalDrives();
HKEY hkey;
UINT i;
while (ret && wszDriveName[0]<='Z')
{
if(dwDrivemap & 0x00000001L)
ret = AddToEnumList(list, _ILCreateDrive(wszDriveName));
wszDriveName[0]++;
dwDrivemap = dwDrivemap >> 1;
}
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
for (i=0; i<2; i++) {
if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
MyComputer_NameSpaceW, 0, KEY_READ, &hkey))
{
WCHAR iid[50];
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)
{
/* FIXME: shell extensions, shouldn't the type be
* PT_SHELLEXT? */
ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid));
i++;
}
else if (ERROR_NO_MORE_ITEMS == r)
break;
else
ret = FALSE;
}
RegCloseKey(hkey);
}
}
}
return ret;
}
/**************************************************************************
* ISF_MyComputer_fnEnumObjects
*/
static HRESULT WINAPI ISF_MyComputer_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)
CreateMyCompEnumList(*ppEnumIDList, dwFlags);
TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList);
return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY;
}
/**************************************************************************
* ISF_MyComputer_fnBindToObject
*/
static HRESULT WINAPI ISF_MyComputer_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);
return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
}
/**************************************************************************
* ISF_MyComputer_fnBindToStorage
*/
static HRESULT WINAPI ISF_MyComputer_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_MyComputer_fnCompareIDs
*/
static HRESULT WINAPI ISF_MyComputer_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_MyComputer_fnCreateViewObject
*/
static HRESULT WINAPI ISF_MyComputer_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_MyComputer_fnGetAttributesOf
*/
static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr = S_OK;
- 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 DWORD dwComputerAttributes =
SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | SFGAO_CANCOPY |
SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE;
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;
- 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(cidl == 0) {
*rgfInOut &= dwComputerAttributes;
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);
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_MyComputer_fnGetUIObjectOf
*
* PARAMETERS
* hwndOwner [in] Parent window for any output
* cidl [in] array size
* apidl [in] simple pidl array
* riid [in] Requested Interface
* prgfInOut [ ] reserved
* ppvObject [out] Resulting Interface
*
*/
static HRESULT WINAPI ISF_MyComputer_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;
*ppvOut = NULL;
if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
{
hr = CDefFolderMenu_Create2(This->pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)iface, NULL, 0, NULL, (IContextMenu**)&pObj);
}
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);
}
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_MyComputer_fnGetDisplayNameOf
*/
static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPWSTR pszPath;
HRESULT hr = S_OK;
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;
pszPath[0] = 0;
if (!pidl->mkid.cb)
{
/* parsing name like ::{...} */
pszPath[0] = ':';
pszPath[1] = ':';
SHELL32_GUIDToStringW(&CLSID_MyComputer, &pszPath[2]);
}
else if (_ILIsPidlSimple(pidl))
{
/* take names of special folders only if its only this folder */
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 (_ILIsSpecialFolder(pidl))
{
GUID const *clsid;
clsid = _ILGetGUIDPointer (pidl);
if (clsid)
{
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)
{
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 };
int bWantsForParsing = FALSE;
WCHAR szRegPath[100];
LONG r;
/*
* We can only get a filesystem path from a shellfolder
* if the value WantsFORPARSING exists in
* CLSID\\{...}\\shellfolder
* exception: the MyComputer folder has this keys not
* but like any filesystem backed
* folder it needs these behaviour
*
* Get the "WantsFORPARSING" flag from the registry
*/
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;
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, MAX_PATH);
}
else
{
LPWSTR p = pszPath;
/* parsing name like ::{...} */
p[0] = ':';
p[1] = ':';
p += 2;
p += SHELL32_GUIDToStringW(&CLSID_MyComputer, p);
/* \:: */
p[0] = '\\';
p[1] = ':';
p[2] = ':';
p += 3;
SHELL32_GUIDToStringW(clsid, p);
}
}
else
{
/* user friendly name */
if (_ILIsMyComputer(pidl) && This->sName)
wcscpy(pszPath, This->sName);
else
HCR_GetClassNameW (clsid, pszPath, MAX_PATH);
TRACE("pszPath %s\n", debugstr_w(pszPath));
}
}
else
{
/* append my own path */
_ILSimpleGetTextW (pidl, pszPath, MAX_PATH);
}
}
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
else if (_ILIsDrive(pidl))
{
_ILSimpleGetTextW (pidl, pszPath, MAX_PATH); /* append my own path */
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
/* long view "lw_name (C:)" */
if (!(dwFlags & SHGDN_FORPARSING))
{
WCHAR wszDrive[18] = {0};
DWORD dwVolumeSerialNumber, dwMaximumComponentLength, dwFileSystemFlags;
static const WCHAR wszOpenBracket[] = {' ','(',0};
static const WCHAR wszCloseBracket[] = {')',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
lstrcpynW(wszDrive, pszPath, 4);
pszPath[0] = L'\0';
GetVolumeInformationW (wszDrive, pszPath,
MAX_PATH - 7,
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
&dwVolumeSerialNumber,
&dwMaximumComponentLength, &dwFileSystemFlags, NULL, 0);
pszPath[MAX_PATH-1] = L'\0';
if (!wcslen(pszPath))
{
UINT DriveType, ResourceId;
DriveType = GetDriveTypeW(wszDrive);
switch(DriveType)
{
case DRIVE_FIXED:
ResourceId = IDS_DRIVE_FIXED;
break;
case DRIVE_REMOTE:
ResourceId = IDS_DRIVE_NETWORK;
break;
case DRIVE_CDROM:
ResourceId = IDS_DRIVE_CDROM;
break;
default:
ResourceId = 0;
}
if (ResourceId)
{
dwFileSystemFlags = LoadStringW(shell32_hInstance, ResourceId, pszPath, MAX_PATH);
if (dwFileSystemFlags > MAX_PATH - 7)
pszPath[MAX_PATH-7] = L'\0';
}
}
wcscat (pszPath, wszOpenBracket);
wszDrive[2] = L'\0';
wcscat (pszPath, wszDrive);
wcscat (pszPath, wszCloseBracket);
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
}
}
else
{
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
/* Neither a shell namespace extension nor a drive letter. */
ERR("Wrong pidl type\n");
Vitaly Lipatov : Use sizeof instead of constant for buffer size. <lav at etersoft.ru> Alexander Nicolaysen Sørnes : Handle backspace key in shellview. <alex at thehandofagony.com> Gerald Pfeifer : Avoid checking for <0 for unsigned variables. <gerald at pfeifer.com> Thomas Weidenmueller : Use SHStrDupW in IShellFolder2:: GetDetailsOf to allocate returned string. <thomas at reactsoft.com> Rob Shearman : Fix the length calculation of the pidl in ILSaveToStream by using the helper function ILGetSize . <rob at codeweavers.com> Rob Shearman : Fix a memory leak in Stream_WriteLocationInfo. <rob at codeweavers.com> Lei Zhang : Don't crash if $HOME is not set. <thestig at google.com> Alexandre Julliard : Pass some of the ShellExecute flags through InvokeCommand. <julliard at winehq.org> Juan Lang : Don't overwrite the caller's buffer when doing a dde connection. <juan.lang at gmail.com> Juan Lang : Remove a bad comment. <juan.lang at gmail.com> Juan Lang : Use more restricted registry rights when quering values. <juan.lang at gmail.com> Rob Shearman : Add a stub for LinkWindow_RegisterClass. <rob at codeweavers.com> Rob Shearman : Add a stub for LinkWindow_UnregisterClass. <rob at codeweavers.com> Michael Stefaniuc : Fix a mem leak on an error path. Found by Smatch. <mstefani at redhat.de> Marcus Meissner : GetModuleFileNameW gets number of WCHARs not bytes. <marcus at jet.franken.de> Lei Zhang : rename My Video to My Videos. <thestig at google.com> svn path=/trunk/; revision=31071
2007-12-08 13:03:24 +00:00
CoTaskMemFree(pszPath);
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
return E_INVALIDARG;
}
}
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
else
{
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
/* Complex pidl. Let the child folder do the work */
hr = SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, pszPath, MAX_PATH);
}
if (SUCCEEDED (hr))
{
strRet->uType = STRRET_WSTR;
strRet->u.pOleStr = pszPath;
}
else
CoTaskMemFree(pszPath);
TRACE ("-- (%p)->(%s)\n", This, strRet->uType == STRRET_CSTR ? strRet->u.cStr : debugstr_w(strRet->u.pOleStr));
return hr;
}
/**************************************************************************
* ISF_MyComputer_fnSetNameOf
* Changes the name of a file object or subfolder, possibly changing its item
* identifier in the process.
*
* PARAMETERS
* hwndOwner [in] Owner window for output
* pidl [in] simple pidl of item to change
* lpszName [in] the items new display name
* dwFlags [in] SHGNO formatting flags
* ppidlOut [out] simple pidl returned
*/
static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl,
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
LPWSTR sName;
HKEY hKey;
UINT length;
- 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 szName[30];
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 (_ILIsDrive(pidl))
{
if (_ILSimpleGetTextW(pidl, szName, sizeof(szName)/sizeof(WCHAR)))
{
SetVolumeLabelW(szName, lpName);
}
if (pPidlOut)
*pPidlOut = _ILCreateDrive(szName);
return S_OK;
}
if (pPidlOut != NULL)
{
*pPidlOut = _ILCreateMyComputer();
}
length = (wcslen(lpName)+1) * sizeof(WCHAR);
sName = SHAlloc(length);
if (!sName)
{
return E_OUTOFMEMORY;
}
if (RegOpenKeyExW(HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
0,
KEY_WRITE,
&hKey) != ERROR_SUCCESS)
{
WARN("Error: failed to open registry key\n");
}
else
{
RegSetValueExW(hKey, NULL, 0, REG_SZ, (const LPBYTE)lpName, length);
RegCloseKey(hKey);
}
wcscpy(sName, lpName);
SHFree(This->sName);
This->sName = sName;
TRACE("result %s\n", debugstr_w(This->sName));
return S_OK;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (
IShellFolder2 * iface, GUID * pguid)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (
IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI ISF_MyComputer_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_MyComputer_fnGetDefaultColumnState (
IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
TRACE ("(%p)\n", This);
if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG;
*pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
return S_OK;
}
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface,
LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
FIXME ("(%p)\n", This);
return E_NOTIMPL;
}
/* FIXME: drive size >4GB is rolling over */
static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface,
LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
HRESULT hr;
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
return E_INVALIDARG;
if (!pidl)
{
psd->fmt = MyComputerSFHeader[iColumn].fmt;
psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
psd->str.uType = STRRET_CSTR;
LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid,
psd->str.u.cStr, MAX_PATH);
return S_OK;
}
else
{
char szPath[MAX_PATH];
ULARGE_INTEGER ulBytes;
psd->str.u.cStr[0] = 0x00;
psd->str.uType = STRRET_CSTR;
switch (iColumn)
{
case 0: /* name */
hr = IShellFolder_GetDisplayNameOf (iface, pidl,
SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
break;
case 1: /* type */
_ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
break;
case 2: /* total size */
if (_ILIsDrive (pidl))
{
_ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
}
break;
case 3: /* free size */
if (_ILIsDrive (pidl))
{
_ILSimpleGetText (pidl, szPath, MAX_PATH);
GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL);
StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
}
break;
}
hr = S_OK;
}
return hr;
}
static HRESULT WINAPI ISF_MyComputer_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_ShellFolder2 =
{
ISF_MyComputer_fnQueryInterface,
ISF_MyComputer_fnAddRef,
ISF_MyComputer_fnRelease,
ISF_MyComputer_fnParseDisplayName,
ISF_MyComputer_fnEnumObjects,
ISF_MyComputer_fnBindToObject,
ISF_MyComputer_fnBindToStorage,
ISF_MyComputer_fnCompareIDs,
ISF_MyComputer_fnCreateViewObject,
ISF_MyComputer_fnGetAttributesOf,
ISF_MyComputer_fnGetUIObjectOf,
ISF_MyComputer_fnGetDisplayNameOf,
ISF_MyComputer_fnSetNameOf,
/* ShellFolder2 */
ISF_MyComputer_fnGetDefaultSearchGUID,
ISF_MyComputer_fnEnumSearches,
ISF_MyComputer_fnGetDefaultColumn,
ISF_MyComputer_fnGetDefaultColumnState,
ISF_MyComputer_fnGetDetailsEx,
ISF_MyComputer_fnGetDetailsOf,
ISF_MyComputer_fnMapColumnToSCID
};
/************************************************************************
* IMCFldr_PersistFolder2_QueryInterface
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (
IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
return IUnknown_QueryInterface (_IUnknown_ (This), iid, ppvObj);
}
/************************************************************************
* IMCFldr_PersistFolder2_AddRef
*/
static ULONG WINAPI IMCFldr_PersistFolder2_AddRef (IPersistFolder2 * iface)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return IUnknown_AddRef (_IUnknown_ (This));
}
/************************************************************************
* ISFPersistFolder_Release
*/
static ULONG WINAPI IMCFldr_PersistFolder2_Release (IPersistFolder2 * iface)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(count=%u)\n", This, This->ref);
return IUnknown_Release (_IUnknown_ (This));
}
/************************************************************************
* IMCFldr_PersistFolder2_GetClassID
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
IPersistFolder2 * iface, CLSID * lpClassId)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)\n", This);
if (!lpClassId)
return E_POINTER;
*lpClassId = CLSID_MyComputer;
return S_OK;
}
/************************************************************************
* IMCFldr_PersistFolder2_Initialize
*
* NOTES: it makes no sense to change the pidl
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
IPersistFolder2 * iface, LPCITEMIDLIST pidl)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, 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
if (This->pidlRoot)
SHFree((LPVOID)This->pidlRoot);
This->pidlRoot = ILClone(pidl);
return S_OK;
}
/**************************************************************************
* IPersistFolder2_fnGetCurFolder
*/
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (
IPersistFolder2 * iface, LPITEMIDLIST * pidl)
{
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
IGenericSFImpl *This = impl_from_IPersistFolder2(iface);
TRACE ("(%p)->(%p)\n", This, pidl);
if (!pidl)
return E_POINTER;
*pidl = ILClone (This->pidlRoot);
return S_OK;
}
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 IPersistFolder2Vtbl vt_PersistFolder2 =
{
IMCFldr_PersistFolder2_QueryInterface,
IMCFldr_PersistFolder2_AddRef,
IMCFldr_PersistFolder2_Release,
IMCFldr_PersistFolder2_GetClassID,
IMCFldr_PersistFolder2_Initialize,
IMCFldr_PersistFolder2_GetCurFolder
};