ReactOS 0.4.16-dev-306-g647d351
pidl.c File Reference
#include <wine/config.h>
#include <windef.h>
#include <winbase.h>
#include <strsafe.h>
#include <shlobj.h>
#include <undocshell.h>
#include <shlwapi.h>
#include <shlguid_undoc.h>
#include <wine/debug.h>
#include <wine/unicode.h>
#include "pidl.h"
#include "shell32_main.h"
#include "shresdef.h"
Include dependency graph for pidl.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COBJMACROS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (pidl)
 
 WINE_DECLARE_DEBUG_CHANNEL (shell)
 
LPVOID WINAPI Alloc (INT)
 
BOOL WINAPI Free (LPVOID)
 
static LPSTR _ILGetSTextPointer (LPCITEMIDLIST pidl)
 
static LPWSTR _ILGetTextPointerW (LPCITEMIDLIST pidl)
 
EXTERN_C HWND BindCtx_GetUIWindow (_In_ IBindCtx *pBindCtx)
 
EXTERN_C HRESULT BindCtx_RegisterObjectParam (_In_ IBindCtx *pBindCtx, _In_ LPOLESTR pszKey, _In_opt_ IUnknown *punk, _Out_ LPBC *ppbc)
 
static BOOL ILGetDisplayNameExA (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
 
BOOL ILGetDisplayNameExW (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
 
BOOL WINAPI ILGetDisplayNameEx (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPVOID path, DWORD type)
 
BOOL WINAPI ILGetDisplayName (LPCITEMIDLIST pidl, LPVOID path)
 
LPITEMIDLIST WINAPI ILFindLastID (LPCITEMIDLIST pidl)
 
BOOL WINAPI ILRemoveLastID (LPITEMIDLIST pidl)
 
LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl)
 
LPITEMIDLIST WINAPI ILCloneFirst (LPCITEMIDLIST pidl)
 
HRESULT WINAPI ILLoadFromStream (IStream *pStream, LPITEMIDLIST *ppPidl)
 
HRESULT WINAPI ILSaveToStream (IStream *pStream, LPCITEMIDLIST pPidl)
 
HRESULT WINAPI SHILCreateFromPathA (LPCSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
 
HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
 
HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST *ppidl, DWORD *attributes)
 
LPITEMIDLIST WINAPI SHCloneSpecialIDList (HWND hwndOwner, int nFolder, BOOL fCreate)
 
LPITEMIDLIST WINAPI ILGlobalClone (LPCITEMIDLIST pidl)
 
BOOL _ILHACKCompareSimpleIds (LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
 
BOOL WINAPI ILIsEqual (LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 
LPCITEMIDLIST _ILIsParentEx (LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
 
BOOL WINAPI ILIsParent (LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
 
PUIDLIST_RELATIVE WINAPI ILFindChild (PIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
 
LPITEMIDLIST WINAPI ILCombine (LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 
HRESULT WINAPI SHGetRealIDL (LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
 
LPITEMIDLIST WINAPI SHLogILFromFSIL (LPITEMIDLIST pidl)
 
UINT WINAPI ILGetSize (LPCITEMIDLIST pidl)
 
LPITEMIDLIST WINAPI ILGetNext (LPCITEMIDLIST pidl)
 
LPITEMIDLIST WINAPI ILAppendID (LPITEMIDLIST pidl, LPCSHITEMID item, BOOL bEnd)
 
void WINAPI ILFree (LPITEMIDLIST pidl)
 
void WINAPI ILGlobalFree (LPITEMIDLIST pidl)
 
LPITEMIDLIST WINAPI ILCreateFromPathA (LPCSTR path)
 
LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path)
 
LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
 
static HRESULT _ILParsePathW (LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
 
LPITEMIDLIST SHELL32_CreateSimpleIDListFromPath (LPCWSTR pszPath, DWORD dwAttributes)
 
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath)
 
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath)
 
LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath)
 
HRESULT WINAPI SHGetDataFromIDListA (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len)
 
HRESULT WINAPI SHGetDataFromIDListW (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len)
 
BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl, LPSTR pszPath)
 
HRESULT WINAPI SHGetPathCchFromIDListW (_In_ LPCITEMIDLIST pidl, _Out_writes_(cchPathMax) LPWSTR pszPath, _In_ SIZE_T cchPathMax)
 
BOOL WINAPI SHGetPathFromIDListW (LPCITEMIDLIST pidl, LPWSTR pszPath)
 
HRESULT WINAPI SHBindToParent (LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
 
HRESULT WINAPI SHParseDisplayName (LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
 
HRESULT WINAPI SHGetNameFromIDList (PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName)
 
HRESULT WINAPI SHGetIDListFromObject (IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
 
static LPITEMIDLIST _ILAlloc (PIDLTYPE type, unsigned int size)
 
LPITEMIDLIST _ILCreateDesktop (void)
 
LPITEMIDLIST _ILCreateMyComputer (void)
 
LPITEMIDLIST _ILCreateMyDocuments (void)
 
LPITEMIDLIST _ILCreateIExplore (void)
 
LPITEMIDLIST _ILCreateControlPanel (void)
 
LPITEMIDLIST _ILCreatePrinters (void)
 
LPITEMIDLIST _ILCreateNetwork (void)
 
LPITEMIDLIST _ILCreateBitBucket (void)
 
LPITEMIDLIST _ILCreateAdminTools (void)
 
LPITEMIDLIST _ILCreateGuid (PIDLTYPE type, REFIID guid)
 
LPITEMIDLIST _ILCreateGuidFromStrA (LPCSTR szGUID)
 
LPITEMIDLIST _ILCreateGuidFromStrW (LPCWSTR szGUID)
 
LPITEMIDLIST _ILCreateFromFindDataW (const WIN32_FIND_DATAW *wfd)
 
HRESULT _ILCreateFromPathW (LPCWSTR szPath, LPITEMIDLIST *ppidl)
 
LPITEMIDLIST _ILCreateDrive (LPCWSTR lpszNew)
 
LPITEMIDLIST _ILCreateEntireNetwork (void)
 
DWORD _ILGetDrive (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uSize)
 
BOOL _ILIsUnicode (LPCITEMIDLIST pidl)
 
BOOL _ILIsDesktop (LPCITEMIDLIST pidl)
 
BOOL _ILIsMyDocuments (LPCITEMIDLIST pidl)
 
BOOL _ILIsNetHood (LPCITEMIDLIST pidl)
 
BOOL _ILIsControlPanel (LPCITEMIDLIST pidl)
 
BOOL _ILIsMyComputer (LPCITEMIDLIST pidl)
 
BOOL _ILIsBitBucket (LPCITEMIDLIST pidl)
 
BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl)
 
BOOL _ILIsDrive (LPCITEMIDLIST pidl)
 
BOOL _ILIsFolder (LPCITEMIDLIST pidl)
 
BOOL _ILIsValue (LPCITEMIDLIST pidl)
 
BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl)
 
BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl)
 
DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
 
LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST pidl)
 
LPSTR _ILGetTextPointer (LPCITEMIDLIST pidl)
 
IID_ILGetGUIDPointer (LPCITEMIDLIST pidl)
 
FileStructW_ILGetFileStructW (LPCITEMIDLIST pidl)
 
BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *pFt)
 
BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
 
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
 
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
 
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
 
void _ILFreeaPidl (LPITEMIDLIST *apidl, UINT cidl)
 
PITEMID_CHILD_ILCopyaPidl (PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl)
 
LPITEMIDLIST_ILCopyCidaToaPidl (LPITEMIDLIST *pidl, const CIDA *cida)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 28 of file pidl.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 29 of file pidl.c.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 31 of file pidl.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 30 of file pidl.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 27 of file pidl.c.

Function Documentation

◆ _ILAlloc()

static LPITEMIDLIST _ILAlloc ( PIDLTYPE  type,
unsigned int  size 
)
static

Definition at line 1719 of file pidl.c.

1720{
1721 LPITEMIDLIST pidlOut = NULL;
1722
1723 pidlOut = SHAlloc(size + 5);
1724 if(pidlOut)
1725 {
1727 LPITEMIDLIST pidlNext;
1728
1729 ZeroMemory(pidlOut, size + 5);
1730 pidlOut->mkid.cb = size + 3;
1731
1732 pData = _ILGetDataPointer(pidlOut);
1733 if (pData)
1734 pData->type = type;
1735
1736 pidlNext = ILGetNext(pidlOut);
1737 if (pidlNext)
1738 pidlNext->mkid.cb = 0x00;
1739 TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
1740 }
1741
1742 return pidlOut;
1743}
#define NULL
Definition: types.h:112
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2264
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:968
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define TRACE(s)
Definition: solgame.cpp:4
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define ZeroMemory
Definition: winbase.h:1737

Referenced by _ILCreateDrive(), _ILCreateEntireNetwork(), _ILCreateFromFindDataW(), and _ILCreateGuid().

◆ _ILCopyaPidl()

PITEMID_CHILD * _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2668 of file pidl.c.

2669{
2670 UINT i;
2671 PITEMID_CHILD *apidldest;
2672
2673 if (!apidlsrc)
2674 return NULL;
2675
2676 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2677
2678 for (i = 0; i < cidl; i++)
2679 apidldest[i] = ILClone(apidlsrc[i]);
2680
2681 return apidldest;
2682}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

Referenced by CDefaultContextMenu::Initialize(), and CCPLItemMenu::Initialize().

◆ _ILCopyCidaToaPidl()

LPITEMIDLIST * _ILCopyCidaToaPidl ( LPITEMIDLIST pidl,
const CIDA cida 
)

Definition at line 2689 of file pidl.c.

2690{
2691 UINT i;
2693
2694 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2695 if (!dst)
2696 return NULL;
2697
2698 if (pidl)
2699 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2700
2701 for (i = 0; i < cida->cidl; i++)
2702 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2703
2704 return dst;
2705}
GLenum GLenum dst
Definition: glext.h:6340
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
UINT cidl
Definition: shlobj.h:572
unsigned char BYTE
Definition: xxhash.c:193

Referenced by CFSDropTarget::_DoDrop(), and SH_GetApidlFromDataObject().

◆ _ILCreateAdminTools()

LPITEMIDLIST _ILCreateAdminTools ( void  )

Definition at line 1832 of file pidl.c.

1833{
1834 TRACE("()\n");
1836}
const GUID CLSID_AdminFolderShortcut
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1838
#define PT_GUID
Definition: pidl.h:87

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1826 of file pidl.c.

1827{
1828 TRACE("()\n");
1829 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1830}

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1774 of file pidl.c.

1775{
1776 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1777
1778 TRACE("()\n");
1779 if (parent)
1780 {
1781 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1782
1783 if (cpl)
1784 {
1785 ret = ILCombine(parent, cpl);
1786 SHFree(cpl);
1787 }
1788 SHFree(parent);
1789 }
1790 return ret;
1791}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
r parent
Definition: btrfs.c:3010
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:814
#define PT_SHELLEXT
Definition: pidl.h:91
int ret

Referenced by CCPLItemMenu::InvokeCommand(), and SHGetFolderLocation().

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1745 of file pidl.c.

1746{
1748
1749 TRACE("()\n");
1750 ret = SHAlloc(2);
1751 if (ret)
1752 ret->mkid.cb = 0;
1753 return ret;
1754}

Referenced by BrFolder_OnOK(), CDesktopFolder::FinalConstruct(), and SHGetFolderLocation().

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1959 of file pidl.c.

1960{
1961 LPITEMIDLIST pidlOut;
1962
1963 TRACE("(%s)\n",debugstr_w(lpszNew));
1964
1965 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1966 if (pidlOut)
1967 {
1968 LPSTR pszDest = _ILGetTextPointer(pidlOut);
1969 if (pszDest)
1970 {
1971 lstrcpyA(pszDest, "x:\\");
1972 pszDest[0] = toupper(lpszNew[0]);
1973 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1974 }
1975 }
1976 return pidlOut;
1977}
int toupper(int c)
Definition: utclib.c:881
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2331
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1719
#define PT_DRIVE
Definition: pidl.h:88
char * LPSTR
Definition: xmlstorage.h:182

Referenced by CDrivesFolderEnum::Initialize(), CDrivesFolder::ParseDisplayName(), and CDrivesFolder::SetNameOf().

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1979 of file pidl.c.

1980{
1981 LPITEMIDLIST pidlOut;
1982
1983 TRACE("\n");
1984
1985 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1986 if (pidlOut)
1987 {
1989
1990 pData->u.network.dummy = 0;
1991 strcpy(pData->u.network.szNames, "Entire Network");
1992 }
1993 return pidlOut;
1994}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define PT_NETWORK
Definition: pidl.h:101
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

◆ _ILCreateFromFindDataW()

LPITEMIDLIST _ILCreateFromFindDataW ( const WIN32_FIND_DATAW wfd)

Definition at line 1892 of file pidl.c.

1893{
1894 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1895 DWORD len, len1, wlen, alen;
1896 LPITEMIDLIST pidl;
1897 PIDLTYPE type;
1898
1899 if (!wfd)
1900 return NULL;
1901
1902 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1903
1904 /* prepare buffer with both names */
1905 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1906 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1907 alen = len + len1;
1908
1909 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1910
1911 wlen = lstrlenW(wfd->cFileName) + 1;
1912 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1913 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1914 if (pidl)
1915 {
1917 FileStruct *fs = &pData->u.file;
1918 FileStructW *fsw;
1919 WORD *pOffsetW;
1920
1921 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1922 fs->dwFileSize = wfd->nFileSizeLow;
1923 fs->uFileAttribs = wfd->dwFileAttributes;
1924 memcpy(fs->szNames, buff, alen);
1925
1926 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1927 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1928 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1929 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1930 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1931
1932 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1933 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1934 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1935 }
1936 return pidl;
1937
1938}
#define CP_ACP
Definition: compat.h:109
#define MAX_PATH
Definition: compat.h:34
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
Definition: time.c:37
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define PT_FOLDER
Definition: pidl.h:94
#define PT_VALUE
Definition: pidl.h:95
BYTE PIDLTYPE
Definition: pidl.h:132
WCHAR wszName[1]
Definition: shlfolder.c:1555
Definition: ffs.h:70
unsigned char * LPBYTE
Definition: typedefs.h:53
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CFileSysEnum::_AddFindResult(), CFSFolder::_CreateIDListFromName(), _ILCreateFromPathW(), and CFSFolder::_ParseSimple().

◆ _ILCreateFromPathW()

HRESULT _ILCreateFromPathW ( LPCWSTR  szPath,
LPITEMIDLIST ppidl 
)

Definition at line 1940 of file pidl.c.

1941{
1942 HANDLE hFile;
1943 WIN32_FIND_DATAW stffile;
1944
1945 if (!ppidl)
1946 return E_INVALIDARG;
1947
1948 hFile = FindFirstFileW(szPath, &stffile);
1951
1953
1954 *ppidl = _ILCreateFromFindDataW(&stffile);
1955
1956 return *ppidl ? S_OK : E_OUTOFMEMORY;
1957}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
#define S_OK
Definition: intsafe.h:52
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
_In_ HANDLE hFile
Definition: mswsock.h:90
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *wfd)
Definition: pidl.c:1892
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1838 of file pidl.c.

1839{
1840 LPITEMIDLIST pidlOut;
1841
1842 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1843 {
1844 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1845 if (pidlOut)
1846 {
1848
1849 pData->u.guid.guid = *guid;
1850 TRACE("-- create GUID-pidl %s\n",
1851 debugstr_guid(&(pData->u.guid.guid)));
1852 }
1853 }
1854 else
1855 {
1856 WARN("%d: invalid type for GUID\n", type);
1857 pidlOut = NULL;
1858 }
1859 return pidlOut;
1860}
#define WARN(fmt,...)
Definition: precomp.h:61
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid
#define PT_YAGUID
Definition: pidl.h:103

Referenced by _ILCreateAdminTools(), _ILCreateBitBucket(), _ILCreateControlPanel(), _ILCreateGuidFromStrA(), _ILCreateGuidFromStrW(), _ILCreateIExplore(), _ILCreateMyComputer(), _ILCreateMyDocuments(), _ILCreateNetwork(), and _ILCreatePrinters().

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1863 of file pidl.c.

1864{
1865 IID iid;
1866
1867 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1868 {
1869 ERR("%s is not a GUID\n", szGUID);
1870 return NULL;
1871 }
1872 return _ILCreateGuid(PT_GUID, &iid);
1873}
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:248
#define FAILED(hr)
Definition: intsafe.h:51

◆ _ILCreateGuidFromStrW()

LPITEMIDLIST _ILCreateGuidFromStrW ( LPCWSTR  szGUID)

Definition at line 1875 of file pidl.c.

1876{
1877 IID iid;
1878
1879#ifndef __REACTOS__
1880 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1881#else
1882 if (!GUIDFromStringW(szGUID, &iid))
1883#endif
1884 {
1885 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1886 return NULL;
1887 }
1888 return _ILCreateGuid(PT_GUID, &iid);
1889}
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1768 of file pidl.c.

1769{
1770 TRACE("()\n");
1771 return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1772}

Referenced by SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1756 of file pidl.c.

1757{
1758 TRACE("()\n");
1759 return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
1760}

Referenced by CDesktopFolder::_ParseDisplayNameByParent(), CDrivesFolder::FinalConstruct(), CDesktopFolder::ParseDisplayName(), and SHGetFolderLocation().

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1762 of file pidl.c.

1763{
1764 TRACE("()\n");
1765 return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1766}

Referenced by CMyDocsFolder::FinalConstruct(), and SHGetFolderLocation().

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1820 of file pidl.c.

1821{
1822 TRACE("()\n");
1823 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1824}

Referenced by CDesktopFolder::_ParseDisplayNameByParent(), and SHGetFolderLocation().

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1793 of file pidl.c.

1794{
1795#ifdef __REACTOS__
1796 // Note: Wine returns the PIDL as it was in Windows 95, NT5 moved it into CSIDL_CONTROLS
1797 extern HRESULT SHGetFolderLocationHelper(HWND hwnd, int nFolder, REFCLSID clsid, LPITEMIDLIST *ppidl);
1798 LPITEMIDLIST pidl;
1799 SHGetFolderLocationHelper(NULL, CSIDL_CONTROLS, &CLSID_Printers, &pidl);
1800 return pidl;
1801#else
1802 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1803
1804 TRACE("()\n");
1805 if (parent)
1806 {
1807 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1808
1809 if (printers)
1810 {
1811 ret = ILCombine(parent, printers);
1812 SHFree(printers);
1813 }
1814 SHFree(parent);
1815 }
1816 return ret;
1817#endif
1818}
REFCLSID clsid
Definition: msctf.c:82
#define REFCLSID
Definition: guiddef.h:117
#define CSIDL_CONTROLS
Definition: shlobj.h:2176
_In_ int nFolder
Definition: shlobj.h:1519
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2651 of file pidl.c.

2652{
2653 UINT i;
2654
2655 if (apidl)
2656 {
2657 for (i = 0; i < cidl; i++)
2658 SHFree(apidl[i]);
2659 SHFree(apidl);
2660 }
2661}

Referenced by CFSDropTarget::_DoDrop(), CFSDropTarget::_RepositionItems(), DrivesContextMenuCallback(), RegFolderContextMenuCallback(), CCPLItemMenu::~CCPLItemMenu(), and CDefaultContextMenu::~CDefaultContextMenu().

◆ _ILGetDataPointer()

◆ _ILGetDrive()

DWORD _ILGetDrive ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uSize 
)

