ReactOS 0.4.15-dev-8621-g4b051b9
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)
 
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 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)
 
void _ILGetFileType (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 1615 of file pidl.c.

1616{
1617 LPITEMIDLIST pidlOut = NULL;
1618
1619 pidlOut = SHAlloc(size + 5);
1620 if(pidlOut)
1621 {
1623 LPITEMIDLIST pidlNext;
1624
1625 ZeroMemory(pidlOut, size + 5);
1626 pidlOut->mkid.cb = size + 3;
1627
1628 pData = _ILGetDataPointer(pidlOut);
1629 if (pData)
1630 pData->type = type;
1631
1632 pidlNext = ILGetNext(pidlOut);
1633 if (pidlNext)
1634 pidlNext->mkid.cb = 0x00;
1635 TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
1636 }
1637
1638 return pidlOut;
1639}
#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:2160
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:872
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:1712

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

◆ _ILCopyaPidl()

PITEMID_CHILD * _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2617 of file pidl.c.

2618{
2619 UINT i;
2620 PITEMID_CHILD *apidldest;
2621
2622 if (!apidlsrc)
2623 return NULL;
2624
2625 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2626
2627 for (i = 0; i < cidl; i++)
2628 apidldest[i] = ILClone(apidlsrc[i]);
2629
2630 return apidldest;
2631}
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 2638 of file pidl.c.

2639{
2640 UINT i;
2642
2643 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2644 if (!dst)
2645 return NULL;
2646
2647 if (pidl)
2648 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2649
2650 for (i = 0; i < cida->cidl; i++)
2651 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2652
2653 return dst;
2654}
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 1728 of file pidl.c.

1729{
1730 TRACE("()\n");
1732}
const GUID CLSID_AdminFolderShortcut
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1734
#define PT_GUID
Definition: pidl.h:87

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1722 of file pidl.c.

1723{
1724 TRACE("()\n");
1725 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1726}

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1670 of file pidl.c.

1671{
1672 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1673
1674 TRACE("()\n");
1675 if (parent)
1676 {
1677 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1678
1679 if (cpl)
1680 {
1681 ret = ILCombine(parent, cpl);
1682 SHFree(cpl);
1683 }
1684 SHFree(parent);
1685 }
1686 return ret;
1687}
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:718
#define PT_SHELLEXT
Definition: pidl.h:91
int ret

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1641 of file pidl.c.

1642{
1644
1645 TRACE("()\n");
1646 ret = SHAlloc(2);
1647 if (ret)
1648 ret->mkid.cb = 0;
1649 return ret;
1650}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1855 of file pidl.c.

1856{
1857 LPITEMIDLIST pidlOut;
1858
1859 TRACE("(%s)\n",debugstr_w(lpszNew));
1860
1861 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1862 if (pidlOut)
1863 {
1864 LPSTR pszDest = _ILGetTextPointer(pidlOut);
1865 if (pszDest)
1866 {
1867 lstrcpyA(pszDest, "x:\\");
1868 pszDest[0] = toupper(lpszNew[0]);
1869 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1870 }
1871 }
1872 return pidlOut;
1873}
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:2227
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1615
#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 1875 of file pidl.c.

1876{
1877 LPITEMIDLIST pidlOut;
1878
1879 TRACE("\n");
1880
1881 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1882 if (pidlOut)
1883 {
1885
1886 pData->u.network.dummy = 0;
1887 strcpy(pData->u.network.szNames, "Entire Network");
1888 }
1889 return pidlOut;
1890}
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 1788 of file pidl.c.

1789{
1790 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1791 DWORD len, len1, wlen, alen;
1792 LPITEMIDLIST pidl;
1793 PIDLTYPE type;
1794
1795 if (!wfd)
1796 return NULL;
1797
1798 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1799
1800 /* prepare buffer with both names */
1801 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1802 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1803 alen = len + len1;
1804
1805 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1806
1807 wlen = lstrlenW(wfd->cFileName) + 1;
1808 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1809 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1810 if (pidl)
1811 {
1813 FileStruct *fs = &pData->u.file;
1814 FileStructW *fsw;
1815 WORD *pOffsetW;
1816
1817 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1818 fs->dwFileSize = wfd->nFileSizeLow;
1819 fs->uFileAttribs = wfd->dwFileAttributes;
1820 memcpy(fs->szNames, buff, alen);
1821
1822 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1823 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1824 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1825 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1826 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1827
1828 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1829 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1830 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1831 }
1832 return pidl;
1833
1834}
#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:120
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 1836 of file pidl.c.

1837{
1838 HANDLE hFile;
1839 WIN32_FIND_DATAW stffile;
1840
1841 if (!ppidl)
1842 return E_INVALIDARG;
1843
1844 hFile = FindFirstFileW(szPath, &stffile);
1847
1849
1850 *ppidl = _ILCreateFromFindDataW(&stffile);
1851
1852 return *ppidl ? S_OK : E_OUTOFMEMORY;
1853}
#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:1788
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1734 of file pidl.c.

1735{
1736 LPITEMIDLIST pidlOut;
1737
1738 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1739 {
1740 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1741 if (pidlOut)
1742 {
1744
1745 pData->u.guid.guid = *guid;
1746 TRACE("-- create GUID-pidl %s\n",
1747 debugstr_guid(&(pData->u.guid.guid)));
1748 }
1749 }
1750 else
1751 {
1752 WARN("%d: invalid type for GUID\n", type);
1753 pidlOut = NULL;
1754 }
1755 return pidlOut;
1756}
#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 1759 of file pidl.c.

1760{
1761 IID iid;
1762
1763 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1764 {
1765 ERR("%s is not a GUID\n", szGUID);
1766 return NULL;
1767 }
1768 return _ILCreateGuid(PT_GUID, &iid);
1769}
#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 1771 of file pidl.c.

1772{
1773 IID iid;
1774
1775#ifndef __REACTOS__
1776 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1777#else
1778 if (!GUIDFromStringW(szGUID, &iid))
1779#endif
1780 {
1781 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1782 return NULL;
1783 }
1784 return _ILCreateGuid(PT_GUID, &iid);
1785}
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 1664 of file pidl.c.

1665{
1666 TRACE("()\n");
1667 return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1668}

Referenced by SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1652 of file pidl.c.

1653{
1654 TRACE("()\n");
1655 return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
1656}

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1658 of file pidl.c.

1659{
1660 TRACE("()\n");
1661 return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1662}

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

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1716 of file pidl.c.

1717{
1718 TRACE("()\n");
1719 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1720}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1689 of file pidl.c.

1690{
1691#ifdef __REACTOS__
1692 // Note: Wine returns the PIDL as it was in Windows 95, NT5 moved it into CSIDL_CONTROLS
1693 extern HRESULT SHGetFolderLocationHelper(HWND hwnd, int nFolder, REFCLSID clsid, LPITEMIDLIST *ppidl);
1694 LPITEMIDLIST pidl;
1695 SHGetFolderLocationHelper(NULL, CSIDL_CONTROLS, &CLSID_Printers, &pidl);
1696 return pidl;
1697#else
1698 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1699
1700 TRACE("()\n");
1701 if (parent)
1702 {
1703 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1704
1705 if (printers)
1706 {
1707 ret = ILCombine(parent, printers);
1708 SHFree(printers);
1709 }
1710 SHFree(parent);
1711 }
1712 return ret;
1713#endif
1714}
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 2600 of file pidl.c.

2601{
2602 UINT i;
2603
2604 if (apidl)
2605 {
2606 for (i = 0; i < cidl; i++)
2607 SHFree(apidl[i]);
2608 SHFree(apidl);
2609 }
2610}

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 1900 of file pidl.c.

1901{
1902 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1903
1904 if(_ILIsMyComputer(pidl))
1905 pidl = ILGetNext(pidl);
1906
1907 if (pidl && _ILIsDrive(pidl))
1908 return _ILSimpleGetTextW(pidl, pOut, uSize);
1909
1910 return 0;
1911}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1976
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2009
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2080

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2460 of file pidl.c.

2461{
2462 WCHAR szTemp[MAX_PATH];
2463 LPCWSTR pPoint;
2464 LPCITEMIDLIST pidlTemp = pidl;
2465
2466 TRACE("pidl=%p\n",pidl);
2467
2468 if (!pidl)
2469 return FALSE;
2470
2471 pidlTemp = ILFindLastID(pidl);
2472
2473 if (!_ILIsValue(pidlTemp))
2474 return FALSE;
2475 if (!_ILSimpleGetTextW(pidlTemp, szTemp, _countof(szTemp)))
2476 return FALSE;
2477
2478 pPoint = PathFindExtensionW(szTemp);
2479
2480 if (!*pPoint)
2481 return FALSE;
2482
2483 pPoint++;
2484 lstrcpynW(pOut, pPoint, uOutSize);
2485 TRACE("%s\n", debugstr_w(pOut));
2486
2487 return TRUE;
2488}
#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:2030
#define _countof(array)
Definition: sndvol32.h:70
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by _ILGetFileType(), SHELL32_GetFSItemAttributes(), and SHELL_IsShortcut().

◆ _ILGetFileAttributes()

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

Definition at line 2560 of file pidl.c.

2561{
2563 WORD wAttrib = 0;
2564 int i;
2565
2566 if (!pData)
2567 return 0;
2568
2569 switch(pData->type)
2570 {
2571 case PT_FOLDER:
2572 case PT_VALUE:
2573 wAttrib = pData->u.file.uFileAttribs;
2574 break;
2575 }
2576
2577 if(uOutSize >= 6)
2578 {
2579 i=0;
2580 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2581 pOut[i++] = L'R';
2582 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2583 pOut[i++] = L'H';
2584 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2585 pOut[i++] = L'S';
2586 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2587 pOut[i++] = L'A';
2588 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2589 pOut[i++] = L'C';
2590 pOut[i] = UNICODE_NULL;
2591 }
2592 return wAttrib;
2593}
#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 2395 of file pidl.c.

2396{
2397 FILETIME ft,lft;
2399 BOOL ret;
2400
2401 if (_ILGetFileDateTime( pidl, &ft ))
2402 {
2403 FileTimeToLocalFileTime(&ft, &lft);
2404 FileTimeToSystemTime (&lft, &time);
2405
2407 if (ret)
2408 {
2409 /* Append space + time without seconds */
2410 pOut[ret - 1] = L' ';
2412 }
2413 }
2414 else
2415 {
2416 pOut[0] = UNICODE_NULL;
2417 ret = FALSE;
2418 }
2419 return ret;
2420}
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:2376
#define TIME_NOSECONDS
Definition: winnls.h:278
#define DATE_SHORTDATE
Definition: winnls.h:196

Referenced by CFSFolder::GetDetailsOf().

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME pFt 
)

