reactos/dll/win32/shell32/enumidlist.c

389 lines
9.3 KiB
C
Raw Normal View History

/*
* IEnumIDList
*
* Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
*
* 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
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <precomp.h>
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct tagENUMLIST
{
struct tagENUMLIST *pNext;
LPITEMIDLIST pidl;
} ENUMLIST, *LPENUMLIST;
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 IEnumIDListVtbl *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;
LPENUMLIST mpFirst;
LPENUMLIST mpLast;
LPENUMLIST mpCurrent;
} IEnumIDListImpl;
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 IEnumIDListVtbl eidlvt;
/**************************************************************************
* AddToEnumList()
*/
BOOL AddToEnumList(
IEnumIDList * iface,
LPITEMIDLIST pidl)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
LPENUMLIST pNew;
TRACE("(%p)->(pidl=%p)\n",This,pidl);
if (!iface || !pidl)
return FALSE;
pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST));
if(pNew)
{
/*set the next pointer */
pNew->pNext = NULL;
pNew->pidl = pidl;
/*is This the first item in the list? */
if(!This->mpFirst)
{
This->mpFirst = pNew;
This->mpCurrent = pNew;
}
if(This->mpLast)
{
/*add the new item to the end of the list */
This->mpLast->pNext = pNew;
}
/*update the last item pointer */
This->mpLast = pNew;
TRACE("-- (%p)->(first=%p, last=%p)\n",This,This->mpFirst,This->mpLast);
return TRUE;
}
return FALSE;
}
/**************************************************************************
* HasItemWithCLSID()
*/
BOOL HasItemWithCLSID(IEnumIDList *iface, LPITEMIDLIST pidl)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
LPENUMLIST pCur;
REFIID refid = _ILGetGUIDPointer(pidl);
pCur = This->mpFirst;
while(pCur)
{
LPGUID curid = _ILGetGUIDPointer(pCur->pidl);
if (curid && IsEqualGUID(curid, refid))
{
return TRUE;
}
pCur = pCur->pNext;
}
return FALSE;
}
/**************************************************************************
* CreateFolderEnumList()
*/
BOOL CreateFolderEnumList(
IEnumIDList *list,
LPCWSTR lpszPath,
DWORD dwFlags)
{
LPITEMIDLIST pidl=NULL;
WIN32_FIND_DATAW stffile;
HANDLE hFile;
WCHAR szPath[MAX_PATH];
BOOL succeeded = TRUE;
static const WCHAR stars[] = { '*','.','*',0 };
static const WCHAR dot[] = { '.',0 };
static const WCHAR dotdot[] = { '.','.',0 };
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("(%p)->(path=%s flags=0x%08x)\n", list, debugstr_w(lpszPath), dwFlags);
if(!lpszPath || !lpszPath[0]) return FALSE;
wcscpy(szPath, lpszPath);
PathAddBackslashW(szPath);
wcscat(szPath,stars);
hFile = FindFirstFileW(szPath,&stffile);
if ( hFile != INVALID_HANDLE_VALUE )
{
BOOL findFinished = FALSE;
do
{
if ( !(stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
|| (dwFlags & SHCONTF_INCLUDEHIDDEN) )
{
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
dwFlags & SHCONTF_FOLDERS &&
strcmpW(stffile.cFileName, dot) && strcmpW(stffile.cFileName, dotdot))
{
pidl = _ILCreateFromFindDataW(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl);
}
else if (!(stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
&& dwFlags & SHCONTF_NONFOLDERS)
{
pidl = _ILCreateFromFindDataW(&stffile);
succeeded = succeeded && AddToEnumList(list, pidl);
}
}
if (succeeded)
{
if (!FindNextFileW(hFile, &stffile))
{
if (GetLastError() == ERROR_NO_MORE_FILES)
findFinished = TRUE;
else
succeeded = FALSE;
}
}
} while (succeeded && !findFinished);
FindClose(hFile);
}
return succeeded;
}
/**************************************************************************
* DeleteList()
*/
static BOOL DeleteList(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
LPENUMLIST pDelete;
TRACE("(%p)->()\n",This);
while(This->mpFirst)
{ pDelete = This->mpFirst;
This->mpFirst = pDelete->pNext;
SHFree(pDelete->pidl);
SHFree(pDelete);
}
This->mpFirst = This->mpLast = This->mpCurrent = NULL;
return TRUE;
}
/**************************************************************************
* IEnumIDList_Folder_Constructor
*
*/
IEnumIDList * IEnumIDList_Constructor(void)
{
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
IEnumIDListImpl *lpeidl = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl));
if (lpeidl)
{
lpeidl->ref = 1;
lpeidl->lpVtbl = &eidlvt;
}
TRACE("-- (%p)->()\n",lpeidl);
return (IEnumIDList*)lpeidl;
}
/**************************************************************************
* EnumIDList_QueryInterface
*/
static HRESULT WINAPI IEnumIDList_fnQueryInterface(
IEnumIDList * iface,
REFIID riid,
LPVOID *ppvObj)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = This;
}
else if(IsEqualIID(riid, &IID_IEnumIDList)) /*IEnumIDList*/
{ *ppvObj = (IEnumIDList*)This;
}
if(*ppvObj)
{ IEnumIDList_AddRef((IEnumIDList*)*ppvObj);
TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IEnumIDList_fnAddRef
*/
static ULONG WINAPI IEnumIDList_fnAddRef(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
ULONG refCount = InterlockedIncrement(&This->ref);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("(%p)->(%u)\n", This, refCount - 1);
return refCount;
}
/******************************************************************************
* IEnumIDList_fnRelease
*/
static ULONG WINAPI IEnumIDList_fnRelease(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
ULONG refCount = InterlockedDecrement(&This->ref);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("(%p)->(%u)\n", This, refCount + 1);
if (!refCount) {
TRACE(" destroying IEnumIDList(%p)\n",This);
DeleteList((IEnumIDList*)This);
HeapFree(GetProcessHeap(),0,This);
}
return refCount;
}
/**************************************************************************
* IEnumIDList_fnNext
*/
static HRESULT WINAPI IEnumIDList_fnNext(
IEnumIDList * iface,
ULONG celt,
LPITEMIDLIST * rgelt,
ULONG *pceltFetched)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
ULONG i;
HRESULT hr = S_OK;
LPITEMIDLIST temp;
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("(%p)->(%d,%p, %p)\n",This,celt,rgelt,pceltFetched);
/* It is valid to leave pceltFetched NULL when celt is 1. Some of explorer's
* subsystems actually use it (and so may a third party browser)
*/
if(pceltFetched)
*pceltFetched = 0;
*rgelt=0;
if(celt > 1 && !pceltFetched)
{ return E_INVALIDARG;
}
if(celt > 0 && !This->mpCurrent)
{ return S_FALSE;
}
for(i = 0; i < celt; i++)
{ if(!(This->mpCurrent))
break;
temp = ILClone(This->mpCurrent->pidl);
rgelt[i] = temp;
This->mpCurrent = This->mpCurrent->pNext;
}
if(pceltFetched)
{ *pceltFetched = i;
}
return hr;
}
/**************************************************************************
* IEnumIDList_fnSkip
*/
static HRESULT WINAPI IEnumIDList_fnSkip(
IEnumIDList * iface,ULONG celt)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
DWORD dwIndex;
HRESULT hr = S_OK;
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("(%p)->(%u)\n",This,celt);
for(dwIndex = 0; dwIndex < celt; dwIndex++)
{ if(!This->mpCurrent)
{ hr = S_FALSE;
break;
}
This->mpCurrent = This->mpCurrent->pNext;
}
return hr;
}
/**************************************************************************
* IEnumIDList_fnReset
*/
static HRESULT WINAPI IEnumIDList_fnReset(
IEnumIDList * iface)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)\n",This);
This->mpCurrent = This->mpFirst;
return S_OK;
}
/**************************************************************************
* IEnumIDList_fnClone
*/
static HRESULT WINAPI IEnumIDList_fnClone(
IEnumIDList * iface,LPENUMIDLIST * ppenum)
{
IEnumIDListImpl *This = (IEnumIDListImpl *)iface;
TRACE("(%p)->() to (%p)->() E_NOTIMPL\n",This,ppenum);
return E_NOTIMPL;
}
/**************************************************************************
* IEnumIDList_fnVTable
*/
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 IEnumIDListVtbl eidlvt =
{
IEnumIDList_fnQueryInterface,
IEnumIDList_fnAddRef,
IEnumIDList_fnRelease,
IEnumIDList_fnNext,
IEnumIDList_fnSkip,
IEnumIDList_fnReset,
IEnumIDList_fnClone,
};