Definition at line 2004 of file pidl.c.

2005{
2006 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
2007
2008 if(_ILIsMyComputer(pidl))
2009 pidl = ILGetNext(pidl);
2010
2011 if (pidl && _ILIsDrive(pidl))
2012 return _ILSimpleGetTextW(pidl, pOut, uSize);
2013
2014 return 0;
2015}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:2080
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2113
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2184

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

BOOL _ILGetExtension ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2564 of file pidl.c.

2565{
2566 WCHAR szTemp[MAX_PATH];
2567 LPCWSTR pPoint;
2568 LPCITEMIDLIST pidlTemp = pidl;
2569
2570 TRACE("pidl=%p\n",pidl);
2571
2572 if (!pidl)
2573 return FALSE;
2574
2575 pidlTemp = ILFindLastID(pidl);
2576
2577 if (!_ILIsValue(pidlTemp))
2578 return FALSE;
2579 if (!_ILSimpleGetTextW(pidlTemp, szTemp, _countof(szTemp)))
2580 return FALSE;
2581
2582 pPoint = PathFindExtensionW(szTemp);
2583
2584 if (!*pPoint)
2585 return FALSE;
2586
2587 pPoint++;
2588 lstrcpynW(pOut, pPoint, uOutSize);
2589 TRACE("%s\n", debugstr_w(pOut));
2590
2591 return TRUE;
2592}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynW
Definition: compat.h:738
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2134
#define _countof(array)
Definition: sndvol32.h:70
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by SHELL32_GetFSItemAttributes(), and SHELL_IsShortcut().

◆ _ILGetFileAttributes()

DWORD _ILGetFileAttributes ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2611 of file pidl.c.

2612{
2614 WORD wAttrib = 0;
2615 int i;
2616
2617 if (!pData)
2618 return 0;
2619
2620 switch(pData->type)
2621 {
2622 case PT_FOLDER:
2623 case PT_VALUE:
2624 wAttrib = pData->u.file.uFileAttribs;
2625 break;
2626 }
2627
2628 if(uOutSize >= 6)
2629 {
2630 i=0;
2631 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2632 pOut[i++] = L'R';
2633 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2634 pOut[i++] = L'H';
2635 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2636 pOut[i++] = L'S';
2637 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2638 pOut[i++] = L'A';
2639 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2640 pOut[i++] = L'C';
2641 pOut[i] = UNICODE_NULL;
2642 }
2643 return wAttrib;
2644}
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50

Referenced by CFSFolder::CreateViewObject(), CFSFolder::GetDetailsOf(), getIconLocationForFolder(), SHELL32_GetFSItemAttributes(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetFileDate()

BOOL _ILGetFileDate ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2499 of file pidl.c.

2500{
2501 FILETIME ft,lft;
2503 BOOL ret;
2504
2505 if (_ILGetFileDateTime( pidl, &ft ))
2506 {
2507 FileTimeToLocalFileTime(&ft, &lft);
2508 FileTimeToSystemTime (&lft, &time);
2509
2511 if (ret)
2512 {
2513 /* Append space + time without seconds */
2514 pOut[ret - 1] = L' ';
2516 }
2517 }
2518 else
2519 {
2520 pOut[0] = UNICODE_NULL;
2521 ret = FALSE;
2522 }
2523 return ret;
2524}
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
unsigned int BOOL
Definition: ntddk_ex.h:94
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
__u16 time
Definition: mkdosfs.c:8
#define LOCALE_USER_DEFAULT
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2480
#define TIME_NOSECONDS
Definition: winnls.h:280
#define DATE_SHORTDATE
Definition: winnls.h:198

Referenced by CFSFolder::GetDetailsOf().

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME pFt 
)

Definition at line 2480 of file pidl.c.

2481{
2483
2484 if (!pdata)
2485 return FALSE;
2486
2487 switch (pdata->type)
2488 {
2489 case PT_FOLDER:
2490 case PT_VALUE:
2491 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2492 break;
2493 default:
2494 return FALSE;
2495 }
2496 return TRUE;
2497}
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
static PROTOCOLDATA * pdata
Definition: protocol.c:158