Definition at line 2376 of file pidl.c.

2377{
2379
2380 if (!pdata)
2381 return FALSE;
2382
2383 switch (pdata->type)
2384 {
2385 case PT_FOLDER:
2386 case PT_VALUE:
2387 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2388 break;
2389 default:
2390 return FALSE;
2391 }
2392 return TRUE;
2393}
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 2439 of file pidl.c.

2440{
2442 DWORD dwSize;
2443
2444 if (!pdata)
2445 return 0;
2446
2447 switch (pdata->type)
2448 {
2449 case PT_VALUE:
2450 dwSize = pdata->u.file.dwFileSize;
2451 if (pOut)
2452 StrFormatKBSizeW(dwSize, pOut, uOutSize);
2453 return dwSize;
2454 }
2455 if (pOut)
2456 *pOut = UNICODE_NULL;
2457 return 0;
2458}
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1751
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 2334 of file pidl.c.

2334 {
2335 FileStructW *pFileStructW;
2336 WORD cbOffset;
2337
2338 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2339 return NULL;
2340
2341 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2342 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2343
2344 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2345 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2346 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2347 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2348 /* FileStructW is positioned after FileStruct */
2349 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2350 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2351 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2352 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2353 {
2354 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2355 return NULL;
2356 }
2357
2358 return pFileStructW;
2359}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2021
struct tagFileStruct FileStruct

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

◆ _ILGetFileType()

void _ILGetFileType ( LPCITEMIDLIST  pidl,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2506 of file pidl.c.

2507{
2508 WCHAR sType[64], sTemp[64];
2509
2510 if(_ILIsValue(pidl))
2511 {
2512 if(uOutSize > 0)
2513 pOut[0] = 0;
2514 if (_ILGetExtension(pidl, sType, _countof(sType)))
2515 {
2516 if (HCR_MapTypeToValueW(sType, sTemp, _countof(sTemp), TRUE))
2517 {
2518 /* retrieve description */
2519 if (HCR_MapTypeToValueW(sTemp, pOut, uOutSize, FALSE))
2520 return;
2521 }
2522
2523 /* display Ext-file as description */
2524 CharUpperW(sType);
2525 /* load localized file string */
2526 sTemp[0] = UNICODE_NULL;
2528 {
2529 sTemp[_countof(sTemp) - 1] = UNICODE_NULL;
2530 StringCchPrintfW(pOut, uOutSize, sTemp, sType);
2531 }
2532 }
2533 }
2534 else
2535 {
2536 pOut[0] = UNICODE_NULL;
2538 /* make sure its null terminated */
2539 pOut[uOutSize - 1] = UNICODE_NULL;
2540 }
2541}
#define shell32_hInstance
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2460
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:49
#define IDS_DIRECTORY
Definition: shresdef.h:160
#define IDS_ANY_FILE
Definition: shresdef.h:186
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)