Referenced by _ILGetFileDate(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetFileSize()

DWORD _ILGetFileSize ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2543 of file pidl.c.

2544{
2546 DWORD dwSize;
2547
2548 if (!pdata)
2549 return 0;
2550
2551 switch (pdata->type)
2552 {
2553 case PT_VALUE:
2554 dwSize = pdata->u.file.dwFileSize;
2555 if (pOut)
2556 StrFormatKBSizeW(dwSize, pOut, uOutSize);
2557 return dwSize;
2558 }
2559 if (pOut)
2560 *pOut = UNICODE_NULL;
2561 return 0;
2562}
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1757
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by CFSFolder::GetDetailsOf(), SHGetDataFromIDListA(), SHGetDataFromIDListW(), and CDefView::UpdateStatusbar().

◆ _ILGetFileStructW()

FileStructW * _ILGetFileStructW ( LPCITEMIDLIST  pidl)

Definition at line 2438 of file pidl.c.

2438 {
2439 FileStructW *pFileStructW;
2440 WORD cbOffset;
2441
2442 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2443 return NULL;
2444
2445 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2446 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2447
2448 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2449 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2450 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2451 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2452 /* FileStructW is positioned after FileStruct */
2453 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2454 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2455 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2456 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2457 {
2458 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2459 return NULL;
2460 }
2461
2462 return pFileStructW;
2463}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2125
struct tagFileStruct FileStruct

Referenced by CFSFolder::_CreateShellExtInstance(), _ILHACKCompareSimpleIds(), _ILSimpleGetTextW(), AddFSClassKeysToArray(), CFSFolder::BindToObject(), CFSFolder::CompareIDs(), GetItemFileName(), and CFSFolder::SetNameOf().

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2402 of file pidl.c.

2403{
2405
2406 TRACE("%p\n", pidl);
2407
2408 if (!pdata)
2409 return NULL;
2410
2411 TRACE("pdata->type 0x%04x\n", pdata->type);
2412 switch (pdata->type)
2413 {
2414 case PT_SHELLEXT:
2415 case PT_GUID:
2416 case PT_YAGUID:
2417 return &(pdata->u.guid.guid);
2418
2419 default:
2420 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2421 break;
2422 }
2423 return NULL;
2424}

Referenced by _ILHACKCompareSimpleIds(), _ILIsBitBucket(), _ILIsControlPanel(), _ILIsMyComputer(), _ILIsMyDocuments(), _ILIsNetHood(), _ILSimpleGetTextW(), CRegFolder::_IsInNameSpace(), CRegFolder::BindToObject(), CGuidItemExtractIcon_CreateInstance(), CRegFolder::CompareIDs(), CRegItemContextMenu_CreateInstance(), CRegFolder::GetDetailsOf(), CRegFolder::GetDisplayNameOf(), CRegFolder::GetUIObjectOf(), HCR_GetFolderAttributes(), CRegFolderInfo::IsRegItem(), and CRegFolder::SetNameOf().

◆ _ILGetSTextPointer()

static LPSTR _ILGetSTextPointer ( LPCITEMIDLIST  pidl)
static

Definition at line 2374 of file pidl.c.

2375{
2376 /* TRACE(pidl,"(pidl%p)\n", pidl); */
2377
2379
2380 if (!pdata)
2381 return NULL;
2382
2383 switch (pdata->type)
2384 {
2385 case PT_FOLDER:
2386 case PT_VALUE:
2387 case PT_IESPECIAL1:
2388 case PT_IESPECIAL2:
2389 return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
2390
2391 case PT_WORKGRP:
2392 return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
2393 }
2394 return NULL;
2395}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_IESPECIAL1
Definition: pidl.h:102
#define PT_IESPECIAL2
Definition: pidl.h:104

Referenced by SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2331 of file pidl.c.

2332{
2333 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2334
2336
2337 if (!pdata)
2338 return NULL;
2339
2340 switch (pdata->type)
2341 {
2342 case PT_GUID:
2343 case PT_SHELLEXT:
2344 case PT_YAGUID:
2345 return NULL;
2346
2347 case PT_DRIVE:
2348 case PT_DRIVE1:
2349 case PT_DRIVE2:
2350 case PT_DRIVE3:
2351 return pdata->u.drive.szDriveName;
2352
2353 case PT_FOLDER:
2354 case PT_FOLDER1:
2355 case PT_VALUE:
2356 case PT_IESPECIAL1:
2357 case PT_IESPECIAL2:
2358 return pdata->u.file.szNames;
2359
2360 case PT_WORKGRP:
2361 case PT_COMP:
2362 case PT_NETWORK:
2363 case PT_NETPROVIDER:
2364 case PT_SHARE:
2365 return pdata->u.network.szNames;
2366 }
2367 return NULL;
2368}
#define PT_DRIVE1
Definition: pidl.h:92
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_DRIVE2
Definition: pidl.h:89
#define PT_SHARE
Definition: pidl.h:105
#define PT_COMP
Definition: pidl.h:99
#define PT_NETPROVIDER
Definition: pidl.h:100

Referenced by _ILCreateDrive(), _ILSimpleGetTextW(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetTextPointerW()

static LPWSTR _ILGetTextPointerW ( LPCITEMIDLIST  pidl)
static

Definition at line 2275 of file pidl.c.

2276{
2277 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2278
2280
2281 if (!pdata)
2282 return NULL;
2283
2284 switch (pdata->type)
2285 {
2286 case PT_GUID:
2287 case PT_SHELLEXT:
2288 case PT_YAGUID:
2289 return NULL;
2290
2291 case PT_DRIVE:
2292 case PT_DRIVE1:
2293 case PT_DRIVE2:
2294 case PT_DRIVE3:
2295 /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
2296 return NULL;
2297
2298 case PT_FOLDER:
2299 case PT_FOLDER1:
2300 case PT_VALUE:
2301 case PT_IESPECIAL1:
2302 case PT_IESPECIAL2:
2303 /*return (LPSTR)&(pdata->u.file.szNames);*/
2304 return NULL;
2305
2306 case PT_WORKGRP:
2307 case PT_COMP:
2308 case PT_NETWORK:
2309 case PT_NETPROVIDER:
2310 case PT_SHARE:
2311 /*return (LPSTR)&(pdata->u.network.szNames);*/
2312 return NULL;
2313
2314 case PT_VALUEW:
2315 return (LPWSTR)pdata->u.file.szNames;
2316
2317#ifdef __REACTOS__ /* r54423 */
2318 case PT_CPLAPPLET:
2319 return pdata->u.cpanel.szName;
2320#endif
2321
2322 }
2323 return NULL;
2324}
#define PT_VALUEW
Definition: pidl.h:96
#define PT_CPLAPPLET
Definition: pidl.h:86
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _ILSimpleGetTextW().

◆ _ILHACKCompareSimpleIds()

BOOL _ILHACKCompareSimpleIds ( LPCITEMIDLIST  pidltemp1,
LPCITEMIDLIST  pidltemp2 
)

Definition at line 519 of file pidl.c.

520{
521 LPPIDLDATA pdata1 = _ILGetDataPointer(pidltemp1);
522 LPPIDLDATA pdata2 = _ILGetDataPointer(pidltemp2);
523
524 IID *iid1 = _ILGetGUIDPointer(pidltemp1);
525 IID *iid2 = _ILGetGUIDPointer(pidltemp2);
526
527 FileStructW* pDataW1 = _ILGetFileStructW(pidltemp1);
528 FileStructW* pDataW2 = _ILGetFileStructW(pidltemp2);
529
530 if (_ILIsDesktop(pidltemp1) && _ILIsDesktop(pidltemp2))
531 {
532 return TRUE;
533 }
534 else if (_ILIsDesktop(pidltemp1) || _ILIsDesktop(pidltemp2))
535 {
536 return FALSE;
537 }
538 else if (iid1 || iid2)
539 {
540 if (!iid1 || !iid2 || memcmp(iid1, iid2, sizeof(GUID)))
541 return FALSE;
542 }
543 else if (pDataW1 || pDataW2)
544 {
545 if (!pDataW1 || !pDataW2 || wcsicmp(pDataW1->wszName, pDataW2->wszName))
546 return FALSE;
547 }
548 else if (_ILIsFolder(pidltemp1) || _ILIsFolder(pidltemp2))
549 {
550 if (!_ILIsFolder(pidltemp1) || !_ILIsFolder(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
551 return FALSE;
552 }
553 else if (_ILIsValue(pidltemp1) || _ILIsValue(pidltemp2))
554 {
555 if (!_ILIsValue(pidltemp1) || !_ILIsValue(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
556 return FALSE;
557 }
558 else if (_ILIsDrive(pidltemp1) || _ILIsDrive(pidltemp2))
559 {
560 if (!_ILIsDrive(pidltemp1) || !_ILIsDrive(pidltemp2) || pdata1->u.drive.szDriveName[0] != pdata2->u.drive.szDriveName[0])
561 return FALSE;
562 }
563 else
564 {
565 if ((pidltemp1->mkid.cb != pidltemp2->mkid.cb) ||
566 !RtlEqualMemory((BYTE*)&pidltemp1->mkid, (BYTE*)&pidltemp2->mkid, pidltemp1->mkid.cb))
567 {
568 return FALSE;
569 }
570 }
571
572 return TRUE;
573}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define wcsicmp
Definition: compat.h:15
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2438
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2402
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:2040
struct tagDriveStruct drive
Definition: pidl.h:220
struct tagFileStruct file
Definition: pidl.h:221
union tagPIDLDATA::@558 u

Referenced by ILFindChild(), ILIsEqual(), and ILIsParent().

◆ _ILIsBitBucket()

BOOL _ILIsBitBucket ( LPCITEMIDLIST  pidl)

Definition at line 2091 of file pidl.c.

2092{
2093 IID *iid = _ILGetGUIDPointer(pidl);
2094
2095 TRACE("(%p)\n", pidl);
2096
2097 if (iid)
2098 return IsEqualIID(iid, &CLSID_RecycleBin);
2099 return FALSE;
2100}
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

Referenced by CGuidItemExtractIcon_CreateInstance(), and CDefView::UpdateStatusbar().

◆ _ILIsControlPanel()

BOOL _ILIsControlPanel ( LPCITEMIDLIST  pidl)

Definition at line 2069 of file pidl.c.

2070{
2071 IID *iid = _ILGetGUIDPointer(pidl);
2072
2073 TRACE("(%p)\n", pidl);
2074
2075 if (iid)
2076 return IsEqualIID(iid, &CLSID_ControlPanel);
2077 return FALSE;
2078}

Referenced by CDrivesFolder::GetAttributesOf(), and CDefView::OnCreate().

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2143 of file pidl.c.

2144{
2145 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2146
2147 TRACE("(%p)\n",pidl);
2148
2149 return (pidl && lpPData && (lpPData->type == 0));
2150}
PIDLTYPE type
Definition: pidl.h:216

Referenced by CControlPanelFolder::GetAttributesOf(), and CControlPanelFolder::GetUIObjectOf().

◆ _ILIsDesktop()

BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 2040 of file pidl.c.

2041{
2042 TRACE("(%p)\n",pidl);
2043
2044 return !pidl || !pidl->mkid.cb;
2045}

Referenced by _ILHACKCompareSimpleIds(), _ILIsEmpty(), _ILIsPidlSimple(), _ILSimpleGetTextW(), ILAppendID(), and ILFindChild().

◆ _ILIsDrive()

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 2080 of file pidl.c.

2081{
2082 REFIID iid = _ILGetGUIDPointer(pidl);
2083
2084 TRACE("(%p)\n",pidl);
2085
2086 if (iid)
2087 return IsEqualIID(iid, &CLSID_MyComputer);
2088 return FALSE;
2089}
#define REFIID
Definition: guiddef.h:118

Referenced by _ILGetDrive(), BrFolder_Treeview_Expand(), and CDesktopFolder::GetAttributesOf().

◆ _ILIsMyDocuments()

BOOL _ILIsMyDocuments ( LPCITEMIDLIST  pidl)

Definition at line 2047 of file pidl.c.

2048{
2049 IID *iid = _ILGetGUIDPointer(pidl);
2050
2051 TRACE("(%p)\n", pidl);
2052
2053 if (iid)
2054 return IsEqualIID(iid, &CLSID_MyDocuments);
2055 return FALSE;
2056}

◆ _ILIsNetHood()

BOOL _ILIsNetHood ( LPCITEMIDLIST  pidl)

Definition at line 2058 of file pidl.c.

2059{
2060 IID *iid = _ILGetGUIDPointer(pidl);
2061
2062 TRACE("(%p)\n", pidl);
2063
2064 if (iid)
2065 return IsEqualIID(iid, &CLSID_NetworkPlaces);
2066 return FALSE;
2067}

Referenced by CDesktopFolder::GetAttributesOf(), and CDefView::OnCreate().

◆ _ILIsParentEx()

LPCITEMIDLIST _ILIsParentEx ( LPCITEMIDLIST  pidlParent,
LPCITEMIDLIST  pidlChild,
BOOL  bImmediate 
)

Definition at line 636 of file pidl.c.

637{
638 LPCITEMIDLIST pParentRoot = pidlParent, pChildRoot = pidlChild, pResult = NULL;
639 LPITEMIDLIST pidl;
640 SIZE_T cb = 0;
641
642 if (!pidlParent || !pidlChild)
643 return pResult;
644
645 while (pidlParent->mkid.cb)
646 {
647 cb += pidlChild->mkid.cb;
648 if (!pidlChild->mkid.cb)
649 {
650 if (pidlParent->mkid.cb)
651 return pResult; /* The child is shorter than the parent */
652 else
653 break;
654 }
655 pidlChild = _ILUnsafeNext(pidlChild);
656 pidlParent = _ILUnsafeNext(pidlParent);
657 }
658
659 if (bImmediate && (!pidlChild->mkid.cb || _ILUnsafeNext(pidlChild)->mkid.cb))
660 return pResult; /* Same as parent or a deeper grandchild */
661
662 if ((pidl = SHAlloc(cb + sizeof(WORD))) != NULL)
663 {
664 CopyMemory(pidl, pChildRoot, cb);
665 ZeroMemory((BYTE*)pidl + cb, sizeof(WORD));
666 if (ILIsEqual(pParentRoot, pidl))
667 pResult = pidlChild;
668 ILFree(pidl);
669 }
670 return pResult;
671}
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1042
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:580
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define CopyMemory
Definition: winbase.h:1735

Referenced by ILFindChild(), and ILIsParent().

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 2155 of file pidl.c.

2156{
2157 BOOL ret = TRUE;
2158
2159 if(! _ILIsDesktop(pidl)) /* pidl=NULL or mkid.cb=0 */
2160 {
2161 WORD len = pidl->mkid.cb;
2162 LPCITEMIDLIST pidlnext = (LPCITEMIDLIST) (((const BYTE*)pidl) + len );
2163
2164 if (pidlnext->mkid.cb)
2165 ret = FALSE;
2166 }
2167
2168 TRACE("%s\n", ret ? "Yes" : "No");
2169 return ret;
2170}

Referenced by SHBindToParent().

◆ _ILIsSpecialFolder()

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 2031 of file pidl.c.

2032{
2033 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2034
2035 TRACE("(%p)\n",pidl);
2036
2037 return (pidl && lpPData && PT_VALUEW == lpPData->type);
2038}

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILParsePathW()

static HRESULT _ILParsePathW ( LPCWSTR  path,
LPWIN32_FIND_DATAW  lpFindFile,
BOOL  bBindCtx,
LPITEMIDLIST ppidl,
LPDWORD  prgfInOut 
)
static

Definition at line 1147 of file pidl.c.

1149{
1150 LPSHELLFOLDER pSF = NULL;
1151 LPBC pBC = NULL;
1152 HRESULT ret;
1153
1154 TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
1155 ppidl, ppidl ? *ppidl : NULL,
1156 prgfInOut, prgfInOut ? *prgfInOut : 0);
1157
1158 ret = SHGetDesktopFolder(&pSF);
1159 if (FAILED(ret))
1160 return ret;
1161
1162 if (lpFindFile || bBindCtx)
1163 ret = IFileSystemBindData_Constructor(lpFindFile, &pBC);
1164
1165 if (SUCCEEDED(ret))
1166 {
1167 ret = IShellFolder_ParseDisplayName(pSF, 0, pBC, (LPOLESTR)path, NULL, ppidl, prgfInOut);
1168 }
1169
1170 if (pBC)
1171 {
1172 IBindCtx_Release(pBC);
1173 pBC = NULL;
1174 }
1175
1176 IShellFolder_Release(pSF);
1177
1178 if (FAILED(ret) && ppidl)
1179 *ppidl = NULL;
1180
1181 TRACE("%s %p 0x%x\n", debugstr_w(path), ppidl ? *ppidl : NULL, prgfInOut ? *prgfInOut : 0);
1182
1183 return ret;
1184}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
#define IShellFolder_ParseDisplayName
Definition: utils.cpp:14
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static LPOLESTR
Definition: stg_prop.c:27
interface IBindCtx * LPBC
Definition: objfwd.h:18

Referenced by SHELL32_CreateSimpleIDListFromPath(), SHSimpleIDListFromPathA(), and SHSimpleIDListFromPathW().

◆ _ILSimpleGetTextW()

DWORD _ILSimpleGetTextW ( LPCITEMIDLIST  pidl,
LPWSTR  szOut,
UINT  uOutSize 
)

Definition at line 2184 of file pidl.c.

2185{
2186 DWORD dwReturn;
2187 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2188
2189 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2190
2191 if (pFileStructW) {
2192 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2193 dwReturn = lstrlenW(pFileStructW->wszName);
2194 } else {
2195 GUID const * riid;
2196 WCHAR szTemp[MAX_PATH];
2197 LPSTR szSrc;
2198 LPWSTR szSrcW;
2199 dwReturn=0;
2200
2201 if (!pidl)
2202 return 0;
2203
2204 if (szOut)
2205 *szOut = 0;
2206
2207 if (_ILIsDesktop(pidl))
2208 {
2209 /* desktop */
2210 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, _countof(szTemp)))
2211 {
2212 if (szOut)
2213 lstrcpynW(szOut, szTemp, uOutSize);
2214
2215 dwReturn = lstrlenW (szTemp);
2216 }
2217 }
2218 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2219 {
2220 /* unicode filesystem */
2221 if (szOut)
2222 lstrcpynW(szOut, szSrcW, uOutSize);
2223
2224 dwReturn = lstrlenW(szSrcW);
2225 }
2226 else if (( szSrc = _ILGetTextPointer(pidl) ))
2227 {
2228 /* filesystem */
2229 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, _countof(szTemp));
2230
2231 if (szOut)
2232 lstrcpynW(szOut, szTemp, uOutSize);
2233
2234 dwReturn = lstrlenW (szTemp);
2235 }
2236 else if (( riid = _ILGetGUIDPointer(pidl) ))
2237 {
2238 /* special folder */
2239 if ( HCR_GetClassNameW(riid, szTemp, _countof(szTemp)))
2240 {
2241 if (szOut)
2242 lstrcpynW(szOut, szTemp, uOutSize);
2243
2244 dwReturn = lstrlenW (szTemp);
2245 }
2246 }
2247 else
2248 {
2249 ERR("-- no text\n");
2250 }
2251 }
2252
2253 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2254 return dwReturn;
2255}
#define MultiByteToWideChar
Definition: compat.h:110
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2275
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:422

Referenced by CDesktopFolder::_GetSFFromPidl(), _ILGetDrive(), _ILGetExtension(), AddFSClassKeysToArray(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), GetItemFileName(), RenderHDROP(), CDrivesFolder::SetNameOf(), and SHELL32_GetFSItemAttributes().

◆ Alloc()

LPVOID WINAPI Alloc ( INT  )

Referenced by ILGlobalClone().

◆ BindCtx_GetUIWindow()

EXTERN_C HWND BindCtx_GetUIWindow ( _In_ IBindCtx pBindCtx)

Definition at line 368 of file utils.cpp.

369{
370 HWND hWnd = NULL;
371
373 if (pBindCtx && SUCCEEDED(pBindCtx->GetObjectParam((LPWSTR)L"UI During Binding", &punk)))
374 IUnknown_GetWindow(punk, &hWnd);
375
376 return hWnd;
377}
HWND hWnd
Definition: settings.c:17
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336

Referenced by SHParseDisplayName().

◆ BindCtx_RegisterObjectParam()

EXTERN_C HRESULT BindCtx_RegisterObjectParam ( _In_ IBindCtx pBindCtx,
_In_ LPOLESTR  pszKey,
_In_opt_ IUnknown punk,
_Out_ LPBC ppbc 
)

Definition at line 428 of file utils.cpp.

433{
434 HRESULT hr = S_OK;
436
437 *ppbc = pBindCtx;
438
439 if (pBindCtx)
440 {
441 pBindCtx->AddRef();
442 }
443 else
444 {
445 hr = CreateBindCtx(0, ppbc);
446 if (FAILED(hr))
447 return hr;
448 }
449
450 if (!punk)
451 punk = pUnknown = new CDummyOleWindow();
452
453 hr = (*ppbc)->RegisterObjectParam(pszKey, punk);
454
455 if (pUnknown)
456 pUnknown->Release();
457
458 if (FAILED(hr))
459 {
460 (*ppbc)->Release();
461 *ppbc = NULL;
462 }
463
464 return hr;
465}
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
ULONG Release()
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
HRESULT hr
Definition: shlfolder.c:183

Referenced by SHParseDisplayName().

◆ Free()

BOOL WINAPI Free ( LPVOID  lpMem)

Definition at line 113 of file comctl32undoc.c.

114{
115 return !LocalFree( lpMem );
116}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

◆ ILAppendID()

LPITEMIDLIST WINAPI ILAppendID ( LPITEMIDLIST  pidl,
LPCSHITEMID  item,
BOOL  bEnd 
)

Definition at line 1002 of file pidl.c.

1003{
1004 LPITEMIDLIST idlRet;
1006
1007 WARN("(pidl=%p,pidl=%p,%08u)semi-stub\n",pidl,item,bEnd);
1008
1009 pdump (pidl);
1010 pdump (itemid);
1011
1012 if (_ILIsDesktop(pidl))
1013 {
1014 idlRet = ILClone(itemid);
1015 SHFree (pidl);
1016 return idlRet;
1017 }
1018
1019 if (bEnd)
1020 idlRet = ILCombine(pidl, itemid);
1021 else
1022 idlRet = ILCombine(itemid, pidl);
1023
1024 SHFree(pidl);
1025 return idlRet;
1026}
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
static ATOM item
Definition: dde.c:856

Referenced by init_function_pointers().

◆ ILClone()

LPITEMIDLIST WINAPI ILClone ( LPCITEMIDLIST  pidl)

Definition at line 237 of file pidl.c.

238{
239 DWORD len;
240 LPITEMIDLIST newpidl;
241
242 if (!pidl)
243 return NULL;
244
245 len = ILGetSize(pidl);
246 newpidl = SHAlloc(len);
247 if (newpidl)
248 memcpy(newpidl,pidl,len);
249
250 TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
251 pdump(pidl);
252
253 return newpidl;
254}
#define ILGetSize
Definition: shellclasses.h:638

Referenced by _ILCopyaPidl(), _ILCopyCidaToaPidl(), _ILReadFromSharedMemory(), CAddressEditBox::AddComboBoxItem(), CMergedFolder::AddNameSpace(), CEnumMergedFolder::Begin(), BrFolder_InitTreeView(), BrFolder_InsertItem(), BrFolder_OnOK(), BrFolder_Treeview_Changed(), CDesktopBrowser::BrowseObject(), DoGetAliasPIDLs(), ExplorerMessageLoop(), FILEDLG95_LOOKIN_AddItem(), FM_SetMenuParameter(), CShellItem::get_parent_pidl(), CISFBand::GetBandInfoSFB(), CFontExt::GetCurFolder(), CZipFolder::GetCurFolder(), CFindFolder::GetCurFolder(), CNetworkConnections::GetCurFolder(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetCurFolder(), CAdminToolsFolder::GetCurFolder(), CControlPanelFolder::GetCurFolder(), CDesktopFolder::GetCurFolder(), CDrivesFolder::GetCurFolder(), CFontsFolder::GetCurFolder(), CFSFolder::GetCurFolder(), CMyDocsFolder::GetCurFolder(), CNetFolder::GetCurFolder(), CPrinterFolder::GetCurFolder(), CRecycleBin::GetCurFolder(), CShellItem::GetIDList(), CShellLink::GetIDList(), GetParentPidl(), CTravelEntry::GetPidl(), GetPidlFromDataObject(), CMenuSFToolbar::GetShellFolder(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), CShellBrowser::GetWindowData(), ILAppendID(), ILCombine(), ILIsParentOrSpecialParent(), CViewStatePropertyBag::Init(), init_function_pointers(), CDefaultContextMenu::Initialize(), CFolderItem::Initialize(), CFontExt::Initialize(), CRecycleBinItemContextMenu::Initialize(), CShellFolderViewCBWrapper::Initialize(), CNtObjectFolderExtractIcon::Initialize(), CRegistryFolderExtractIcon::Initialize(), CFolder::Initialize(), CFolderItems::Initialize(), CZipFolder::Initialize(), CFindFolder::Initialize(), CNetworkConnections::Initialize(), CCommonFolder< TSelf, TItemId, TExtractIcon >::Initialize(), CNtObjectFolder::Initialize(), CRegistryFolder::Initialize(), CACListISF::Initialize(), CAdminToolsFolder::Initialize(), CControlPanelFolder::Initialize(), CFontsFolder::Initialize(), CFSFolder::Initialize(), CMyDocsFolder::Initialize(), CNetFolder::Initialize(), CPrinterFolder::Initialize(), CRecycleBin::Initialize(), CMergedFolder::Initialize(), CNewMenu::Initialize(), CRegFolder::Initialize(), CFSFolder::InitializeEx(), CISFBand::InitializeSFB(), IShellBrowserImpl_BrowseObject(), CDefView::Item(), CDefView::LV_AddItem(), CDefView::LV_RenameItem(), CShellBrowser::NavigateToParent(), CEnumIDListBase::Next(), CEnumMergedFolder::Next(), CEnumIDList::Next(), CACListISF::NextLocation(), CAddressEditBox::OnWinEvent(), CMergedFolder::ParseDisplayName(), ParseSharedPacket(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), CShellItem::SetIDList(), CMenuSFToolbar::SetShellFolder(), CShellLink::SetTargetFromPIDLOrPath(), SHBindToFolderIDListParent(), SHBindToParent(), SHCloneIETHREADPARAM(), SHCreateFromDesktop(), SHCreateShellItem(), SHILClone(), and test_AttributesRegistration().

◆ ILCloneFirst()

LPITEMIDLIST WINAPI ILCloneFirst ( LPCITEMIDLIST  pidl)

Definition at line 262 of file pidl.c.

263{
264 DWORD len;
265 LPITEMIDLIST pidlNew = NULL;
266
267 TRACE("pidl=%p\n", pidl);
268 pdump(pidl);
269
270 if (pidl)
271 {
272 len = pidl->mkid.cb;
273 pidlNew = SHAlloc(len+2);
274 if (pidlNew)
275 {
276 memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */
277
278 if (len)
279 ILGetNext(pidlNew)->mkid.cb = 0x00;
280 }
281 }
282 TRACE("-- newpidl=%p\n",pidlNew);
283
284 return pidlNew;
285}

Referenced by CMruNode::_GetPidlSlot(), CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject(), CCommonFolder< TSelf, TItemId, TExtractIcon >::CompareIDs(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDisplayNameOf(), init_function_pointers(), SHELL32_BindToSF(), SHELL32_CompareChildren(), and SHELL32_GetDisplayNameOfChild().

◆ ILCombine()

LPITEMIDLIST WINAPI ILCombine ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 814 of file pidl.c.

815{
816 DWORD len1,len2;
817 LPITEMIDLIST pidlNew;
818
819 TRACE("pidl=%p pidl=%p\n",pidl1,pidl2);
820
821 if (!pidl1 && !pidl2) return NULL;
822
823 pdump (pidl1);
824 pdump (pidl2);
825
826 if (!pidl1)
827 {
828 pidlNew = ILClone(pidl2);
829 return pidlNew;
830 }
831
832 if (!pidl2)
833 {
834 pidlNew = ILClone(pidl1);
835 return pidlNew;
836 }
837
838 len1 = ILGetSize(pidl1)-2;
839 len2 = ILGetSize(pidl2);
840 pidlNew = SHAlloc(len1+len2);
841
842 if (pidlNew)
843 {
844 memcpy(pidlNew,pidl1,len1);
845 memcpy(((BYTE *)pidlNew)+len1,pidl2,len2);
846 }
847
848 /* TRACE(pidl,"--new pidl=%p\n",pidlNew);*/
849 return pidlNew;
850}

Referenced by _ILCreateControlPanel(), _ILCreatePrinters(), CDesktopFolder::_ParseDisplayNameByParent(), CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject(), BrFolder_InsertItem(), ShellPath::create_absolute_pidl(), CFontExt::Drop(), CMyDocsDropHandler::Drop(), CDeskLinkDropHandler::Drop(), FILEDLG95_LOOKIN_Init(), CAddressEditBox::FillOneLevel(), FM_InitMenuPopup(), ICommDlgBrowser3_fnIncludeObject(), ILAppendID(), init_function_pointers(), COpenWithMenu::Initialize(), CZipFolder::Initialize(), CDefaultContextMenu::InvokePidl(), IShellBrowserImpl_BrowseObject(), CShellLink::Load(), CSendToMenu::LoadAllItems(), CDefView::OnNotify(), CCommonFolder< TSelf, TItemId, TExtractIcon >::ParseDisplayName(), CFolder::ParseName(), CAddressEditBox::ParseNow(), RenderFILENAMEA(), RenderFILENAMEW(), RenderHDROP(), SHCreateShellItem(), SHELL32_CoCreateInitSF(), SHELL32_ParseNextElement(), SHELL_CIDA_ILCloneFull(), SHGetRealIDL(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), and TestHIDA().

◆ ILCreateFromPathA()

LPITEMIDLIST WINAPI ILCreateFromPathA ( LPCSTR  path)

Definition at line 1083 of file pidl.c.

1084{
1085 LPITEMIDLIST pidlnew = NULL;
1086
1087 TRACE_(shell)("%s\n", debugstr_a(path));
1088
1089 if (SUCCEEDED(SHILCreateFromPathA(path, &pidlnew, NULL)))
1090 return pidlnew;
1091 return NULL;
1092}
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define TRACE_(x)
Definition: compat.h:76
HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:389

Referenced by ILCreateFromPathAW(), and init_function_pointers().

◆ ILCreateFromPathAW()

LPITEMIDLIST WINAPI ILCreateFromPathAW ( LPCVOID  path)

Definition at line 1113 of file pidl.c.

1114{
1115 if ( SHELL_OsIsUnicode())
1116 return ILCreateFromPathW (path);
1117 return ILCreateFromPathA (path);
1118}
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1099
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path)
Definition: pidl.c:1083
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:145

◆ ILCreateFromPathW()

◆ ILFindChild()

PUIDLIST_RELATIVE WINAPI ILFindChild ( PIDLIST_ABSOLUTE  pidl1,
PCIDLIST_ABSOLUTE  pidl2 
)

Definition at line 748 of file pidl.c.

749{
750#ifdef __REACTOS__
751 TRACE("pidl1=%p pidl2=%p\n", pidl1, pidl2);
752
753 if (_ILIsDesktop(pidl1))
754 return (PUIDLIST_RELATIVE)pidl2;
755 return (PUIDLIST_RELATIVE)_ILIsParentEx(pidl1, pidl2, FALSE);
756#else /* __REACTOS__ */
757 LPCITEMIDLIST pidltemp1 = pidl1;
758 LPCITEMIDLIST pidltemp2 = pidl2;
760
761 TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
762
763 /* explorer reads from registry directly (StreamMRU),
764 so we can only check here */
765 if ((!pcheck (pidl1)) || (!pcheck (pidl2)))
766 return FALSE;
767
768 pdump (pidl1);
769 pdump (pidl2);
770
771 if (_ILIsDesktop(pidl1))
772 {
773 ret = pidl2;
774 }
775 else
776 {
777 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
778 {
779 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
780 return FALSE;
781
782 pidltemp1 = ILGetNext(pidltemp1);
783 pidltemp2 = ILGetNext(pidltemp2);
784 ret = pidltemp2;
785 }
786
787 if (pidltemp1->mkid.cb)
788 ret = NULL; /* elements of pidl1 left*/
789 }
790 TRACE_(shell)("--- %p\n", ret);
791 return (PUIDLIST_RELATIVE)ret; /* pidl 1 is shorter */
792#endif /* __REACTOS__ */
793}
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:349
BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
Definition: pidl.c:519
LPCITEMIDLIST _ILIsParentEx(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
Definition: pidl.c:636
ITEMIDLIST_RELATIVE UNALIGNED * PUIDLIST_RELATIVE
Definition: shtypes.idl:55

Referenced by CExplorerBand::_NavigateToPIDL(), init_function_pointers(), ShellBrowser::jump_to(), and START_TEST().

◆ ILFindLastID()

◆ ILFree()

void WINAPI ILFree ( LPITEMIDLIST  pidl)

Definition at line 1042 of file pidl.c.

1043{
1044 TRACE("(pidl=%p)\n",pidl);
1045 SHFree(pidl);
1046}

Referenced by CMenuBand::_CallCB(), CMruNode::_GetPidlSlot(), _ILIsParentEx(), CFSFolder::_ParseSimple(), _tmain(), CRegFolderEnum::AddItemsFromKey(), CEnumMergedFolder::Begin(), CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject(), BrFolder_ExpandToPidl(), BrFolder_OnInitDialog(), BrFolder_Treeview_Changed(), BrFolder_Treeview_Rename(), BrowseSelectedFolder(), CShellBrowser::BrowseToPath(), CShellItem::Compare(), DoTestEntry(), CFontExt::Drop(), CEnumMergedFolder::DsaDeleteCallback(), ebrowser_browse_to_desktop(), CAddressEditBox::Execute(), ExplorerMessageLoop(), FILEDLG95_FillControls(), FILEDLG95_LOOKIN_AddItem(), FILEDLG95_LOOKIN_Clean(), FILEDLG95_LOOKIN_Init(), FILEDLG95_LOOKIN_InsertItemAfterParent(), FILEDLG95_LOOKIN_RemoveMostExpandedItem(), FILEDLG95_OnOpen(), FILEDLG95_OnOpenMultipleFiles(), FILEDLG95_OnWMCommand(), FILEDLG95_SHELL_Clean(), FILEDLG95_ValidatePathAction(), CAddressEditBox::FillOneLevel(), CShellItem::get_parent_pidl(), CShellItem::get_parent_shellfolder(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetDisplayNameOf(), GetFavoritesFolder(), GetFileDialog95(), GetMergedFolder(), CMenuCallback::GetObject(), CShellItem::GetParent(), GetParsingName(), CShellBrowser::GetPropertyBag(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), ICommDlgBrowser3_fnIncludeObject(), IEGetNameAndFlagsEx(), CRegFolderEnum::Initialize(), CAddressEditBox::Invoke(), CDefaultContextMenu::InvokePidl(), IShellBrowserImpl_BrowseObject(), IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(), CShellLink::Load(), CShellBrowser::LoadHistory(), MRUList_PidlList_0(), CShellBrowser::NavigateToParent(), on_default_action(), CMenuSFToolbar::OnDeletingButton(), CShellBrowser::OnDestroy(), CShellLink::OnInitDialog(), CDefView::OnNotify(), CShellBrowser::OnOrganizeFavorites(), CAddressEditBox::OnWinEvent(), CDesktopFolder::ParseDisplayName(), CRegFolder::ParseDisplayName(), CCommonFolder< TSelf, TItemId, TExtractIcon >::ParseDisplayName(), CAddressEditBox::ParseNow(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), RenderHDROP(), CShellLink::Reset(), RSHELL_CStartMenu_CreateInstance(), CShellItem::SetIDList(), CShellLink::SetTargetFromPIDLOrPath(), SHBindToFolderIDListParent(), SHBrowseForFolderW(), SHChangeNotify(), SHChangeNotifyRegister(), SHCreateShellItem(), SHDestroyIETHREADPARAM(), SHELL32_BindToSF(), SHELL32_CoCreateInitSF(), SHELL32_CompareChildren(), SHELL32_GetDisplayNameOfChild(), SHELL32_ParseNextElement(), SHELL32_PropertySheet(), SHELL_GetCaptionFromDataObject(), CDesktopFolder::ShellUrlParseDisplayName(), SHExplorerParseCmdLine(), SHILAppend(), SHObjectProperties(), SHOpenNewFrame(), START_TEST(), StartWithCommandLine(), test_basics(), test_BindToObject(), test_DataObject(), test_desktop_displaynameof(), test_desktop_IPersist(), test_FolderShortcut(), test_get_file_info_iconlist(), test_GetDisplayName(), test_GetUIObject(), test_ITEMIDLIST_format(), test_navigation(), test_parse_for_control_panel(), test_parse_for_entire_network(), test_ParseDisplayNamePBC(), test_printers_folder(), test_sei_lpIDList(), test_SHChangeNotify(), test_SHCreateDefaultContextMenu(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), test_ShellItemArrayEnumItems(), test_ShellItemArrayGetAttributes(), test_ShellItemBindToHandler(), test_ShellItemCompare(), test_ShellItemGetAttributes(), test_SHGetIDListFromObject(), test_SHGetItemFromDataObject(), test_SHGetKnownFolderIDList(), test_SHGetNameFromIDList(), test_ShortcutFolder(), test_SHParseDisplayName(), test_SHSimpleIDListFromPath(), TestCommandLine(), CDefaultContextMenu::TryToBrowse(), CTravelEntry::Update(), CAddressEditBox::~CAddressEditBox(), CCommonFolder< TSelf, TItemId, TExtractIcon >::~CCommonFolder(), CMergedFolder::~CMergedFolder(), CNewMenu::~CNewMenu(), CNtObjectFolderExtractIcon::~CNtObjectFolderExtractIcon(), CRecycleBinItemContextMenu::~CRecycleBinItemContextMenu(), CRegistryFolderExtractIcon::~CRegistryFolderExtractIcon(), CShellFolderViewCBWrapper::~CShellFolderViewCBWrapper(), CShellItem::~CShellItem(), CShellLink::~CShellLink(), CStartMenuBtnCtxMenu::~CStartMenuBtnCtxMenu(), CTravelEntry::~CTravelEntry(), and CViewStatePropertyBag::~CViewStatePropertyBag().

◆ ILGetDisplayName()

BOOL WINAPI ILGetDisplayName ( LPCITEMIDLIST  pidl,
LPVOID  path 
)

Definition at line 183 of file pidl.c.

184{
185 TRACE_(shell)("%p %p\n", pidl, path);
186
187 if (SHELL_OsIsUnicode())
190}
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
Definition: pidl.c:83
#define ILGDN_FORPARSING
Definition: undocshell.h:71

Referenced by SHOpenFolderWindow().

◆ ILGetDisplayNameEx()

BOOL WINAPI ILGetDisplayNameEx ( LPSHELLFOLDER  psf,
LPCITEMIDLIST  pidl,
LPVOID  path,
DWORD  type 
)

Definition at line 171 of file pidl.c.

172{
173 TRACE_(shell)("%p %p %p %d\n", psf, pidl, path, type);
174
175 if (SHELL_OsIsUnicode())
176 return ILGetDisplayNameExW(psf, pidl, path, type);
177 return ILGetDisplayNameExA(psf, pidl, path, type);
178}

Referenced by CBandSiteMenu::_AddISFBandToMenu(), CISFBand::GetBandInfo(), and CTravelEntry::GetToolTipText().

◆ ILGetDisplayNameExA()

static BOOL ILGetDisplayNameExA ( LPSHELLFOLDER  psf,
LPCITEMIDLIST  pidl,
LPSTR  path,
DWORD  type 
)
static

Definition at line 83 of file pidl.c.

84{
85 BOOL ret = FALSE;
86 WCHAR wPath[MAX_PATH];
87
88 TRACE("%p %p %p %d\n", psf, pidl, path, type);
89
90 if (!pidl || !path)
91 return FALSE;
92
93 ret = ILGetDisplayNameExW(psf, pidl, wPath, type);
95 TRACE("%p %p %s\n", psf, pidl, debugstr_a(path));
96
97 return ret;
98}

Referenced by ILGetDisplayName(), and ILGetDisplayNameEx().

◆ ILGetDisplayNameExW()

BOOL ILGetDisplayNameExW ( LPSHELLFOLDER  psf,
LPCITEMIDLIST  pidl,
LPWSTR  path,
DWORD  type 
)

Definition at line 100 of file pidl.c.

101{
102 LPSHELLFOLDER psfParent, lsf = psf;
104 LPCITEMIDLIST pidllast;
105 STRRET strret;
106 DWORD flag;
107
108 TRACE("%p %p %p %x\n", psf, pidl, path, type);
109
110 if (!pidl || !path)
111 return FALSE;
112
113 if (!lsf)
114 {
115 ret = SHGetDesktopFolder(&lsf);
116 if (FAILED(ret))
117 return FALSE;
118 }
119
120 switch (type)
121 {
122 case ILGDN_FORPARSING:
123 flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
124 break;
125 case ILGDN_NORMAL:
126 flag = SHGDN_NORMAL;
127 break;
128 case ILGDN_INFOLDER:
129 flag = SHGDN_INFOLDER;
130 break;
131 default:
132 FIXME("Unknown type parameter = %x\n", type);
133 flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
134 break;
135 }
136
137 if (!*(const WORD*)pidl || type == ILGDN_FORPARSING)
138 {
139 ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
140 if (SUCCEEDED(ret))
141 {
142 if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
143 ret = E_FAIL;
144 }
145 }
146 else
147 {
148 ret = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidllast);
149 if (SUCCEEDED(ret))
150 {
151 ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
152 if (SUCCEEDED(ret))
153 {
154 if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
155 ret = E_FAIL;
156 }
157 IShellFolder_Release(psfParent);
158 }
159 }
160
161 TRACE("%p %p %s\n", psf, pidl, debugstr_w(path));
162
163 if (!psf)
164 IShellFolder_Release(lsf);
165 return SUCCEEDED(ret);
166}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
#define IShellFolder_GetDisplayNameOf
Definition: utils.cpp:13
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1460
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:72
#define ILGDN_INFOLDER
Definition: undocshell.h:73

Referenced by CFSExtractIcon_CreateInstance(), FM_InitMenuPopup(), CFolder::get_Title(), getIconLocationForDrive(), getIconLocationForFolder(), ILGetDisplayName(), ILGetDisplayNameEx(), ILGetDisplayNameExA(), and IShellLink_ConstructFromFile().

◆ ILGetNext()

◆ ILGetSize()

UINT WINAPI ILGetSize ( LPCITEMIDLIST  pidl)

Definition at line 932 of file pidl.c.

933{
934 LPCSHITEMID si;
935 UINT len=0;
936
937 if (pidl)
938 {
939 si = &(pidl->mkid);
940
941 while (si->cb)
942 {
943 len += si->cb;
944 si = (LPCSHITEMID)(((const BYTE*)si)+si->cb);
945 }
946 len += 2;
947 }
948 TRACE("pidl=%p size=%u\n",pidl, len);
949 return len;
950}
const SHITEMID * LPCSHITEMID
Definition: shtypes.idl:30
WORD cb
Definition: shtypes.idl:27

◆ ILGlobalClone()

LPITEMIDLIST WINAPI ILGlobalClone ( LPCITEMIDLIST  pidl)

Definition at line 469 of file pidl.c.

470{
471 DWORD len;
472 LPITEMIDLIST newpidl;
473
474 if (!pidl)
475 return NULL;
476
477 len = ILGetSize(pidl);
478 newpidl = Alloc(len);
479 if (newpidl)
480 memcpy(newpidl,pidl,len);
481
482 TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
483 pdump(pidl);
484
485 return newpidl;
486}
LPVOID WINAPI Alloc(INT)

◆ ILGlobalFree()

void WINAPI ILGlobalFree ( LPITEMIDLIST  pidl)

Definition at line 1062 of file pidl.c.

1063{
1064 TRACE("%p\n", pidl);
1065
1066 Free(pidl);
1067}
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

◆ ILIsEqual()

BOOL WINAPI ILIsEqual ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 580 of file pidl.c.

581{
582 LPCITEMIDLIST pidltemp1 = pidl1;
583 LPCITEMIDLIST pidltemp2 = pidl2;
584
585 TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
586
587#ifdef __REACTOS__
588 IShellFolder *psfDesktop;
589 UINT depth1;
590
591 if (pidl1 == pidl2 || _ILMemCmpEqualIDList(pidltemp1, pidltemp2))
592 return TRUE;
593
594 depth1 = _ILGetDepth(pidl1);
595 if (depth1 && depth1 == _ILGetDepth(pidl2) && SUCCEEDED(SHGetDesktopFolder(&psfDesktop)))
596 {
597 HRESULT hr = IShellFolder_CompareIDs(psfDesktop, SHCIDS_CANONICALONLY, pidl1, pidl2);
598 IShellFolder_Release(psfDesktop);
599 return hr == 0;
600 }
601#else /* __REACTOS__ */
602 /*
603 * Explorer reads from registry directly (StreamMRU),
604 * so we can only check here
605 */
606 if (!pcheck(pidl1) || !pcheck (pidl2))
607#ifdef __REACTOS__
608 {
609 /* We don't understand the PIDL content but that does not mean it's invalid */
610 }
611#else
612 return FALSE;
613#endif
614
615 pdump (pidl1);
616 pdump (pidl2);
617
618 if (!pidl1 || !pidl2)
619 return FALSE;
620
621 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
622 {
623 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
624 return FALSE;
625
626 pidltemp1 = ILGetNext(pidltemp1);
627 pidltemp2 = ILGetNext(pidltemp2);
628 }
629
630 if (!pidltemp1->mkid.cb && !pidltemp2->mkid.cb)
631 return TRUE;
632#endif /* __REACTOS__ */
633 return FALSE;
634}
#define SHCIDS_CANONICALONLY
Definition: precomp.h:50
#define IShellFolder_CompareIDs
Definition: utils.cpp:15
UINT _ILGetDepth(LPCITEMIDLIST pidl)

Referenced by _ILIsParentEx(), CViewStatePropertyBag::_IsSamePidl(), BrFolder_ExpandToPidl(), BrFolder_IsTreeItemInEnum(), BrFolder_TreeItemHasThisChild(), BrowseCallbackProc(), DoGetAliasPIDLs(), FILEDLG95_LOOKIN_Init(), FILEDLG95_LOOKIN_SearchItem(), FILEDLG95_OnOpen(), CAddressEditBox::FillOneLevel(), ILIsParentOrSpecialParent(), init_function_pointers(), IShellBrowserImpl_BrowseObject(), CDefView::LV_FindItemByPidl(), CAddressEditBox::PopulateComboBox(), CChangeNotifyServer::ShouldNotify(), START_TEST(), test_FolderShortcut(), test_printers_folder(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), test_ShellItemBindToHandler(), test_SHGetIDListFromObject(), test_SHParseDisplayName(), and TestCommandLine().

◆ ILIsParent()

BOOL WINAPI ILIsParent ( LPCITEMIDLIST  pidlParent,
LPCITEMIDLIST  pidlChild,
BOOL  bImmediate 
)

Definition at line 695 of file pidl.c.

696{
697 LPCITEMIDLIST pParent = pidlParent;
698 LPCITEMIDLIST pChild = pidlChild;
699
700 TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate);
701
702#ifdef __REACTOS__
703 return _ILIsParentEx(pParent, pChild, bImmediate) != NULL;
704#else /* __REACTOS__ */
705 if (!pParent || !pChild)
706 return FALSE;
707
708 while (pParent->mkid.cb && pChild->mkid.cb)
709 {
710 if (!_ILHACKCompareSimpleIds(pParent, pChild))
711 return FALSE;
712
714 pChild = ILGetNext(pChild);
715 }
716
717 /* child has shorter name than parent */
718 if (pParent->mkid.cb)
719 return FALSE;
720
721 /* not immediate descent */
722 if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
723 return FALSE;
724
725 return TRUE;
726#endif /* __REACTOS__ */
727}
FxObject * pParent
Definition: fxdpcapi.cpp:86

Referenced by ILIsParentOrSpecialParent(), init_function_pointers(), CChangeNotifyServer::ShouldNotify(), and START_TEST().

◆ ILLoadFromStream()

HRESULT WINAPI ILLoadFromStream ( IStream pStream,
LPITEMIDLIST ppPidl 
)

Definition at line 293 of file pidl.c.

294{
295 WORD wLen = 0;
296 DWORD dwBytesRead;
298
299
300 TRACE_(shell)("%p %p\n", pStream , ppPidl);
301
302 SHFree(*ppPidl);
303 *ppPidl = NULL;
304
305 IStream_AddRef (pStream);
306
307 if (SUCCEEDED(IStream_Read(pStream, &wLen, 2, &dwBytesRead)))
308 {
309 TRACE("PIDL length is %d\n", wLen);
310 if (wLen != 0)
311 {
312 *ppPidl = SHAlloc (wLen);
313 if (SUCCEEDED(IStream_Read(pStream, *ppPidl , wLen, &dwBytesRead)))
314 {
315 TRACE("Stream read OK\n");
316 ret = S_OK;
317 }
318 else
319 {
320 WARN("reading pidl failed\n");
321 SHFree(*ppPidl);
322 *ppPidl = NULL;
323 }
324 }
325 else
326 {
327 *ppPidl = NULL;
328 ret = S_OK;
329 }
330 }
331
332 /* we are not yet fully compatible */
333 if (*ppPidl && !pcheck(*ppPidl))
334 {
335 WARN("Check failed\n");
336 SHFree(*ppPidl);
337 *ppPidl = NULL;
338 }
339
340 IStream_Release (pStream);
341 TRACE("done\n");
342 return ret;
343}

Referenced by CShellLink::Load().

◆ ILRemoveLastID()

◆ ILSaveToStream()

HRESULT WINAPI ILSaveToStream ( IStream pStream,
LPCITEMIDLIST  pPidl 
)

Definition at line 351 of file pidl.c.

352{
353 WORD wLen = 0;
355
356 TRACE_(shell)("%p %p\n", pStream, pPidl);
357
358 IStream_AddRef (pStream);
359
360 wLen = ILGetSize(pPidl);
361
362 if (SUCCEEDED(IStream_Write(pStream, &wLen, 2, NULL)))
363 {
364 if (SUCCEEDED(IStream_Write(pStream, pPidl, wLen, NULL)))
365 ret = S_OK;
366 }
367 IStream_Release (pStream);
368
369 return ret;
370}

Referenced by init_function_pointers(), and CShellLink::Save().

◆ SHBindToParent()

HRESULT WINAPI SHBindToParent ( LPCITEMIDLIST  pidl,
REFIID  riid,
LPVOID ppv,
LPCITEMIDLIST ppidlLast 
)

Definition at line 1460 of file pidl.c.

1461{
1462 IShellFolder * psfDesktop;
1464
1465 TRACE_(shell)("pidl=%p\n", pidl);
1466 pdump(pidl);
1467
1468 if (!pidl || !ppv)
1469 return E_INVALIDARG;
1470
1471 *ppv = NULL;
1472 if (ppidlLast)
1473 *ppidlLast = NULL;
1474
1475 hr = SHGetDesktopFolder(&psfDesktop);
1476 if (FAILED(hr))
1477 return hr;
1478
1479 if (_ILIsPidlSimple(pidl))
1480 {
1481 /* we are on desktop level */
1482 hr = IShellFolder_QueryInterface(psfDesktop, riid, ppv);
1483 }
1484 else
1485 {
1486 LPITEMIDLIST pidlParent = ILClone(pidl);
1487 ILRemoveLastID(pidlParent);
1488 hr = IShellFolder_BindToObject(psfDesktop, pidlParent, NULL, riid, ppv);
1489 SHFree (pidlParent);
1490 }
1491
1492 IShellFolder_Release(psfDesktop);
1493
1494 if (SUCCEEDED(hr) && ppidlLast)
1495 *ppidlLast = ILFindLastID(pidl);
1496
1497 TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08x\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
1498 return hr;
1499}
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:221
BOOL _ILIsPidlSimple(LPCITEMIDLIST pidl)
Definition: pidl.c:2155

Referenced by CViewStatePropertyBag::_IsSystemFolder(), CAddressEditBox::AddComboBoxItem(), CShellBrowser::BrowseToPath(), CreateIDataObject(), Entry::do_context_menu(), CShellLink::DragEnter(), CAddressEditBox::Execute(), CFolderItem::get_Name(), CFSFolder::GetAttributesOf(), CSendToMenu::GetUIObjectFromPidl(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), GetUIObjectOfAbsolute(), GetUIObjectOfAbsPidl(), ILGetDisplayNameExW(), CFolderItemVerbs::Init(), Initialize(), InitializeShellFolder_(), CShellMenuCallback::OnGetContextMenu(), r_verify_pidl(), CAddressEditBox::RefreshAddress(), RSHELL_CStartMenu_CreateInstance(), SHELL_execute(), SHELL_InvokePidl(), SHELL_PidlGetIconLocationW(), shellex_get_contextmenu(), shellex_get_dataobj(), SHGetAttributes(), SHGetFileInfoW(), SHGetNameAndFlagsW(), SHGetNameFromIDList(), SHGetPathCchFromIDListW(), SHIsRemovableDrive(), START_TEST(), test_AttributesRegistration(), test_GetDisplayName(), test_GetUIObject(), and test_SHCreateDefaultContextMenu().

◆ SHCloneSpecialIDList()

LPITEMIDLIST WINAPI SHCloneSpecialIDList ( HWND  hwndOwner,
int  nFolder,
BOOL  fCreate 
)

Definition at line 443 of file pidl.c.

444{
445 LPITEMIDLIST ppidl;
446 TRACE_(shell)("(hwnd=%p,csidl=0x%x,%s).\n", hwndOwner, nFolder, fCreate ? "T" : "F");
447
448 if (fCreate)
450
451 SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
452 return ppidl;
453}
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3257
#define CSIDL_FLAG_CREATE

Referenced by BrFolder_OnInitDialog(), CShellLink::Load(), CStartMenuBtnCtxMenu::QueryContextMenu(), START_TEST(), and test_sei_lpIDList().

◆ SHELL32_CreateSimpleIDListFromPath()

LPITEMIDLIST SHELL32_CreateSimpleIDListFromPath ( LPCWSTR  pszPath,
DWORD  dwAttributes 
)

Definition at line 1186 of file pidl.c.

1187{
1189 LPITEMIDLIST pidl = NULL;
1190 _ILParsePathW(pszPath, &data, TRUE, &pidl, NULL);
1191 return pidl;
1192}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
Definition: pidl.c:1147
DWORD dwAttributes
Definition: vdmdbg.h:34

Referenced by SHGetFileInfoW().

◆ SHGetDataFromIDListA()

HRESULT WINAPI SHGetDataFromIDListA ( LPSHELLFOLDER  psf,
LPCITEMIDLIST  pidl,
int  nFormat,
LPVOID  dest,
int  len 
)

Definition at line 1262 of file pidl.c.

1264{
1265 LPSTR filename, shortname;
1267
1268 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1269
1270 pdump(pidl);
1271 if (!psf || !dest)
1272 return E_INVALIDARG;
1273
1274 switch (nFormat)
1275 {
1276 case SHGDFIL_FINDDATA:
1277 pfd = dest;
1278
1279 if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
1280 return E_INVALIDARG;
1281
1282 if (len < sizeof(WIN32_FIND_DATAA))
1283 return E_INVALIDARG;
1284
1285 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
1286 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1287 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1288 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1289
1291 shortname = _ILGetSTextPointer(pidl);
1292
1293 if (filename)
1294 lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
1295 else
1296 pfd->cFileName[0] = '\0';
1297
1298 if (shortname)
1299 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
1300 else
1301 pfd->cAlternateFileName[0] = '\0';
1302 return S_OK;
1303
1306 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1307 break;
1308
1309 default:
1310 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1311 }
1312
1313 return E_INVALIDARG;
1314}
#define FIXME_(x)
Definition: compat.h:77
#define lstrcpynA
Definition: compat.h:751
const char * filename
Definition: ioapi.h:137
static char * dest
Definition: rtl.c:135
static LPSTR _ILGetSTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2374
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2611
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2102
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2543
#define ERR_(ch,...)
Definition: debug.h:156
#define SHGDFIL_FINDDATA
Definition: shlobj.h:1452
#define SHGDFIL_NETRESOURCE
Definition: shlobj.h:1453
#define SHGDFIL_DESCRIPTIONID
Definition: shlobj.h:1454
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67

◆ SHGetDataFromIDListW()

HRESULT WINAPI SHGetDataFromIDListW ( LPSHELLFOLDER  psf,
LPCITEMIDLIST  pidl,
int  nFormat,
LPVOID  dest,
int  len 
)

Definition at line 1320 of file pidl.c.

1322{
1323 LPSTR filename, shortname;
1325
1326 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1327
1328 pdump(pidl);
1329
1330 if (!psf || !dest)
1331 return E_INVALIDARG;
1332
1333 switch (nFormat)
1334 {
1335 case SHGDFIL_FINDDATA:
1336 pfd = dest;
1337
1338 if (_ILIsDrive(pidl))
1339 return E_INVALIDARG;
1340
1341 if (len < sizeof(WIN32_FIND_DATAW))
1342 return E_INVALIDARG;
1343
1344 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
1345 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1346 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1347 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1348
1350 shortname = _ILGetSTextPointer(pidl);
1351
1352 if (!filename)
1353 pfd->cFileName[0] = '\0';
1354 else if (!MultiByteToWideChar(CP_ACP, 0, filename, -1, pfd->cFileName, MAX_PATH))
1355 pfd->cFileName[MAX_PATH-1] = 0;
1356
1357 if (!shortname)
1358 pfd->cAlternateFileName[0] = '\0';
1359 else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1, pfd->cAlternateFileName, 14))
1360 pfd->cAlternateFileName[13] = 0;
1361 return S_OK;
1362
1365 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1366 break;
1367
1368 default:
1369 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1370 }
1371
1372 return E_INVALIDARG;
1373}

Referenced by CViewStatePropertyBag::_IsSystemFolder().

◆ SHGetIDListFromObject()

HRESULT WINAPI SHGetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 1629 of file pidl.c.

1630{
1631 IPersistIDList *ppersidl;
1632 IPersistFolder2 *ppf2;
1633 IDataObject *pdo;
1634 IFolderView *pfv;
1635 HRESULT ret;
1636
1637 if(!punk)
1638 return E_NOINTERFACE;
1639
1640 *ppidl = NULL;
1641
1642 /* Try IPersistIDList */
1643 ret = IUnknown_QueryInterface(punk, &IID_IPersistIDList, (void**)&ppersidl);
1644 if(SUCCEEDED(ret))
1645 {
1646 TRACE("IPersistIDList (%p)\n", ppersidl);
1647 ret = IPersistIDList_GetIDList(ppersidl, ppidl);
1648 IPersistIDList_Release(ppersidl);
1649 if(SUCCEEDED(ret))
1650 return ret;
1651 }
1652
1653 /* Try IPersistFolder2 */
1654 ret = IUnknown_QueryInterface(punk, &IID_IPersistFolder2, (void**)&ppf2);
1655 if(SUCCEEDED(ret))
1656 {
1657 TRACE("IPersistFolder2 (%p)\n", ppf2);
1658 ret = IPersistFolder2_GetCurFolder(ppf2, ppidl);
1659 IPersistFolder2_Release(ppf2);
1660 if(SUCCEEDED(ret))
1661 return ret;
1662 }
1663
1664 /* Try IDataObject */
1665 ret = IUnknown_QueryInterface(punk, &IID_IDataObject, (void**)&pdo);
1666 if(SUCCEEDED(ret))
1667 {
1668 IShellItem *psi;
1669 TRACE("IDataObject (%p)\n", pdo);
1671 &IID_IShellItem, (void**)&psi);
1672 if(SUCCEEDED(ret))
1673 {
1674 ret = SHGetIDListFromObject((IUnknown*)psi, ppidl);
1675 IShellItem_Release(psi);
1676 }
1677 IDataObject_Release(pdo);
1678
1679 if(SUCCEEDED(ret))
1680 return ret;
1681 }
1682
1683 /* Try IFolderView */
1684 ret = IUnknown_QueryInterface(punk, &IID_IFolderView, (void**)&pfv);
1685 if(SUCCEEDED(ret))
1686 {
1687 IShellFolder *psf;
1688 TRACE("IFolderView (%p)\n", pfv);
1689 ret = IFolderView_GetFolder(pfv, &IID_IShellFolder, (void**)&psf);
1690 if(SUCCEEDED(ret))
1691 {
1692 /* We might be able to get IPersistFolder2 from a shellfolder. */
1693 ret = SHGetIDListFromObject((IUnknown*)psf, ppidl);
1694 }
1695 IFolderView_Release(pfv);
1696 return ret;
1697 }
1698
1699 return ret;
1700}
const GUID IID_IDataObject
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1629
HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv)
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by ICommDlgBrowser3_fnIncludeObject(), init_function_pointers(), on_default_action(), SHELL_GetIDListFromObject(), and SHGetIDListFromObject().

◆ SHGetNameFromIDList()

HRESULT WINAPI SHGetNameFromIDList ( PCIDLIST_ABSOLUTE  pidl,
SIGDN  sigdnName,
PWSTR ppszName 
)

Definition at line 1566 of file pidl.c.

1567{
1568 IShellFolder *psfparent;
1569 LPCITEMIDLIST child_pidl;
1570 STRRET disp_name;
1571 HRESULT ret;
1572
1573 TRACE("%p 0x%08x %p\n", pidl, sigdnName, ppszName);
1574
1575 *ppszName = NULL;
1576 ret = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psfparent, &child_pidl);
1577 if(SUCCEEDED(ret))
1578 {
1579 switch(sigdnName)
1580 {
1581 /* sigdnName & 0xffff */
1582 case SIGDN_NORMALDISPLAY: /* SHGDN_NORMAL */
1583 case SIGDN_PARENTRELATIVEPARSING: /* SHGDN_INFOLDER | SHGDN_FORPARSING */
1584 case SIGDN_PARENTRELATIVEEDITING: /* SHGDN_INFOLDER | SHGDN_FOREDITING */
1585 case SIGDN_DESKTOPABSOLUTEPARSING: /* SHGDN_FORPARSING */
1586 case SIGDN_DESKTOPABSOLUTEEDITING: /* SHGDN_FOREDITING | SHGDN_FORADDRESSBAR*/
1587 case SIGDN_PARENTRELATIVEFORADDRESSBAR: /* SIGDN_INFOLDER | SHGDN_FORADDRESSBAR */
1588 case SIGDN_PARENTRELATIVE: /* SIGDN_INFOLDER */
1589
1590 disp_name.uType = STRRET_WSTR;
1591 ret = IShellFolder_GetDisplayNameOf(psfparent, child_pidl,
1592 sigdnName & 0xffff,
1593 &disp_name);
1594 if(SUCCEEDED(ret))
1595 ret = StrRetToStrW(&disp_name, pidl, ppszName);
1596
1597 break;
1598
1599 case SIGDN_FILESYSPATH:
1601 if(SHGetPathFromIDListW(pidl, *ppszName))
1602 {
1603 TRACE("Got string %s\n", debugstr_w(*ppszName));
1604 ret = S_OK;
1605 }
1606 else
1607 {
1609 ret = E_INVALIDARG;
1610 }
1611 break;
1612
1613 case SIGDN_URL:
1614 default:
1615 FIXME("Unsupported SIGDN %x\n", sigdnName);
1616 ret = E_FAIL;
1617 }
1618
1619 IShellFolder_Release(psfparent);
1620 }
1621 return ret;
1622}
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
Definition: string.c:1631
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1452
SIGDN PWSTR * ppszName
Definition: shobjidl.idl:606
SIGDN sigdnName
Definition: shobjidl.idl:606
@ STRRET_WSTR
Definition: shtypes.idl:85
UINT uType
Definition: shtypes.idl:93