Referenced by CFSFolder::GetDetailsOf(), and SHGetFileInfoW().

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2298 of file pidl.c.

2299{
2301
2302 TRACE("%p\n", pidl);
2303
2304 if (!pdata)
2305 return NULL;
2306
2307 TRACE("pdata->type 0x%04x\n", pdata->type);
2308 switch (pdata->type)
2309 {
2310 case PT_SHELLEXT:
2311 case PT_GUID:
2312 case PT_YAGUID:
2313 return &(pdata->u.guid.guid);
2314
2315 default:
2316 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2317 break;
2318 }
2319 return NULL;
2320}

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 2270 of file pidl.c.

2271{
2272 /* TRACE(pidl,"(pidl%p)\n", pidl); */
2273
2275
2276 if (!pdata)
2277 return NULL;
2278
2279 switch (pdata->type)
2280 {
2281 case PT_FOLDER:
2282 case PT_VALUE:
2283 case PT_IESPECIAL1:
2284 case PT_IESPECIAL2:
2285 return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
2286
2287 case PT_WORKGRP:
2288 return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
2289 }
2290 return NULL;
2291}
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 2227 of file pidl.c.

2228{
2229 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2230
2232
2233 if (!pdata)
2234 return NULL;
2235
2236 switch (pdata->type)
2237 {
2238 case PT_GUID:
2239 case PT_SHELLEXT:
2240 case PT_YAGUID:
2241 return NULL;
2242
2243 case PT_DRIVE:
2244 case PT_DRIVE1:
2245 case PT_DRIVE2:
2246 case PT_DRIVE3:
2247 return pdata->u.drive.szDriveName;
2248
2249 case PT_FOLDER:
2250 case PT_FOLDER1:
2251 case PT_VALUE:
2252 case PT_IESPECIAL1:
2253 case PT_IESPECIAL2:
2254 return pdata->u.file.szNames;
2255
2256 case PT_WORKGRP:
2257 case PT_COMP:
2258 case PT_NETWORK:
2259 case PT_NETPROVIDER:
2260 case PT_SHARE:
2261 return pdata->u.network.szNames;
2262 }
2263 return NULL;
2264}
#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 2171 of file pidl.c.

2172{
2173 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2174
2176
2177 if (!pdata)
2178 return NULL;
2179
2180 switch (pdata->type)
2181 {
2182 case PT_GUID:
2183 case PT_SHELLEXT:
2184 case PT_YAGUID:
2185 return NULL;
2186
2187 case PT_DRIVE:
2188 case PT_DRIVE1:
2189 case PT_DRIVE2:
2190 case PT_DRIVE3:
2191 /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
2192 return NULL;
2193
2194 case PT_FOLDER:
2195 case PT_FOLDER1:
2196 case PT_VALUE:
2197 case PT_IESPECIAL1:
2198 case PT_IESPECIAL2:
2199 /*return (LPSTR)&(pdata->u.file.szNames);*/
2200 return NULL;
2201
2202 case PT_WORKGRP:
2203 case PT_COMP:
2204 case PT_NETWORK:
2205 case PT_NETPROVIDER:
2206 case PT_SHARE:
2207 /*return (LPSTR)&(pdata->u.network.szNames);*/
2208 return NULL;
2209
2210 case PT_VALUEW:
2211 return (LPWSTR)pdata->u.file.szNames;
2212
2213#ifdef __REACTOS__ /* r54423 */
2214 case PT_CPLAPPLET:
2215 return pdata->u.cpanel.szName;
2216#endif
2217
2218 }
2219 return NULL;
2220}
#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 488 of file pidl.c.

489{
490 LPPIDLDATA pdata1 = _ILGetDataPointer(pidltemp1);
491 LPPIDLDATA pdata2 = _ILGetDataPointer(pidltemp2);
492
493 IID *iid1 = _ILGetGUIDPointer(pidltemp1);
494 IID *iid2 = _ILGetGUIDPointer(pidltemp2);
495
496 FileStructW* pDataW1 = _ILGetFileStructW(pidltemp1);
497 FileStructW* pDataW2 = _ILGetFileStructW(pidltemp2);
498
499 if (_ILIsDesktop(pidltemp1) && _ILIsDesktop(pidltemp2))
500 {
501 return TRUE;
502 }
503 else if (_ILIsDesktop(pidltemp1) || _ILIsDesktop(pidltemp2))
504 {
505 return FALSE;
506 }
507 else if (iid1 || iid2)
508 {
509 if (!iid1 || !iid2 || memcmp(iid1, iid2, sizeof(GUID)))
510 return FALSE;
511 }
512 else if (pDataW1 || pDataW2)
513 {
514 if (!pDataW1 || !pDataW2 || wcsicmp(pDataW1->wszName, pDataW2->wszName))
515 return FALSE;
516 }
517 else if (_ILIsFolder(pidltemp1) || _ILIsFolder(pidltemp2))
518 {
519 if (!_ILIsFolder(pidltemp1) || !_ILIsFolder(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
520 return FALSE;
521 }
522 else if (_ILIsValue(pidltemp1) || _ILIsValue(pidltemp2))
523 {
524 if (!_ILIsValue(pidltemp1) || !_ILIsValue(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
525 return FALSE;
526 }
527 else if (_ILIsDrive(pidltemp1) || _ILIsDrive(pidltemp2))
528 {
529 if (!_ILIsDrive(pidltemp1) || !_ILIsDrive(pidltemp2) || pdata1->u.drive.szDriveName[0] != pdata2->u.drive.szDriveName[0])
530 return FALSE;
531 }
532 else
533 {
534 if ((pidltemp1->mkid.cb != pidltemp2->mkid.cb) ||
535 !RtlEqualMemory((BYTE*)&pidltemp1->mkid, (BYTE*)&pidltemp2->mkid, pidltemp1->mkid.cb))
536 {
537 return FALSE;
538 }
539 }
540
541 return TRUE;
542}
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:2334
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2298
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1936
struct tagDriveStruct drive
Definition: pidl.h:208
struct tagFileStruct file
Definition: pidl.h:209
union tagPIDLDATA::@557 u

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

◆ _ILIsBitBucket()

BOOL _ILIsBitBucket ( LPCITEMIDLIST  pidl)

Definition at line 1987 of file pidl.c.

1988{
1989 IID *iid = _ILGetGUIDPointer(pidl);
1990
1991 TRACE("(%p)\n", pidl);
1992
1993 if (iid)
1994 return IsEqualIID(iid, &CLSID_RecycleBin);
1995 return FALSE;
1996}
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

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

◆ _ILIsControlPanel()

BOOL _ILIsControlPanel ( LPCITEMIDLIST  pidl)

Definition at line 1965 of file pidl.c.

1966{
1967 IID *iid = _ILGetGUIDPointer(pidl);
1968
1969 TRACE("(%p)\n", pidl);
1970
1971 if (iid)
1972 return IsEqualIID(iid, &CLSID_ControlPanel);
1973 return FALSE;
1974}

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

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2039 of file pidl.c.

2040{
2041 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2042
2043 TRACE("(%p)\n",pidl);
2044
2045 return (pidl && lpPData && (lpPData->type == 0));
2046}
PIDLTYPE type
Definition: pidl.h:204

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

◆ _ILIsDesktop()

BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 1936 of file pidl.c.

1937{
1938 TRACE("(%p)\n",pidl);
1939
1940 return !pidl || !pidl->mkid.cb;
1941}

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

◆ _ILIsDrive()

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1976 of file pidl.c.

1977{
1978 REFIID iid = _ILGetGUIDPointer(pidl);
1979
1980 TRACE("(%p)\n",pidl);
1981
1982 if (iid)
1983 return IsEqualIID(iid, &CLSID_MyComputer);
1984 return FALSE;
1985}
#define REFIID
Definition: guiddef.h:118

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

◆ _ILIsMyDocuments()

BOOL _ILIsMyDocuments ( LPCITEMIDLIST  pidl)

Definition at line 1943 of file pidl.c.

1944{
1945 IID *iid = _ILGetGUIDPointer(pidl);
1946
1947 TRACE("(%p)\n", pidl);
1948
1949 if (iid)
1950 return IsEqualIID(iid, &CLSID_MyDocuments);
1951 return FALSE;
1952}

◆ _ILIsNetHood()

BOOL _ILIsNetHood ( LPCITEMIDLIST  pidl)

Definition at line 1954 of file pidl.c.

1955{
1956 IID *iid = _ILGetGUIDPointer(pidl);
1957
1958 TRACE("(%p)\n", pidl);
1959
1960 if (iid)
1961 return IsEqualIID(iid, &CLSID_NetworkPlaces);
1962 return FALSE;
1963}

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 2051 of file pidl.c.

2052{
2053 BOOL ret = TRUE;
2054
2055 if(! _ILIsDesktop(pidl)) /* pidl=NULL or mkid.cb=0 */
2056 {
2057 WORD len = pidl->mkid.cb;
2058 LPCITEMIDLIST pidlnext = (LPCITEMIDLIST) (((const BYTE*)pidl) + len );
2059
2060 if (pidlnext->mkid.cb)
2061 ret = FALSE;
2062 }
2063
2064 TRACE("%s\n", ret ? "Yes" : "No");
2065 return ret;
2066}

Referenced by SHBindToParent().

◆ _ILIsSpecialFolder()

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1927 of file pidl.c.

1928{
1929 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1930
1931 TRACE("(%p)\n",pidl);
1932
1933 return (pidl && lpPData && PT_VALUEW == lpPData->type);
1934}

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 1051 of file pidl.c.

1053{
1054 LPSHELLFOLDER pSF = NULL;
1055 LPBC pBC = NULL;
1056 HRESULT ret;
1057
1058 TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
1059 ppidl, ppidl ? *ppidl : NULL,
1060 prgfInOut, prgfInOut ? *prgfInOut : 0);
1061
1062 ret = SHGetDesktopFolder(&pSF);
1063 if (FAILED(ret))
1064 return ret;
1065
1066 if (lpFindFile || bBindCtx)
1067 ret = IFileSystemBindData_Constructor(lpFindFile, &pBC);
1068
1069 if (SUCCEEDED(ret))
1070 {
1071 ret = IShellFolder_ParseDisplayName(pSF, 0, pBC, (LPOLESTR)path, NULL, ppidl, prgfInOut);
1072 }
1073
1074 if (pBC)
1075 {
1076 IBindCtx_Release(pBC);
1077 pBC = NULL;
1078 }
1079
1080 IShellFolder_Release(pSF);
1081
1082 if (FAILED(ret) && ppidl)
1083 *ppidl = NULL;
1084
1085 TRACE("%s %p 0x%x\n", debugstr_w(path), ppidl ? *ppidl : NULL, prgfInOut ? *prgfInOut : 0);
1086
1087 return ret;
1088}
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 SHSimpleIDListFromPathA(), and SHSimpleIDListFromPathW().

◆ _ILSimpleGetTextW()

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

Definition at line 2080 of file pidl.c.

2081{
2082 DWORD dwReturn;
2083 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2084
2085 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2086
2087 if (pFileStructW) {
2088 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2089 dwReturn = lstrlenW(pFileStructW->wszName);
2090 } else {
2091 GUID const * riid;
2092 WCHAR szTemp[MAX_PATH];
2093 LPSTR szSrc;
2094 LPWSTR szSrcW;
2095 dwReturn=0;
2096
2097 if (!pidl)
2098 return 0;
2099
2100 if (szOut)
2101 *szOut = 0;
2102
2103 if (_ILIsDesktop(pidl))
2104 {
2105 /* desktop */
2106 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, _countof(szTemp)))
2107 {
2108 if (szOut)
2109 lstrcpynW(szOut, szTemp, uOutSize);
2110
2111 dwReturn = lstrlenW (szTemp);
2112 }
2113 }
2114 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2115 {
2116 /* unicode filesystem */
2117 if (szOut)
2118 lstrcpynW(szOut, szSrcW, uOutSize);
2119
2120 dwReturn = lstrlenW(szSrcW);
2121 }
2122 else if (( szSrc = _ILGetTextPointer(pidl) ))
2123 {
2124 /* filesystem */
2125 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, _countof(szTemp));
2126
2127 if (szOut)
2128 lstrcpynW(szOut, szTemp, uOutSize);
2129
2130 dwReturn = lstrlenW (szTemp);
2131 }
2132 else if (( riid = _ILGetGUIDPointer(pidl) ))
2133 {
2134 /* special folder */
2135 if ( HCR_GetClassNameW(riid, szTemp, _countof(szTemp)))
2136 {
2137 if (szOut)
2138 lstrcpynW(szOut, szTemp, uOutSize);
2139
2140 dwReturn = lstrlenW (szTemp);
2141 }
2142 }
2143 else
2144 {
2145 ERR("-- no text\n");
2146 }
2147 }
2148
2149 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2150 return dwReturn;
2151}
#define MultiByteToWideChar
Definition: compat.h:110
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2171
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:405