Referenced by CFSDropTarget::_DoDrop(), CShellItem::GetDisplayName(), GetParsingName(), init_function_pointers(), and SHELL_CreatePropSheetStubWindow().

◆ SHGetPathCchFromIDListW()

HRESULT WINAPI SHGetPathCchFromIDListW ( _In_ LPCITEMIDLIST  pidl,
_Out_writes_(cchPathMax) LPWSTR  pszPath,
_In_ SIZE_T  cchPathMax 
)

Definition at line 1407 of file pidl.c.

1411{
1412 HRESULT hr;
1413 LPCITEMIDLIST pidlLast;
1414 LPSHELLFOLDER psfFolder;
1416 STRRET strret;
1417
1418 TRACE_(shell)("(pidl=%p,%p)\n", pidl, pszPath);
1419 pdump(pidl);
1420
1421 *pszPath = UNICODE_NULL;
1422 if (!pidl)
1423 return E_FAIL;
1424
1425 hr = SHBindToParent(pidl, &IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
1426 if (FAILED(hr))
1427 {
1428 ERR("SHBindToParent failed: %x\n", hr);
1429 return hr;
1430 }
1431
1432 dwAttributes = SFGAO_FILESYSTEM;
1433 hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes);
1434 if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM))
1435 {
1436 WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr);
1437 IShellFolder_Release(psfFolder);
1438 return E_FAIL;
1439 }
1440
1441 hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
1442 IShellFolder_Release(psfFolder);
1443 if (FAILED(hr))
1444 return hr;
1445
1446 hr = StrRetToBufW(&strret, pidlLast, pszPath, cchPathMax);
1447
1448 TRACE_(shell)("-- %s, 0x%08x\n",debugstr_w(pszPath), hr);
1449 return hr;
1450}
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530

Referenced by SHGetPathFromIDListW().

◆ SHGetPathFromIDListA()

BOOL WINAPI SHGetPathFromIDListA ( LPCITEMIDLIST  pidl,
LPSTR  pszPath 
)

Definition at line 1390 of file pidl.c.

1391{
1392 WCHAR wszPath[MAX_PATH];
1393 BOOL bSuccess;
1394
1395 bSuccess = SHGetPathFromIDListW(pidl, wszPath);
1396 WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL);
1397
1398 return bSuccess;
1399}
static BOOLEAN bSuccess
Definition: drive.cpp:355

Referenced by CStartMenuBtnCtxMenu::InvokeCommand(), RenderFILENAMEA(), SHAddToRecentDocs(), test_click_make_new_folder_button(), and test_get_set().

◆ SHGetPathFromIDListW()

BOOL WINAPI SHGetPathFromIDListW ( LPCITEMIDLIST  pidl,
LPWSTR  pszPath 
)

Definition at line 1452 of file pidl.c.

1453{
1454 return SUCCEEDED(SHGetPathCchFromIDListW(pidl, pszPath, MAX_PATH));
1455}
HRESULT WINAPI SHGetPathCchFromIDListW(_In_ LPCITEMIDLIST pidl, _Out_writes_(cchPathMax) LPWSTR pszPath, _In_ SIZE_T cchPathMax)
Definition: pidl.c:1407