Referenced by CDesktopFolder::_GetSFFromPidl(), _ILGetDrive(), _ILGetExtension(), AddFSClassKeysToArray(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), 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 323 of file utils.cpp.

324{
325 HWND hWnd = NULL;
326
328 if (pBindCtx && SUCCEEDED(pBindCtx->GetObjectParam((LPWSTR)L"UI During Binding", &punk)))
329 IUnknown_GetWindow(punk, &hWnd);
330
331 return hWnd;
332}
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 383 of file utils.cpp.

388{
389 HRESULT hr = S_OK;
391
392 *ppbc = pBindCtx;
393
394 if (pBindCtx)
395 {
396 pBindCtx->AddRef();
397 }
398 else
399 {
400 hr = CreateBindCtx(0, ppbc);
401 if (FAILED(hr))
402 return hr;
403 }
404
405 if (!punk)
406 punk = pUnknown = new CDummyOleWindow();
407
408 hr = (*ppbc)->RegisterObjectParam(pszKey, punk);
409
410 if (pUnknown)
411 pUnknown->Release();
412
413 if (FAILED(hr))
414 {
415 (*ppbc)->Release();
416 *ppbc = NULL;
417 }
418
419 return hr;
420}
_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 906 of file pidl.c.

907{
908 LPITEMIDLIST idlRet;
910
911 WARN("(pidl=%p,pidl=%p,%08u)semi-stub\n",pidl,item,bEnd);
912
913 pdump (pidl);
914 pdump (itemid);
915
916 if (_ILIsDesktop(pidl))
917 {
918 idlRet = ILClone(itemid);
919 SHFree (pidl);
920 return idlRet;
921 }
922
923 if (bEnd)
924 idlRet = ILCombine(pidl, itemid);
925 else
926 idlRet = ILCombine(itemid, pidl);
927
928 SHFree(pidl);
929 return idlRet;
930}
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(), CFSFolder::CallBack(), 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(), SHGetFileInfoW(), 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 718 of file pidl.c.

719{
720 DWORD len1,len2;
721 LPITEMIDLIST pidlNew;
722
723 TRACE("pidl=%p pidl=%p\n",pidl1,pidl2);
724
725 if (!pidl1 && !pidl2) return NULL;
726
727 pdump (pidl1);
728 pdump (pidl2);
729
730 if (!pidl1)
731 {
732 pidlNew = ILClone(pidl2);
733 return pidlNew;
734 }
735
736 if (!pidl2)
737 {
738 pidlNew = ILClone(pidl1);
739 return pidlNew;
740 }
741
742 len1 = ILGetSize(pidl1)-2;
743 len2 = ILGetSize(pidl2);
744 pidlNew = SHAlloc(len1+len2);
745
746 if (pidlNew)
747 {
748 memcpy(pidlNew,pidl1,len1);
749 memcpy(((BYTE *)pidlNew)+len1,pidl2,len2);
750 }
751
752 /* TRACE(pidl,"--new pidl=%p\n",pidlNew);*/
753 return pidlNew;
754}

Referenced by _ILCreateControlPanel(), _ILCreatePrinters(), CDesktopFolder::_ParseDisplayNameByParent(), _ShowPropertiesDialogThread(), 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(), 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 987 of file pidl.c.

988{
989 LPITEMIDLIST pidlnew = NULL;
990
991 TRACE_(shell)("%s\n", debugstr_a(path));
992
993 if (SUCCEEDED(SHILCreateFromPathA(path, &pidlnew, NULL)))
994 return pidlnew;
995 return NULL;
996}
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 1017 of file pidl.c.

1018{
1019 if ( SHELL_OsIsUnicode())
1020 return ILCreateFromPathW (path);
1021 return ILCreateFromPathA (path);
1022}
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1003
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path)
Definition: pidl.c:987
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:138

◆ ILCreateFromPathW()

◆ ILFindChild()

PUIDLIST_RELATIVE WINAPI ILFindChild ( PIDLIST_ABSOLUTE  pidl1,
PCIDLIST_ABSOLUTE  pidl2 
)

Definition at line 660 of file pidl.c.

661{
662 LPCITEMIDLIST pidltemp1 = pidl1;
663 LPCITEMIDLIST pidltemp2 = pidl2;
665
666 TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
667
668 /* explorer reads from registry directly (StreamMRU),
669 so we can only check here */
670 if ((!pcheck (pidl1)) || (!pcheck (pidl2)))
671 return FALSE;
672
673 pdump (pidl1);
674 pdump (pidl2);
675
676 if (_ILIsDesktop(pidl1))
677 {
678 ret = pidl2;
679 }
680 else
681 {
682 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
683 {
684 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
685 return FALSE;
686
687 pidltemp1 = ILGetNext(pidltemp1);
688 pidltemp2 = ILGetNext(pidltemp2);
689 ret = pidltemp2;
690 }
691
692 if (pidltemp1->mkid.cb)
693 ret = NULL; /* elements of pidl1 left*/
694 }
695 TRACE_(shell)("--- %p\n", ret);
696 return (PUIDLIST_RELATIVE)ret; /* pidl 1 is shorter */
697}
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:349
BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
Definition: pidl.c:488
ITEMIDLIST_RELATIVE UNALIGNED * PUIDLIST_RELATIVE
Definition: shtypes.idl:55

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

◆ ILFindLastID()

◆ ILFree()

void WINAPI ILFree ( LPITEMIDLIST  pidl)

Definition at line 946 of file pidl.c.

947{
948 TRACE("(pidl=%p)\n",pidl);
949 SHFree(pidl);
950}

Referenced by CMenuBand::_CallCB(), CMruNode::_GetPidlSlot(), CFSFolder::_ParseSimple(), _tmain(), CRegFolderEnum::AddItemsFromKey(), CEnumMergedFolder::Begin(), CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject(), 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(), 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(), CDesktopFolder::ShellUrlParseDisplayName(), SHExplorerParseCmdLine(), SHGetFileInfoW(), 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_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:1356
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 836 of file pidl.c.

837{
838 LPCSHITEMID si;
839 UINT len=0;
840
841 if (pidl)
842 {
843 si = &(pidl->mkid);
844
845 while (si->cb)
846 {
847 len += si->cb;
848 si = (LPCSHITEMID)(((const BYTE*)si)+si->cb);
849 }
850 len += 2;
851 }
852 TRACE("pidl=%p size=%u\n",pidl, len);
853 return len;
854}
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 966 of file pidl.c.

967{
968 TRACE("%p\n", pidl);
969
970 Free(pidl);
971}
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

◆ ILIsEqual()

BOOL WINAPI ILIsEqual ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 548 of file pidl.c.

549{
550 LPCITEMIDLIST pidltemp1 = pidl1;
551 LPCITEMIDLIST pidltemp2 = pidl2;
552
553 TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
554
555 /*
556 * Explorer reads from registry directly (StreamMRU),
557 * so we can only check here
558 */
559 if (!pcheck(pidl1) || !pcheck (pidl2))
560#ifdef __REACTOS__
561 {
562 /* We don't understand the PIDL content but that does not mean it's invalid */
563 }
564#else
565 return FALSE;
566#endif
567
568 pdump (pidl1);
569 pdump (pidl2);
570
571 if (!pidl1 || !pidl2)
572 return FALSE;
573
574 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
575 {
576 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
577 return FALSE;
578
579 pidltemp1 = ILGetNext(pidltemp1);
580 pidltemp2 = ILGetNext(pidltemp2);
581 }
582
583 if (!pidltemp1->mkid.cb && !pidltemp2->mkid.cb)
584 return TRUE;
585
586 return FALSE;
587}

Referenced by CViewStatePropertyBag::_IsSamePidl(), 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 611 of file pidl.c.

612{
613 LPCITEMIDLIST pParent = pidlParent;
614 LPCITEMIDLIST pChild = pidlChild;
615
616 TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate);
617
618 if (!pParent || !pChild)
619 return FALSE;
620
621 while (pParent->mkid.cb && pChild->mkid.cb)
622 {
623 if (!_ILHACKCompareSimpleIds(pParent, pChild))
624 return FALSE;
625
627 pChild = ILGetNext(pChild);
628 }
629
630 /* child has shorter name than parent */
631 if (pParent->mkid.cb)
632 return FALSE;
633
634 /* not immediate descent */
635 if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
636 return FALSE;
637
638 return TRUE;
639}
FxObject * pParent
Definition: fxdpcapi.cpp:86

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

◆ 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 1356 of file pidl.c.

1357{
1358 IShellFolder * psfDesktop;
1360
1361 TRACE_(shell)("pidl=%p\n", pidl);
1362 pdump(pidl);
1363
1364 if (!pidl || !ppv)
1365 return E_INVALIDARG;
1366
1367 *ppv = NULL;
1368 if (ppidlLast)
1369 *ppidlLast = NULL;
1370
1371 hr = SHGetDesktopFolder(&psfDesktop);
1372 if (FAILED(hr))
1373 return hr;
1374
1375 if (_ILIsPidlSimple(pidl))
1376 {
1377 /* we are on desktop level */
1378 hr = IShellFolder_QueryInterface(psfDesktop, riid, ppv);
1379 }
1380 else
1381 {
1382 LPITEMIDLIST pidlParent = ILClone(pidl);
1383 ILRemoveLastID(pidlParent);
1384 hr = IShellFolder_BindToObject(psfDesktop, pidlParent, NULL, riid, ppv);
1385 SHFree (pidlParent);
1386 }
1387
1388 IShellFolder_Release(psfDesktop);
1389
1390 if (SUCCEEDED(hr) && ppidlLast)
1391 *ppidlLast = ILFindLastID(pidl);
1392
1393 TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08x\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
1394 return hr;
1395}
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:221
BOOL _ILIsPidlSimple(LPCITEMIDLIST pidl)
Definition: pidl.c:2051

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 CStartMenuBtnCtxMenu::QueryContextMenu(), and START_TEST().

◆ SHGetDataFromIDListA()

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

Definition at line 1158 of file pidl.c.

1160{
1161 LPSTR filename, shortname;
1163
1164 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1165
1166 pdump(pidl);
1167 if (!psf || !dest)
1168 return E_INVALIDARG;
1169
1170 switch (nFormat)
1171 {
1172 case SHGDFIL_FINDDATA:
1173 pfd = dest;
1174
1175 if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
1176 return E_INVALIDARG;
1177
1178 if (len < sizeof(WIN32_FIND_DATAA))
1179 return E_INVALIDARG;
1180
1181 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
1182 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1183 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1184 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1185
1187 shortname = _ILGetSTextPointer(pidl);
1188
1189 if (filename)
1190 lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
1191 else
1192 pfd->cFileName[0] = '\0';
1193
1194 if (shortname)
1195 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
1196 else
1197 pfd->cAlternateFileName[0] = '\0';
1198 return S_OK;
1199
1202 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1203 break;
1204
1205 default:
1206 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1207 }
1208
1209 return E_INVALIDARG;
1210}
#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:2270
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2560
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1998
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2439
#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 1216 of file pidl.c.

1218{
1219 LPSTR filename, shortname;
1221
1222 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1223
1224 pdump(pidl);
1225
1226 if (!psf || !dest)
1227 return E_INVALIDARG;
1228
1229 switch (nFormat)
1230 {
1231 case SHGDFIL_FINDDATA:
1232 pfd = dest;
1233
1234 if (_ILIsDrive(pidl))
1235 return E_INVALIDARG;
1236
1237 if (len < sizeof(WIN32_FIND_DATAW))
1238 return E_INVALIDARG;
1239
1240 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
1241 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1242 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1243 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1244
1246 shortname = _ILGetSTextPointer(pidl);
1247
1248 if (!filename)
1249 pfd->cFileName[0] = '\0';
1250 else if (!MultiByteToWideChar(CP_ACP, 0, filename, -1, pfd->cFileName, MAX_PATH))
1251 pfd->cFileName[MAX_PATH-1] = 0;
1252
1253 if (!shortname)
1254 pfd->cAlternateFileName[0] = '\0';
1255 else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1, pfd->cAlternateFileName, 14))
1256 pfd->cAlternateFileName[13] = 0;
1257 return S_OK;
1258
1261 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1262 break;
1263
1264 default:
1265 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1266 }
1267
1268 return E_INVALIDARG;
1269}

Referenced by CViewStatePropertyBag::_IsSystemFolder().

◆ SHGetIDListFromObject()