Referenced by BtrfsSend::AddClone(), BrFolder_Delete(), BrFolder_NewFolder(), BrowseCallbackProc(), BtrfsSend::BrowseParent(), ChooseFolder(), CHSourceDlgProc(), CreateDirectoryWatcherFromRegEntry(), CNewMenu::CreateNewFolder(), CNewMenu::CreateNewItem(), CCopyMoveToMenu::DoAction(), CDefaultContextMenu::DoCreateNewFolder(), DoInitAliasPIDLs(), CCopyMoveToMenu::DoRealFileOp(), DoTestEntry(), DoUpdateAutoCompleteWithCWD(), CFontExt::Drop(), CMyDocsDropHandler::Drop(), CDeskLinkDropHandler::Drop(), CAddressEditBox::ExecuteCommandLine(), CACListISF::Expand(), FileExtractDialogWndProc(), CSearchBar::GetAddressEditBoxPath(), CFSFolder::GetCustomViewInfo(), GetIconOverlay(), CShellLink::GetPath(), CFontExt::Initialize(), CZipFolder::Initialize(), CFSFolder::Initialize(), BtrfsContextMenu::Initialize(), COpenWithMenu::Initialize(), CFSFolder::InitializeEx(), CDefaultContextMenu::InvokePidl(), IsPidlPrograms(), LoadRdpSettingsFromFile(), CShellBrowser::OnAddToFavorites(), CZipExtract::CExtractSettingsPage::OnBrowse(), CDefView::OnNotify(), RenderFILENAMEW(), RenderHDROP(), CShellLink::Resolve(), SaveRdpSettingsToFile(), CShellLink::SetTargetFromPIDLOrPath(), SHAddToRecentDocs(), SHELL_execute(), SHGetFileInfoW(), SHGetNameFromIDList(), SHGetPathFromIDListA(), SHGetPathFromIDListWrapW(), test_EnumObjects(), test_GetDisplayName(), test_ParseDisplayName(), test_SHGetNameFromIDList(), test_SHGetPathFromIDList(), TestCommandLine(), TestHIDA(), WelcomeDlgProc(), and WshCollection_Item().