HRESULT WINAPI SHGetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 1525 of file pidl.c.

1526{
1527 IPersistIDList *ppersidl;
1528 IPersistFolder2 *ppf2;
1529 IDataObject *pdo;
1530 IFolderView *pfv;
1531 HRESULT ret;
1532
1533 if(!punk)
1534 return E_NOINTERFACE;
1535
1536 *ppidl = NULL;
1537
1538 /* Try IPersistIDList */
1539 ret = IUnknown_QueryInterface(punk, &IID_IPersistIDList, (void**)&ppersidl);
1540 if(SUCCEEDED(ret))
1541 {
1542 TRACE("IPersistIDList (%p)\n", ppersidl);
1543 ret = IPersistIDList_GetIDList(ppersidl, ppidl);
1544 IPersistIDList_Release(ppersidl);
1545 if(SUCCEEDED(ret))
1546 return ret;
1547 }
1548
1549 /* Try IPersistFolder2 */
1550 ret = IUnknown_QueryInterface(punk, &IID_IPersistFolder2, (void**)&ppf2);
1551 if(SUCCEEDED(ret))
1552 {
1553 TRACE("IPersistFolder2 (%p)\n", ppf2);
1554 ret = IPersistFolder2_GetCurFolder(ppf2, ppidl);
1555 IPersistFolder2_Release(ppf2);
1556 if(SUCCEEDED(ret))
1557 return ret;
1558 }
1559
1560 /* Try IDataObject */
1561 ret = IUnknown_QueryInterface(punk, &IID_IDataObject, (void**)&pdo);
1562 if(SUCCEEDED(ret))
1563 {
1564 IShellItem *psi;
1565 TRACE("IDataObject (%p)\n", pdo);
1567 &IID_IShellItem, (void**)&psi);
1568 if(SUCCEEDED(ret))
1569 {
1570 ret = SHGetIDListFromObject((IUnknown*)psi, ppidl);
1571 IShellItem_Release(psi);
1572 }
1573 IDataObject_Release(pdo);
1574
1575 if(SUCCEEDED(ret))
1576 return ret;
1577 }
1578
1579 /* Try IFolderView */
1580 ret = IUnknown_QueryInterface(punk, &IID_IFolderView, (void**)&pfv);
1581 if(SUCCEEDED(ret))
1582 {
1583 IShellFolder *psf;
1584 TRACE("IFolderView (%p)\n", pfv);
1585 ret = IFolderView_GetFolder(pfv, &IID_IShellFolder, (void**)&psf);
1586 if(SUCCEEDED(ret))
1587 {
1588 /* We might be able to get IPersistFolder2 from a shellfolder. */
1589 ret = SHGetIDListFromObject((IUnknown*)psf, ppidl);
1590 }
1591 IFolderView_Release(pfv);
1592 return ret;
1593 }
1594
1595 return ret;
1596}
const GUID IID_IDataObject
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1525
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 1462 of file pidl.c.

1463{
1464 IShellFolder *psfparent;
1465 LPCITEMIDLIST child_pidl;
1466 STRRET disp_name;
1467 HRESULT ret;
1468
1469 TRACE("%p 0x%08x %p\n", pidl, sigdnName, ppszName);
1470
1471 *ppszName = NULL;
1472 ret = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psfparent, &child_pidl);
1473 if(SUCCEEDED(ret))
1474 {
1475 switch(sigdnName)
1476 {
1477 /* sigdnName & 0xffff */
1478 case SIGDN_NORMALDISPLAY: /* SHGDN_NORMAL */
1479 case SIGDN_PARENTRELATIVEPARSING: /* SHGDN_INFOLDER | SHGDN_FORPARSING */
1480 case SIGDN_PARENTRELATIVEEDITING: /* SHGDN_INFOLDER | SHGDN_FOREDITING */
1481 case SIGDN_DESKTOPABSOLUTEPARSING: /* SHGDN_FORPARSING */
1482 case SIGDN_DESKTOPABSOLUTEEDITING: /* SHGDN_FOREDITING | SHGDN_FORADDRESSBAR*/
1483 case SIGDN_PARENTRELATIVEFORADDRESSBAR: /* SIGDN_INFOLDER | SHGDN_FORADDRESSBAR */
1484 case SIGDN_PARENTRELATIVE: /* SIGDN_INFOLDER */
1485
1486 disp_name.uType = STRRET_WSTR;
1487 ret = IShellFolder_GetDisplayNameOf(psfparent, child_pidl,
1488 sigdnName & 0xffff,
1489 &disp_name);
1490 if(SUCCEEDED(ret))
1491 ret = StrRetToStrW(&disp_name, pidl, ppszName);
1492
1493 break;
1494
1495 case SIGDN_FILESYSPATH:
1497 if(SHGetPathFromIDListW(pidl, *ppszName))
1498 {
1499 TRACE("Got string %s\n", debugstr_w(*ppszName));
1500 ret = S_OK;
1501 }
1502 else
1503 {
1505 ret = E_INVALIDARG;
1506 }
1507 break;
1508
1509 case SIGDN_URL:
1510 default:
1511 FIXME("Unsupported SIGDN %x\n", sigdnName);
1512 ret = E_FAIL;
1513 }
1514
1515 IShellFolder_Release(psfparent);
1516 }
1517 return ret;
1518}
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:1348
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(), _ShowPropertiesDialogThread(), CFSFolder::CallBack(), CShellItem::GetDisplayName(), GetParsingName(), and init_function_pointers().

◆ SHGetPathCchFromIDListW()

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

Definition at line 1303 of file pidl.c.

1307{
1308 HRESULT hr;
1309 LPCITEMIDLIST pidlLast;
1310 LPSHELLFOLDER psfFolder;
1312 STRRET strret;
1313
1314 TRACE_(shell)("(pidl=%p,%p)\n", pidl, pszPath);
1315 pdump(pidl);
1316
1317 *pszPath = UNICODE_NULL;
1318 if (!pidl)
1319 return E_FAIL;
1320
1321 hr = SHBindToParent(pidl, &IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
1322 if (FAILED(hr))
1323 {
1324 ERR("SHBindToParent failed: %x\n", hr);
1325 return hr;
1326 }
1327
1328 dwAttributes = SFGAO_FILESYSTEM;
1329 hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes);
1330 if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM))
1331 {
1332 WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr);
1333 IShellFolder_Release(psfFolder);
1334 return E_FAIL;
1335 }
1336
1337 hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
1338 IShellFolder_Release(psfFolder);
1339 if (FAILED(hr))
1340 return hr;
1341
1342 hr = StrRetToBufW(&strret, pidlLast, pszPath, cchPathMax);
1343
1344 TRACE_(shell)("-- %s, 0x%08x\n",debugstr_w(pszPath), hr);
1345 return hr;
1346}
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1530
DWORD dwAttributes
Definition: vdmdbg.h:34

Referenced by SHGetPathFromIDListW().

◆ SHGetPathFromIDListA()

BOOL WINAPI SHGetPathFromIDListA ( LPCITEMIDLIST  pidl,
LPSTR  pszPath 
)

Definition at line 1286 of file pidl.c.

1287{
1288 WCHAR wszPath[MAX_PATH];
1289 BOOL bSuccess;
1290
1291 bSuccess = SHGetPathFromIDListW(pidl, wszPath);
1292 WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL);
1293
1294 return bSuccess;
1295}
static BOOLEAN bSuccess
Definition: drive.cpp:477

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 1348 of file pidl.c.

1349{
1350 return SUCCEEDED(SHGetPathCchFromIDListW(pidl, pszPath, MAX_PATH));
1351}
HRESULT WINAPI SHGetPathCchFromIDListW(_In_ LPCITEMIDLIST pidl, _Out_writes_(cchPathMax) LPWSTR pszPath, _In_ SIZE_T cchPathMax)
Definition: pidl.c:1303

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 762 of file pidl.c.

763{
764 IDataObject* pDataObj;
765 HRESULT hr;
766
767 hr = IShellFolder_GetUIObjectOf(lpsf, 0, 1, &pidlSimple,
768 &IID_IDataObject, 0, (LPVOID*)&pDataObj);
769 if (SUCCEEDED(hr))
770 {
771 STGMEDIUM medium;
772 FORMATETC fmt;
773
775 fmt.ptd = NULL;
776 fmt.dwAspect = DVASPECT_CONTENT;
777 fmt.lindex = -1;
778 fmt.tymed = TYMED_HGLOBAL;
779
780 hr = IDataObject_GetData(pDataObj, &fmt, &medium);
781
782 IDataObject_Release(pDataObj);
783
784 if (SUCCEEDED(hr))
785 {
786 /*assert(pida->cidl==1);*/
787 LPIDA pida = GlobalLock(medium.u.hGlobal);
788
789 LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
790 LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
791
792 *pidlReal = ILCombine(pidl_folder, pidl_child);
793
794 if (!*pidlReal)
796
797 GlobalUnlock(medium.u.hGlobal);
798 GlobalFree(medium.u.hGlobal);
799 }
800 }
801
802 return hr;
803}
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 813 of file pidl.c.

814{
815 FIXME("(pidl=%p)\n",pidl);
816
817 pdump(pidl);
818
819 return 0;
820}

◆ SHParseDisplayName()

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

Definition at line 1400 of file pidl.c.

1402{
1403 HRESULT hr;
1404 LPWSTR pszNameDup;
1405 IShellFolder *psfDesktop;
1406 IBindCtx *pBindCtx = NULL;
1407
1408 TRACE("(%s, %p, %p, 0x%X, %p)\n", pszName, pbc, ppidl, sfgaoIn, psfgaoOut);
1409
1410 *ppidl = NULL;
1411
1412 if (psfgaoOut)
1413 *psfgaoOut = 0;
1414
1415 pszNameDup = StrDupW(pszName);
1416 if (!pszNameDup)
1417 return E_OUTOFMEMORY;
1418
1419 psfDesktop = NULL;
1420 hr = SHGetDesktopFolder(&psfDesktop);
1421 if (FAILED(hr))
1422 {
1423 LocalFree(pszNameDup);
1424 return hr;
1425 }
1426
1427 if (!pbc)
1428 {
1429 hr = BindCtx_RegisterObjectParam(NULL, STR_PARSE_TRANSLATE_ALIASES, NULL, &pBindCtx);
1430 pbc = pBindCtx;
1431 }
1432
1433 if (SUCCEEDED(hr))
1434 {
1435 ULONG sfgao = sfgaoIn, cchEaten;
1436 HWND hwndUI = BindCtx_GetUIWindow(pbc);
1437 hr = psfDesktop->lpVtbl->ParseDisplayName(psfDesktop,
1438 hwndUI,
1439 pbc,
1440 pszNameDup,
1441 &cchEaten,
1442 ppidl,
1443 (psfgaoOut ? &sfgao : NULL));
1444 if (SUCCEEDED(hr) && psfgaoOut)
1445 *psfgaoOut = (sfgao & sfgaoIn);
1446 }
1447
1448 LocalFree(pszNameDup);
1449
1450 if (psfDesktop)
1451 psfDesktop->lpVtbl->Release(psfDesktop);
1452
1453 if (pBindCtx)
1454 pBindCtx->lpVtbl->Release(pBindCtx);
1455
1456 return hr;
1457}
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:383
EXTERN_C HWND BindCtx_GetUIWindow(_In_ IBindCtx *pBindCtx)
Definition: utils.cpp:323
uint32_t ULONG
Definition: typedefs.h:59

Referenced by BtrfsSend::AddClone(), 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 1110 of file pidl.c.

1111{
1112 LPITEMIDLIST pidl = NULL;
1113 LPWSTR wPath = NULL;
1114 int len;
1115
1116 TRACE("%s\n", debugstr_a(lpszPath));
1117
1118 if (lpszPath)
1119 {
1120 len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0);
1121 wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1122 MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len);
1123 }
1124
1125 _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
1126
1127 HeapFree(GetProcessHeap(), 0, wPath);
1128 TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
1129 return pidl;
1130}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
Definition: pidl.c:1051

Referenced by SHSimpleIDListFromPathAW().

◆ SHSimpleIDListFromPathAW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW ( LPCVOID  lpszPath)

Definition at line 1144 of file pidl.c.

1145{
1146 if ( SHELL_OsIsUnicode())
1147 return SHSimpleIDListFromPathW (lpszPath);
1148 return SHSimpleIDListFromPathA (lpszPath);
1149}
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
Definition: pidl.c:1110
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1132

◆ SHSimpleIDListFromPathW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathW ( LPCWSTR  lpszPath)

Definition at line 1132 of file pidl.c.

1133{
1134 LPITEMIDLIST pidl = NULL;
1135
1136 TRACE("%s\n", debugstr_w(lpszPath));
1137
1138 _ILParsePathW(lpszPath, NULL, TRUE, &pidl, NULL);
1139
1140 TRACE("%s %p\n", debugstr_w(lpszPath), pidl);
1141 return pidl;
1142}

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  )