◆ SHGetRealIDL()

HRESULT WINAPI SHGetRealIDL ( LPSHELLFOLDER  lpsf,
LPCITEMIDLIST  pidlSimple,
LPITEMIDLIST pidlReal 
)

Definition at line 858 of file pidl.c.

859{
860 IDataObject* pDataObj;
861 HRESULT hr;
862
863 hr = IShellFolder_GetUIObjectOf(lpsf, 0, 1, &pidlSimple,
864 &IID_IDataObject, 0, (LPVOID*)&pDataObj);
865 if (SUCCEEDED(hr))
866 {
867 STGMEDIUM medium;
868 FORMATETC fmt;
869
871 fmt.ptd = NULL;
872 fmt.dwAspect = DVASPECT_CONTENT;
873 fmt.lindex = -1;
874 fmt.tymed = TYMED_HGLOBAL;
875
876 hr = IDataObject_GetData(pDataObj, &fmt, &medium);
877
878 IDataObject_Release(pDataObj);
879
880 if (SUCCEEDED(hr))
881 {
882 /*assert(pida->cidl==1);*/
883 LPIDA pida = GlobalLock(medium.u.hGlobal);
884
885 LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
886 LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
887
888 *pidlReal = ILCombine(pidl_folder, pidl_child);
889
890 if (!*pidlReal)
892
893 GlobalUnlock(medium.u.hGlobal);
894 GlobalFree(medium.u.hGlobal);
895 }
896 }
897
898 return hr;
899}
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
static const WCHAR CFSTR_SHELLIDLISTW[]
Definition: shlobj.h:506
Definition: shlobj.h:572
UINT aoffset[1]
Definition: shlobj.h:573
Definition: dsound.c:943
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)

◆ SHILCreateFromPathA()

HRESULT WINAPI SHILCreateFromPathA ( LPCSTR  path,
LPITEMIDLIST ppidl,
DWORD attributes 
)

Definition at line 389 of file pidl.c.

390{
391 WCHAR lpszDisplayName[MAX_PATH];
392
393 TRACE_(shell)("%s %p 0x%08x\n", path, ppidl, attributes ? *attributes : 0);
394
395 if (!MultiByteToWideChar(CP_ACP, 0, path, -1, lpszDisplayName, MAX_PATH))
396 lpszDisplayName[MAX_PATH-1] = 0;
397
398 return SHILCreateFromPathW(lpszDisplayName, ppidl, attributes);
399}

Referenced by ILCreateFromPathA(), and SHILCreateFromPathAW().

◆ SHILCreateFromPathAW()

HRESULT WINAPI SHILCreateFromPathAW ( LPCVOID  path,
LPITEMIDLIST ppidl,
DWORD attributes 
)

Definition at line 417 of file pidl.c.

418{
419 if ( SHELL_OsIsUnicode())
420 return SHILCreateFromPathW (path, ppidl, attributes);
421 return SHILCreateFromPathA (path, ppidl, attributes);
422}

◆ SHILCreateFromPathW()

HRESULT WINAPI SHILCreateFromPathW ( LPCWSTR  path,
LPITEMIDLIST ppidl,
DWORD attributes 
)

Definition at line 401 of file pidl.c.

402{
403 LPSHELLFOLDER sf;
404 DWORD pchEaten;
406
407 TRACE_(shell)("%s %p 0x%08x\n", debugstr_w(path), ppidl, attributes ? *attributes : 0);
408
409 if (SUCCEEDED (SHGetDesktopFolder(&sf)))
410 {
411 ret = IShellFolder_ParseDisplayName(sf, 0, NULL, (LPWSTR)path, &pchEaten, ppidl, attributes);
412 IShellFolder_Release(sf);
413 }
414 return ret;
415}

Referenced by CDefaultContextMenu::DoCreateNewFolder(), ILCreateFromPathW(), CNewMenu::SelectNewItem(), CShellLink::SetTargetFromPIDLOrPath(), SHGetFileInfoW(), SHGetFolderLocation(), SHILCreateFromPathA(), SHILCreateFromPathAW(), and VariantToIdlist().

◆ SHLogILFromFSIL()

LPITEMIDLIST WINAPI SHLogILFromFSIL ( LPITEMIDLIST  pidl)

Definition at line 909 of file pidl.c.

910{
911 FIXME("(pidl=%p)\n",pidl);
912
913 pdump(pidl);
914
915 return 0;
916}

◆ SHParseDisplayName()

HRESULT WINAPI SHParseDisplayName ( LPCWSTR  pszName,
IBindCtx pbc,
LPITEMIDLIST ppidl,
SFGAOF  sfgaoIn,
SFGAOF psfgaoOut 
)

Definition at line 1504 of file pidl.c.

1506{
1507 HRESULT hr;
1508 LPWSTR pszNameDup;
1509 IShellFolder *psfDesktop;
1510 IBindCtx *pBindCtx = NULL;
1511
1512 TRACE("(%s, %p, %p, 0x%X, %p)\n", pszName, pbc, ppidl, sfgaoIn, psfgaoOut);
1513
1514 *ppidl = NULL;
1515
1516 if (psfgaoOut)
1517 *psfgaoOut = 0;
1518
1519 pszNameDup = StrDupW(pszName);
1520 if (!pszNameDup)
1521 return E_OUTOFMEMORY;
1522
1523 psfDesktop = NULL;
1524 hr = SHGetDesktopFolder(&psfDesktop);
1525 if (FAILED(hr))
1526 {
1527 LocalFree(pszNameDup);
1528 return hr;
1529 }
1530
1531 if (!pbc)
1532 {
1533 hr = BindCtx_RegisterObjectParam(NULL, STR_PARSE_TRANSLATE_ALIASES, NULL, &pBindCtx);
1534 pbc = pBindCtx;
1535 }
1536
1537 if (SUCCEEDED(hr))
1538 {
1539 ULONG sfgao = sfgaoIn, cchEaten;
1540 HWND hwndUI = BindCtx_GetUIWindow(pbc);
1541 hr = psfDesktop->lpVtbl->ParseDisplayName(psfDesktop,
1542 hwndUI,
1543 pbc,
1544 pszNameDup,
1545 &cchEaten,
1546 ppidl,
1547 (psfgaoOut ? &sfgao : NULL));
1548 if (SUCCEEDED(hr) && psfgaoOut)
1549 *psfgaoOut = (sfgao & sfgaoIn);
1550 }
1551
1552 LocalFree(pszNameDup);
1553
1554 if (psfDesktop)
1555 psfDesktop->lpVtbl->Release(psfDesktop);
1556
1557 if (pBindCtx)
1558 pBindCtx->lpVtbl->Release(pBindCtx);
1559
1560 return hr;
1561}
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
HRESULT ParseDisplayName([in] HWND hwndOwner, [in] LPBC pbcReserved, [in, string] LPOLESTR lpszDisplayName, [out] ULONG *pchEaten, [out] PIDLIST_RELATIVE *ppidl, [in, out, unique] ULONG *pdwAttributes)
EXTERN_C HRESULT BindCtx_RegisterObjectParam(_In_ IBindCtx *pBindCtx, _In_ LPOLESTR pszKey, _In_opt_ IUnknown *punk, _Out_ LPBC *ppbc)
Definition: utils.cpp:428
EXTERN_C HWND BindCtx_GetUIWindow(_In_ IBindCtx *pBindCtx)
Definition: utils.cpp:368
uint32_t ULONG
Definition: typedefs.h:59

Referenced by BtrfsSend::AddClone(), BrFolder_ExpandToString(), BtrfsSend::BrowseParent(), CreateIDataObject(), CreateShellItemFromParse(), CACListISF::Expand(), filedlg_collect_places_pidls(), CZipFolder::Initialize(), InitializeShellFolder_(), CSearchBar::OnSearchButtonClicked(), PathToIDList(), SHELL_execute(), shellex_get_contextmenu(), SHGFI(), START_TEST(), test_ACListISF_CURRENTDIR(), test_ACListISF_FILESYSDIRS(), test_ACListISF_FILESYSONLY(), test_ACListISF_MYCOMPUTER(), test_ACListISF_NONE(), test_MultipleFiles(), test_SHParseDisplayName(), and wmain().

◆ SHSimpleIDListFromPathA()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathA ( LPCSTR  lpszPath)

Definition at line 1214 of file pidl.c.

1215{
1216 LPITEMIDLIST pidl = NULL;
1217 LPWSTR wPath = NULL;
1218 int len;
1219
1220 TRACE("%s\n", debugstr_a(lpszPath));
1221
1222 if (lpszPath)
1223 {
1224 len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0);
1225 wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1226 MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len);
1227 }
1228
1229 _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
1230
1231 HeapFree(GetProcessHeap(), 0, wPath);
1232 TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
1233 return pidl;
1234}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by SHSimpleIDListFromPathAW().

◆ SHSimpleIDListFromPathAW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW ( LPCVOID  lpszPath)

Definition at line 1248 of file pidl.c.

1249{
1250 if ( SHELL_OsIsUnicode())
1251 return SHSimpleIDListFromPathW (lpszPath);
1252 return SHSimpleIDListFromPathA (lpszPath);
1253}
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
Definition: pidl.c:1214
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1236

◆ SHSimpleIDListFromPathW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathW ( LPCWSTR  lpszPath)

Definition at line 1236 of file pidl.c.

1237{
1238 LPITEMIDLIST pidl = NULL;
1239
1240 TRACE("%s\n", debugstr_w(lpszPath));
1241
1242 _ILParsePathW(lpszPath, NULL, TRUE, &pidl, NULL);
1243
1244 TRACE("%s %p\n", debugstr_w(lpszPath), pidl);
1245 return pidl;
1246}

Referenced by CShellLink::SetTargetFromPIDLOrPath(), SHChangeNotify(), and SHSimpleIDListFromPathAW().

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( shell  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( pidl  )