ReactOS 0.4.15-dev-8096-ga0eec98
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, LPSTR 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 _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
 
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, LPSTR pOut, UINT uOutSize)
 
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
 
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
 
void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
 
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR 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 1607 of file pidl.c.

1608{
1609 LPITEMIDLIST pidlOut = NULL;
1610
1611 pidlOut = SHAlloc(size + 5);
1612 if(pidlOut)
1613 {
1615 LPITEMIDLIST pidlNext;
1616
1617 ZeroMemory(pidlOut, size + 5);
1618 pidlOut->mkid.cb = size + 3;
1619
1620 pData = _ILGetDataPointer(pidlOut);
1621 if (pData)
1622 pData->type = type;
1623
1624 pidlNext = ILGetNext(pidlOut);
1625 if (pidlNext)
1626 pidlNext->mkid.cb = 0x00;
1627 TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
1628 }
1629
1630 return pidlOut;
1631}
#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:2218
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:864
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 2694 of file pidl.c.

2695{
2696 UINT i;
2697 PITEMID_CHILD *apidldest;
2698
2699 if (!apidlsrc)
2700 return NULL;
2701
2702 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2703
2704 for (i = 0; i < cidl; i++)
2705 apidldest[i] = ILClone(apidlsrc[i]);
2706
2707 return apidldest;
2708}
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 2715 of file pidl.c.

2716{
2717 UINT i;
2719
2720 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2721 if (!dst)
2722 return NULL;
2723
2724 if (pidl)
2725 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2726
2727 for (i = 0; i < cida->cidl; i++)
2728 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2729
2730 return dst;
2731}
GLenum GLenum dst
Definition: glext.h:6340
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
UINT cidl
Definition: shlobj.h:565
unsigned char BYTE
Definition: xxhash.c:193

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

◆ _ILCreateAdminTools()

LPITEMIDLIST _ILCreateAdminTools ( void  )

Definition at line 1712 of file pidl.c.

1713{
1714 TRACE("()\n");
1716}
const GUID CLSID_AdminFolderShortcut
#define PT_GUID
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1718

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1706 of file pidl.c.

1707{
1708 TRACE("()\n");
1709 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1710}

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1662 of file pidl.c.

1663{
1664 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1665
1666 TRACE("()\n");
1667 if (parent)
1668 {
1669 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1670
1671 if (cpl)
1672 {
1673 ret = ILCombine(parent, cpl);
1674 SHFree(cpl);
1675 }
1676 SHFree(parent);
1677 }
1678 return ret;
1679}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
r parent
Definition: btrfs.c:3010
#define PT_SHELLEXT
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
int ret

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1633 of file pidl.c.

1634{
1636
1637 TRACE("()\n");
1638 ret = SHAlloc(2);
1639 if (ret)
1640 ret->mkid.cb = 0;
1641 return ret;
1642}

Referenced by BrsFolder_OnCommand(), CDesktopFolder::FinalConstruct(), GetNormalAndSelectedIcons(), and SHGetFolderLocation().

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1839 of file pidl.c.

1840{
1841 LPITEMIDLIST pidlOut;
1842
1843 TRACE("(%s)\n",debugstr_w(lpszNew));
1844
1845 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1846 if (pidlOut)
1847 {
1848 LPSTR pszDest;
1849
1850 pszDest = _ILGetTextPointer(pidlOut);
1851 if (pszDest)
1852 {
1853 strcpy(pszDest, "x:\\");
1854 pszDest[0]=toupperW(lpszNew[0]);
1855 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1856 }
1857 }
1858 return pidlOut;
1859}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2285
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1607
#define PT_DRIVE
Definition: pidl.h:88
#define toupperW(n)
Definition: unicode.h:51
char * LPSTR
Definition: xmlstorage.h:182

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1861 of file pidl.c.

1862{
1863 LPITEMIDLIST pidlOut;
1864
1865 TRACE("\n");
1866
1867 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1868 if (pidlOut)
1869 {
1871
1872 pData->u.network.dummy = 0;
1873 strcpy(pData->u.network.szNames, "Entire Network");
1874 }
1875 return pidlOut;
1876}
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 1772 of file pidl.c.

1773{
1774 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1775 DWORD len, len1, wlen, alen;
1776 LPITEMIDLIST pidl;
1777 PIDLTYPE type;
1778
1779 if (!wfd)
1780 return NULL;
1781
1782 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1783
1784 /* prepare buffer with both names */
1785 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1786 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1787 alen = len + len1;
1788
1789 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1790
1791 wlen = lstrlenW(wfd->cFileName) + 1;
1792 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1793 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1794 if (pidl)
1795 {
1797 FileStruct *fs = &pData->u.file;
1798 FileStructW *fsw;
1799 WORD *pOffsetW;
1800
1801 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1802 fs->dwFileSize = wfd->nFileSizeLow;
1803 fs->uFileAttribs = wfd->dwFileAttributes;
1804 memcpy(fs->szNames, buff, alen);
1805
1806 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1807 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1808 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1809 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1810 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1811
1812 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1813 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1814 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1815 }
1816 return pidl;
1817
1818}
#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:108
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 1820 of file pidl.c.

1821{
1822 HANDLE hFile;
1823 WIN32_FIND_DATAW stffile;
1824
1825 if (!ppidl)
1826 return E_INVALIDARG;
1827
1828 hFile = FindFirstFileW(szPath, &stffile);
1831
1833
1834 *ppidl = _ILCreateFromFindDataW(&stffile);
1835
1836 return *ppidl ? S_OK : E_OUTOFMEMORY;
1837}
#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:1772
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by CFSFolder::SetNameOf().

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1718 of file pidl.c.

1719{
1720 LPITEMIDLIST pidlOut;
1721
1722 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1723 {
1724 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1725 if (pidlOut)
1726 {
1728
1729 pData->u.guid.guid = *guid;
1730 TRACE("-- create GUID-pidl %s\n",
1731 debugstr_guid(&(pData->u.guid.guid)));
1732 }
1733 }
1734 else
1735 {
1736 WARN("%d: invalid type for GUID\n", type);
1737 pidlOut = NULL;
1738 }
1739 return pidlOut;
1740}
#define WARN(fmt,...)
Definition: debug.h:115
#define PT_YAGUID
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1743 of file pidl.c.

1744{
1745 IID iid;
1746
1747 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1748 {
1749 ERR("%s is not a GUID\n", szGUID);
1750 return NULL;
1751 }
1752 return _ILCreateGuid(PT_GUID, &iid);
1753}
#define ERR(fmt,...)
Definition: debug.h:113
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 1756 of file pidl.c.

1757{
1758 IID iid;
1759
1760#ifndef __REACTOS__
1761 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1762#else
1763 if (!GUIDFromStringW(szGUID, &iid))
1764#endif
1765 {
1766 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1767 return NULL;
1768 }
1769 return _ILCreateGuid(PT_GUID, &iid);
1770}
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)

Referenced by CDesktopFolderEnum::AddItemsFromClassicStartMenuKey(), and CRegFolderEnum::AddItemsFromKey().

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1656 of file pidl.c.

1657{
1658 TRACE("()\n");
1659 return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1660}

Referenced by CDesktopFolderEnum::Initialize(), and SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1650 of file pidl.c.

1651{
1652 TRACE("()\n");
1653 return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1654}

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

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1700 of file pidl.c.

1701{
1702 TRACE("()\n");
1703 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1704}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1681 of file pidl.c.

1682{
1683 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1684
1685 TRACE("()\n");
1686 if (parent)
1687 {
1688 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1689
1690 if (printers)
1691 {
1692 ret = ILCombine(parent, printers);
1693 SHFree(printers);
1694 }
1695 SHFree(parent);
1696 }
1697 return ret;
1698}

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2677 of file pidl.c.

2678{
2679 UINT i;
2680
2681 if (apidl)
2682 {
2683 for (i = 0; i < cidl; i++)
2684 SHFree(apidl[i]);
2685 SHFree(apidl);
2686 }
2687}

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

◆ _ILGetDataPointer()

◆ _ILGetDrive()

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

Definition at line 1886 of file pidl.c.

1887{
1888 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1889
1890 if(_ILIsMyComputer(pidl))
1891 pidl = ILGetNext(pidl);
1892
1893 if (pidl && _ILIsDrive(pidl))
1894 return _ILSimpleGetText(pidl, pOut, uSize);
1895
1896 return 0;
1897}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1962
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2066
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1995

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2518 of file pidl.c.

2519{
2520 char szTemp[MAX_PATH];
2521 const char * pPoint;
2522 LPCITEMIDLIST pidlTemp=pidl;
2523
2524 TRACE("pidl=%p\n",pidl);
2525
2526 if (!pidl)
2527 return FALSE;
2528
2529 pidlTemp = ILFindLastID(pidl);
2530
2531 if (!_ILIsValue(pidlTemp))
2532 return FALSE;
2533 if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2534 return FALSE;
2535
2536 pPoint = PathFindExtensionA(szTemp);
2537
2538 if (!*pPoint)
2539 return FALSE;
2540
2541 pPoint++;
2542 lstrcpynA(pOut, pPoint, uOutSize);
2543 TRACE("%s\n",pOut);
2544
2545 return TRUE;
2546}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynA
Definition: compat.h:751
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:422
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2016

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

◆ _ILGetFileAttributes()

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

Definition at line 2637 of file pidl.c.

2638{
2640 WORD wAttrib = 0;
2641 int i;
2642
2643 if (!pData)
2644 return 0;
2645
2646 switch(pData->type)
2647 {
2648 case PT_FOLDER:
2649 case PT_VALUE:
2650 wAttrib = pData->u.file.uFileAttribs;
2651 break;
2652 }
2653
2654 if(uOutSize >= 6)
2655 {
2656 i=0;
2657 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2658 pOut[i++] = 'R';
2659 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2660 pOut[i++] = 'H';
2661 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2662 pOut[i++] = 'S';
2663 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2664 pOut[i++] = 'A';
2665 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2666 pOut[i++] = 'C';
2667 pOut[i] = 0x00;
2668 }
2669 return wAttrib;
2670}
#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

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

◆ _ILGetFileDate()

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

Definition at line 2453 of file pidl.c.

2454{
2455 FILETIME ft,lft;
2457 BOOL ret;
2458
2459 if (_ILGetFileDateTime( pidl, &ft ))
2460 {
2461 FileTimeToLocalFileTime(&ft, &lft);
2462 FileTimeToSystemTime (&lft, &time);
2463
2465 if (ret)
2466 {
2467 /* Append space + time without seconds */
2468 pOut[ret-1] = ' ';
2470 }
2471 }
2472 else
2473 {
2474 pOut[0] = '\0';
2475 ret = FALSE;
2476 }
2477 return ret;
2478}
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 GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1044
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:936
__u16 time
Definition: mkdosfs.c:8
#define LOCALE_USER_DEFAULT
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2434
#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 2434 of file pidl.c.

2435{
2437
2438 if (!pdata)
2439 return FALSE;
2440
2441 switch (pdata->type)
2442 {
2443 case PT_FOLDER:
2444 case PT_VALUE:
2445 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2446 break;
2447 default:
2448 return FALSE;
2449 }
2450 return TRUE;
2451}
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,
LPSTR  pOut,
UINT  uOutSize 
)

Definition at line 2497 of file pidl.c.

2498{
2500 DWORD dwSize;
2501
2502 if (!pdata)
2503 return 0;
2504
2505 switch (pdata->type)
2506 {
2507 case PT_VALUE:
2508 dwSize = pdata->u.file.dwFileSize;
2509 if (pOut)
2510 StrFormatKBSizeA(dwSize, pOut, uOutSize);
2511 return dwSize;
2512 }
2513 if (pOut)
2514 *pOut = 0x00;
2515 return 0;
2516}
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:1735
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 2392 of file pidl.c.

2392 {
2393 FileStructW *pFileStructW;
2394 WORD cbOffset;
2395
2396 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2397 return NULL;
2398
2399 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2400 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2401
2402 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2403 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2404 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2405 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2406 /* FileStructW is positioned after FileStruct */
2407 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2408 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2409 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2410 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2411 {
2412 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2413 return NULL;
2414 }
2415
2416 return pFileStructW;
2417}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2007
struct tagFileStruct FileStruct

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

◆ _ILGetFileType()

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

Definition at line 2564 of file pidl.c.

2565{
2566#ifdef __REACTOS__ /* r32966 */
2567 char sType[64];
2568#endif
2569
2570 if(_ILIsValue(pidl))
2571 {
2572 char sTemp[64];
2573
2574 if(uOutSize > 0)
2575 pOut[0] = 0;
2576#ifdef __REACTOS__ /* r32966 */
2577 if (_ILGetExtension (pidl, sType, 64))
2578 {
2579 if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
2580 {
2581 /* retrieve description */
2582 if(HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE ))
2583 return;
2584 }
2585 /* display Ext-file as description */
2586 _strupr(sType);
2587 /* load localized file string */
2588 sTemp[0] = '\0';
2590 {
2591 sTemp[63] = '\0';
2592 StringCchPrintfA(pOut, uOutSize, sTemp, sType);
2593 }
2594 }
2595#else
2596 if (_ILGetExtension (pidl, sTemp, 64))
2597 {
2598 if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
2599 && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
2600 {
2601 lstrcpynA (pOut, sTemp, uOutSize - 6);
2602 strcat (pOut, "-file");
2603 }
2604 }
2605#endif
2606 }
2607 else
2608#ifdef __REACTOS__ /* r32966 */
2609 {
2610 pOut[0] = '\0';
2612 /* make sure its null terminated */
2613 pOut[uOutSize-1] = '\0';
2614 }
2615#else
2616 lstrcpynA(pOut, "Folder", uOutSize);
2617#endif
2618}
#define shell32_hInstance
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2518
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:91
#define IDS_DIRECTORY
Definition: shresdef.h:157
#define IDS_ANY_FILE
Definition: shresdef.h:183
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)

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

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2356 of file pidl.c.

2357{
2359
2360 TRACE("%p\n", pidl);
2361
2362 if (!pdata)
2363 return NULL;
2364
2365 TRACE("pdata->type 0x%04x\n", pdata->type);
2366 switch (pdata->type)
2367 {
2368 case PT_SHELLEXT:
2369 case PT_GUID:
2370 case PT_YAGUID:
2371 return &(pdata->u.guid.guid);
2372
2373 default:
2374 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2375 break;
2376 }
2377 return NULL;
2378}

Referenced by _ILHACKCompareSimpleIds(), _ILIsBitBucket(), _ILIsControlPanel(), _ILIsMyComputer(), _ILIsMyDocuments(), _ILIsNetHood(), _ILSimpleGetText(), _ILSimpleGetTextW(), CRegFolder::_IsInNameSpace(), CRegFolder::BindToObject(), CGuidItemContextMenu_CreateInstance(), CGuidItemExtractIcon_CreateInstance(), CRegFolder::CompareIDs(), CRegFolder::GetDetailsOf(), CRegFolder::GetDisplayNameOf(), CRegFolder::GetUIObjectOf(), CEnumIDListBase::HasItemWithCLSID(), HCR_GetFolderAttributes(), IsNamespaceExtensionHidden(), and CRegFolder::SetNameOf().

◆ _ILGetSTextPointer()

static LPSTR _ILGetSTextPointer ( LPCITEMIDLIST  pidl)
static

Definition at line 2328 of file pidl.c.

2329{
2330 /* TRACE(pidl,"(pidl%p)\n", pidl); */
2331
2333
2334 if (!pdata)
2335 return NULL;
2336
2337 switch (pdata->type)
2338 {
2339 case PT_FOLDER:
2340 case PT_VALUE:
2341 case PT_IESPECIAL1:
2342 case PT_IESPECIAL2:
2343 return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
2344
2345 case PT_WORKGRP:
2346 return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
2347 }
2348 return NULL;
2349}
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 2285 of file pidl.c.

2286{
2287 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2288
2290
2291 if (!pdata)
2292 return NULL;
2293
2294 switch (pdata->type)
2295 {
2296 case PT_GUID:
2297 case PT_SHELLEXT:
2298 case PT_YAGUID:
2299 return NULL;
2300
2301 case PT_DRIVE:
2302 case PT_DRIVE1:
2303 case PT_DRIVE2:
2304 case PT_DRIVE3:
2305 return pdata->u.drive.szDriveName;
2306
2307 case PT_FOLDER:
2308 case PT_FOLDER1:
2309 case PT_VALUE:
2310 case PT_IESPECIAL1:
2311 case PT_IESPECIAL2:
2312 return pdata->u.file.szNames;
2313
2314 case PT_WORKGRP:
2315 case PT_COMP:
2316 case PT_NETWORK:
2317 case PT_NETPROVIDER:
2318 case PT_SHARE:
2319 return pdata->u.network.szNames;
2320 }
2321 return NULL;
2322}
#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(), _ILSimpleGetText(), _ILSimpleGetTextW(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetTextPointerW()

static LPWSTR _ILGetTextPointerW ( LPCITEMIDLIST  pidl)
static

Definition at line 2229 of file pidl.c.

2230{
2231 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2232
2234
2235 if (!pdata)
2236 return NULL;
2237
2238 switch (pdata->type)
2239 {
2240 case PT_GUID:
2241 case PT_SHELLEXT:
2242 case PT_YAGUID:
2243 return NULL;
2244
2245 case PT_DRIVE:
2246 case PT_DRIVE1:
2247 case PT_DRIVE2:
2248 case PT_DRIVE3:
2249 /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
2250 return NULL;
2251
2252 case PT_FOLDER:
2253 case PT_FOLDER1:
2254 case PT_VALUE:
2255 case PT_IESPECIAL1:
2256 case PT_IESPECIAL2:
2257 /*return (LPSTR)&(pdata->u.file.szNames);*/
2258 return NULL;
2259
2260 case PT_WORKGRP:
2261 case PT_COMP:
2262 case PT_NETWORK:
2263 case PT_NETPROVIDER:
2264 case PT_SHARE:
2265 /*return (LPSTR)&(pdata->u.network.szNames);*/
2266 return NULL;
2267
2268 case PT_VALUEW:
2269 return (LPWSTR)pdata->u.file.szNames;
2270
2271#ifdef __REACTOS__ /* r54423 */
2272 case PT_CPLAPPLET:
2273 return pdata->u.cpanel.szName;
2274#endif
2275
2276 }
2277 return NULL;
2278}
#define PT_VALUEW
Definition: pidl.h:96
#define PT_CPLAPPLET
Definition: pidl.h:86
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _ILSimpleGetText(), and _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(a, b, c)
Definition: kdvm.h:18
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2392
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2356
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1922

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

◆ _ILIsBitBucket()

BOOL _ILIsBitBucket ( LPCITEMIDLIST  pidl)

Definition at line 1973 of file pidl.c.

1974{
1975 IID *iid = _ILGetGUIDPointer(pidl);
1976
1977 TRACE("(%p)\n", pidl);
1978
1979 if (iid)
1980 return IsEqualIID(iid, &CLSID_RecycleBin);
1981 return FALSE;
1982}
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

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

◆ _ILIsControlPanel()

BOOL _ILIsControlPanel ( LPCITEMIDLIST  pidl)

Definition at line 1951 of file pidl.c.

1952{
1953 IID *iid = _ILGetGUIDPointer(pidl);
1954
1955 TRACE("(%p)\n", pidl);
1956
1957 if (iid)
1958 return IsEqualIID(iid, &CLSID_ControlPanel);
1959 return FALSE;
1960}

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

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2025 of file pidl.c.

2026{
2027 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2028
2029 TRACE("(%p)\n",pidl);
2030
2031 return (pidl && lpPData && (lpPData->type == 0));
2032}

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

◆ _ILIsDesktop()

BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 1922 of file pidl.c.

1923{
1924 TRACE("(%p)\n",pidl);
1925
1926 return !pidl || !pidl->mkid.cb;
1927}

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

◆ _ILIsDrive()

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1962 of file pidl.c.

1963{
1964 REFIID iid = _ILGetGUIDPointer(pidl);
1965
1966 TRACE("(%p)\n",pidl);
1967
1968 if (iid)
1969 return IsEqualIID(iid, &CLSID_MyComputer);
1970 return FALSE;
1971}
#define REFIID
Definition: guiddef.h:118

Referenced by _ILGetDrive(), BrsFolder_Treeview_Expand(), CRegFolder::CompareIDs(), CDesktopFolder::GetAttributesOf(), and RegFolderContextMenuCallback().

◆ _ILIsMyDocuments()

BOOL _ILIsMyDocuments ( LPCITEMIDLIST  pidl)

Definition at line 1929 of file pidl.c.

1930{
1931 IID *iid = _ILGetGUIDPointer(pidl);
1932
1933 TRACE("(%p)\n", pidl);
1934
1935 if (iid)
1936 return IsEqualIID(iid, &CLSID_MyDocuments);
1937 return FALSE;
1938}

◆ _ILIsNetHood()

BOOL _ILIsNetHood ( LPCITEMIDLIST  pidl)

Definition at line 1940 of file pidl.c.

1941{
1942 IID *iid = _ILGetGUIDPointer(pidl);
1943
1944 TRACE("(%p)\n", pidl);
1945
1946 if (iid)
1947 return IsEqualIID(iid, &CLSID_NetworkPlaces);
1948 return FALSE;
1949}

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 2037 of file pidl.c.

2038{
2039 BOOL ret = TRUE;
2040
2041 if(! _ILIsDesktop(pidl)) /* pidl=NULL or mkid.cb=0 */
2042 {
2043 WORD len = pidl->mkid.cb;
2044 LPCITEMIDLIST pidlnext = (LPCITEMIDLIST) (((const BYTE*)pidl) + len );
2045
2046 if (pidlnext->mkid.cb)
2047 ret = FALSE;
2048 }
2049
2050 TRACE("%s\n", ret ? "Yes" : "No");
2051 return ret;
2052}

Referenced by SHBindToParent().

◆ _ILIsSpecialFolder()

BOOL _ILIsSpecialFolder ( LPCITEMIDLIST  pidl)

Definition at line 1984 of file pidl.c.

1985{
1986 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1987
1988 TRACE("(%p)\n",pidl);
1989
1990 return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
1991 (pidl && pidl->mkid.cb == 0x00)
1992 ));
1993}

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1913 of file pidl.c.

1914{
1915 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1916
1917 TRACE("(%p)\n",pidl);
1918
1919 return (pidl && lpPData && PT_VALUEW == lpPData->type);
1920}

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

1045{
1046 LPSHELLFOLDER pSF = NULL;
1047 LPBC pBC = NULL;
1048 HRESULT ret;
1049
1050 TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
1051 ppidl, ppidl ? *ppidl : NULL,
1052 prgfInOut, prgfInOut ? *prgfInOut : 0);
1053
1054 ret = SHGetDesktopFolder(&pSF);
1055 if (FAILED(ret))
1056 return ret;
1057
1058 if (lpFindFile || bBindCtx)
1059 ret = IFileSystemBindData_Constructor(lpFindFile, &pBC);
1060
1061 if (SUCCEEDED(ret))
1062 {
1063 ret = IShellFolder_ParseDisplayName(pSF, 0, pBC, (LPOLESTR)path, NULL, ppidl, prgfInOut);
1064 }
1065
1066 if (pBC)
1067 {
1068 IBindCtx_Release(pBC);
1069 pBC = NULL;
1070 }
1071
1072 IShellFolder_Release(pSF);
1073
1074 if (FAILED(ret) && ppidl)
1075 *ppidl = NULL;
1076
1077 TRACE("%s %p 0x%x\n", debugstr_w(path), ppidl ? *ppidl : NULL, prgfInOut ? *prgfInOut : 0);
1078
1079 return ret;
1080}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
#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().

◆ _ILSimpleGetText()

DWORD _ILSimpleGetText ( LPCITEMIDLIST  pidl,
LPSTR  szOut,
UINT  uOutSize 
)

Definition at line 2066 of file pidl.c.

2067{
2068 DWORD dwReturn=0;
2069 LPSTR szSrc;
2070 LPWSTR szSrcW;
2071 GUID const * riid;
2072 char szTemp[MAX_PATH];
2073
2074 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2075
2076 if (!pidl)
2077 return 0;
2078
2079 if (szOut)
2080 *szOut = 0;
2081
2082 if (_ILIsDesktop(pidl))
2083 {
2084 /* desktop */
2085 if (HCR_GetClassNameA(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2086 {
2087 if (szOut)
2088 lstrcpynA(szOut, szTemp, uOutSize);
2089
2090 dwReturn = strlen (szTemp);
2091 }
2092 }
2093 else if (( szSrc = _ILGetTextPointer(pidl) ))
2094 {
2095 /* filesystem */
2096 if (szOut)
2097 lstrcpynA(szOut, szSrc, uOutSize);
2098
2099 dwReturn = strlen(szSrc);
2100 }
2101 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2102 {
2103 /* unicode filesystem */
2104 WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
2105
2106 if (szOut)
2107 lstrcpynA(szOut, szTemp, uOutSize);
2108
2109 dwReturn = strlen (szTemp);
2110 }
2111 else if (( riid = _ILGetGUIDPointer(pidl) ))
2112 {
2113 /* special folder */
2114 if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
2115 {
2116 if (szOut)
2117 lstrcpynA(szOut, szTemp, uOutSize);
2118
2119 dwReturn = strlen (szTemp);
2120 }
2121 }
2122 else
2123 {
2124 ERR("-- no text\n");
2125 }
2126
2127 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
2128 return dwReturn;
2129}
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:474

Referenced by _ILGetDrive(), and _ILGetExtension().

◆ _ILSimpleGetTextW()

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

Definition at line 2138 of file pidl.c.

2139{
2140 DWORD dwReturn;
2141 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2142
2143 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2144
2145 if (pFileStructW) {
2146 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2147 dwReturn = lstrlenW(pFileStructW->wszName);
2148 } else {
2149 GUID const * riid;
2150 WCHAR szTemp[MAX_PATH];
2151 LPSTR szSrc;
2152 LPWSTR szSrcW;
2153 dwReturn=0;
2154
2155 if (!pidl)
2156 return 0;
2157
2158 if (szOut)
2159 *szOut = 0;
2160
2161 if (_ILIsDesktop(pidl))
2162 {
2163 /* desktop */
2164 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2165 {
2166 if (szOut)
2167 lstrcpynW(szOut, szTemp, uOutSize);
2168
2169 dwReturn = lstrlenW (szTemp);
2170 }
2171 }
2172 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2173 {
2174 /* unicode filesystem */
2175 if (szOut)
2176 lstrcpynW(szOut, szSrcW, uOutSize);
2177
2178 dwReturn = lstrlenW(szSrcW);
2179 }
2180 else if (( szSrc = _ILGetTextPointer(pidl) ))
2181 {
2182 /* filesystem */
2183 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, MAX_PATH);
2184
2185 if (szOut)
2186 lstrcpynW(szOut, szTemp, uOutSize);
2187
2188 dwReturn = lstrlenW (szTemp);
2189 }
2190 else if (( riid = _ILGetGUIDPointer(pidl) ))
2191 {
2192 /* special folder */
2193 if ( HCR_GetClassNameW(riid, szTemp, MAX_PATH) )
2194 {
2195 if (szOut)
2196 lstrcpynW(szOut, szTemp, uOutSize);
2197
2198 dwReturn = lstrlenW (szTemp);
2199 }
2200 }
2201 else
2202 {
2203 ERR("-- no text\n");
2204 }
2205 }
2206
2207 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2208 return dwReturn;
2209}
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:399

Referenced by CDesktopFolder::_GetSFFromPidl(), 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 313 of file utils.cpp.

314{
315 HWND hWnd = NULL;
316
318 if (pBindCtx && SUCCEEDED(pBindCtx->GetObjectParam((LPWSTR)L"UI During Binding", &punk)))
319 IUnknown_GetWindow(punk, &hWnd);
320
321 return hWnd;
322}
HWND hWnd
Definition: settings.c:17
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1332
#define L(x)
Definition: ntvdm.h:50

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 373 of file utils.cpp.

378{
379 HRESULT hr = S_OK;
381
382 *ppbc = pBindCtx;
383
384 if (pBindCtx)
385 {
386 pBindCtx->AddRef();
387 }
388 else
389 {
390 hr = CreateBindCtx(0, ppbc);
391 if (FAILED(hr))
392 return hr;
393 }
394
395 if (!punk)
396 punk = pUnknown = new CDummyOleWindow();
397
398 hr = (*ppbc)->RegisterObjectParam(pszKey, punk);
399
400 if (pUnknown)
401 pUnknown->Release();
402
403 if (FAILED(hr))
404 {
405 (*ppbc)->Release();
406 *ppbc = NULL;
407 }
408
409 return hr;
410}
_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 116 of file comctl32undoc.c.

117{
118 return !LocalFree( lpMem );
119}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

◆ ILAppendID()

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

Definition at line 898 of file pidl.c.

899{
900 LPITEMIDLIST idlRet;
902
903 WARN("(pidl=%p,pidl=%p,%08u)semi-stub\n",pidl,item,bEnd);
904
905 pdump (pidl);
906 pdump (itemid);
907
908 if (_ILIsDesktop(pidl))
909 {
910 idlRet = ILClone(itemid);
911 SHFree (pidl);
912 return idlRet;
913 }
914
915 if (bEnd)
916 idlRet = ILCombine(pidl, itemid);
917 else
918 idlRet = ILCombine(itemid, pidl);
919
920 SHFree(pidl);
921 return idlRet;
922}
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(), CDesktopBrowser::BrowseObject(), CShellBrowser::BrowseToPath(), BrsFolder_OnCommand(), BrsFolder_Treeview_Changed(), 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(), CShellBrowser::GetPidl(), CTravelEntry::GetPidl(), GetPidlFromDataObject(), CMenuSFToolbar::GetShellFolder(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), CShellBrowser::GetWindowData(), ILAppendID(), ILCombine(), ILIsParentOrSpecialParent(), CViewStatePropertyBag::Init(), init_function_pointers(), CDefaultContextMenu::Initialize(), CRegFolder::Initialize(), CFolderItem::Initialize(), CFontExt::Initialize(), CRecycleBinItemContextMenu::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(), CCopyMoveToMenu::Initialize(), CNewMenu::Initialize(), CFSFolder::InitializeEx(), CISFBand::InitializeSFB(), InitializeTreeView(), CExplorerBand::InsertItem(), InsertTreeViewItem(), 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(), CExplorerBand::RenameItem(), CShellItem::SetIDList(), CRegFolder::SetNameOf(), CMenuSFToolbar::SetShellFolder(), CShellLink::SetTargetFromPIDLOrPath(), SHBindToFolderIDListParent(), SHBindToParent(), SHCloneIETHREADPARAM(), SHCreateFromDesktop(), SHCreateShellItem(), SHGetFileInfoW(), test_AttributesRegistration(), and CExplorerBand::UpdateBrowser().

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

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

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

◆ ILCreateFromPathA()

LPITEMIDLIST WINAPI ILCreateFromPathA ( LPCSTR  path)

Definition at line 979 of file pidl.c.

980{
981 LPITEMIDLIST pidlnew = NULL;
982
983 TRACE_(shell)("%s\n", debugstr_a(path));
984
985 if (SUCCEEDED(SHILCreateFromPathA(path, &pidlnew, NULL)))
986 return pidlnew;
987 return NULL;
988}
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 1009 of file pidl.c.

1010{
1011 if ( SHELL_OsIsUnicode())
1012 return ILCreateFromPathW (path);
1013 return ILCreateFromPathA (path);
1014}
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:995
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path)
Definition: pidl.c:979
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:140

◆ ILCreateFromPathW()

◆ ILFindChild()

PUIDLIST_RELATIVE WINAPI ILFindChild ( PIDLIST_ABSOLUTE  pidl1,
PCIDLIST_ABSOLUTE  pidl2 
)

Definition at line 654 of file pidl.c.

655{
656 LPCITEMIDLIST pidltemp1 = pidl1;
657 LPCITEMIDLIST pidltemp2 = pidl2;
659
660 TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
661
662 /* explorer reads from registry directly (StreamMRU),
663 so we can only check here */
664 if ((!pcheck (pidl1)) || (!pcheck (pidl2)))
665 return FALSE;
666
667 pdump (pidl1);
668 pdump (pidl2);
669
670 if (_ILIsDesktop(pidl1))
671 {
672 ret = pidl2;
673 }
674 else
675 {
676 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
677 {
678 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
679 return FALSE;
680
681 pidltemp1 = ILGetNext(pidltemp1);
682 pidltemp2 = ILGetNext(pidltemp2);
683 ret = pidltemp2;
684 }
685
686 if (pidltemp1->mkid.cb)
687 ret = NULL; /* elements of pidl1 left*/
688 }
689 TRACE_(shell)("--- %p\n", ret);
690 return (PUIDLIST_RELATIVE)ret; /* pidl 1 is shorter */
691}
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 init_function_pointers(), ShellBrowser::jump_to(), and CExplorerBand::NavigateToPIDL().

◆ ILFindLastID()

◆ ILFree()

void WINAPI ILFree ( LPITEMIDLIST  pidl)

Definition at line 938 of file pidl.c.

939{
940 TRACE("(pidl=%p)\n",pidl);
941 SHFree(pidl);
942}

Referenced by CMenuBand::_CallCB(), CFSDropTarget::_DoDrop(), CMruNode::_GetPidlSlot(), CFSFolder::_ParseSimple(), _ReparsePIDL(), _tmain(), CEnumMergedFolder::Begin(), CCommonFolder< TSelf, TItemId, TExtractIcon >::BindToObject(), BrowseSelectedFolder(), CShellBrowser::BrowseToPath(), BrsFolder_OnSetExpanded(), BrsFolder_Treeview_Changed(), 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(), GetNormalAndSelectedIcons(), CMenuCallback::GetObject(), CShellItem::GetParent(), GetParsingName(), CShellBrowser::GetPropertyBag(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), ICommDlgBrowser3_fnIncludeObject(), IEGetNameAndFlagsEx(), ILIsParentOrSpecialParent(), CExplorerBand::InitializeExplorerBand(), InitializeTreeView(), CExplorerBand::InsertSubitems(), CAddressEditBox::Invoke(), CDefaultContextMenu::InvokePidl(), IShellBrowserImpl_BrowseObject(), IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(), CShellBrowser::LoadHistory(), MRUList_PidlList_0(), CShellBrowser::NavigateToParent(), on_default_action(), CMenuSFToolbar::OnDeletingButton(), CShellBrowser::OnDestroy(), CDefView::OnNotify(), CShellBrowser::OnOrganizeFavorites(), CExplorerBand::OnShellEvent(), CExplorerBand::OnTreeItemDeleted(), CAddressEditBox::OnWinEvent(), CExplorerBand::OnWinEvent(), CDesktopFolder::ParseDisplayName(), CRegFolder::ParseDisplayName(), CCommonFolder< TSelf, TItemId, TExtractIcon >::ParseDisplayName(), CAddressEditBox::ParseNow(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), CExplorerBand::RefreshTreePidl(), CExplorerBand::RenameItem(), 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(), SHOpenNewFrame(), 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(), CExplorerBand::UpdateBrowser(), CAddressEditBox::~CAddressEditBox(), CCommonFolder< TSelf, TItemId, TExtractIcon >::~CCommonFolder(), CExplorerBand::~CExplorerBand(), CMergedFolder::~CMergedFolder(), CNewMenu::~CNewMenu(), CNtObjectFolderExtractIcon::~CNtObjectFolderExtractIcon(), CRecycleBinItemContextMenu::~CRecycleBinItemContextMenu(), CRegistryFolderExtractIcon::~CRegistryFolderExtractIcon(), 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:70

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: debug.h:114
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
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:1348
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:71
#define ILGDN_INFOLDER
Definition: undocshell.h:72

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

829{
830 LPCSHITEMID si;
831 UINT len=0;
832
833 if (pidl)
834 {
835 si = &(pidl->mkid);
836
837 while (si->cb)
838 {
839 len += si->cb;
840 si = (LPCSHITEMID)(((const BYTE*)si)+si->cb);
841 }
842 len += 2;
843 }
844 TRACE("pidl=%p size=%u\n",pidl, len);
845 return len;
846}
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 958 of file pidl.c.

959{
960 TRACE("%p\n", pidl);
961
962 Free(pidl);
963}
_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 return FALSE;
561
562 pdump (pidl1);
563 pdump (pidl2);
564
565 if (!pidl1 || !pidl2)
566 return FALSE;
567
568 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
569 {
570 if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
571 return FALSE;
572
573 pidltemp1 = ILGetNext(pidltemp1);
574 pidltemp2 = ILGetNext(pidltemp2);
575 }
576
577 if (!pidltemp1->mkid.cb && !pidltemp2->mkid.cb)
578 return TRUE;
579
580 return FALSE;
581}

Referenced by CViewStatePropertyBag::_IsSamePidl(), BrowseCallbackProc(), DoGetAliasPIDLs(), FILEDLG95_LOOKIN_Init(), FILEDLG95_LOOKIN_SearchItem(), FILEDLG95_OnOpen(), CAddressEditBox::FillOneLevel(), 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 605 of file pidl.c.

606{
607 LPCITEMIDLIST pParent = pidlParent;
608 LPCITEMIDLIST pChild = pidlChild;
609
610 TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate);
611
612 if (!pParent || !pChild)
613 return FALSE;
614
615 while (pParent->mkid.cb && pChild->mkid.cb)
616 {
617 if (!_ILHACKCompareSimpleIds(pParent, pChild))
618 return FALSE;
619
621 pChild = ILGetNext(pChild);
622 }
623
624 /* child has shorter name than parent */
625 if (pParent->mkid.cb)
626 return FALSE;
627
628 /* not immediate descent */
629 if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
630 return FALSE;
631
632 return TRUE;
633}
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 1348 of file pidl.c.

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

Referenced by CViewStatePropertyBag::_IsSystemFolder(), _ReparsePIDL(), CAddressEditBox::AddComboBoxItem(), CShellBrowser::BrowseToPath(), CreateIDataObject(), Entry::do_context_menu(), CCopyAsPathMenu::DoCopyAsPath(), CShellLink::DragEnter(), CExplorerBand::DragOver(), CAddressEditBox::Execute(), CFolderItem::get_Name(), CFSFolder::GetAttributesOf(), GetDisplayName(), CSendToMenu::GetUIObjectFromPidl(), CCommonFolder< TSelf, TItemId, TExtractIcon >::GetUIObjectOf(), GetUIObjectOfAbsolute(), GetUIObjectOfAbsPidl(), ILGetDisplayNameExW(), CFolderItemVerbs::Init(), Initialize(), InitializeShellFolder_(), CExplorerBand::InsertItem(), CExplorerBand::OnContextMenu(), CShellMenuCallback::OnGetContextMenu(), CExplorerBand::OnTreeItemDragging(), CExplorerBand::OnWinEvent(), r_verify_pidl(), CAddressEditBox::RefreshAddress(), RSHELL_CStartMenu_CreateInstance(), SHELL_execute(), 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:3225
#define CSIDL_FLAG_CREATE
_In_ int nFolder
Definition: shlobj.h:1511

Referenced by CStartMenuBtnCtxMenu::QueryContextMenu().

◆ SHGetDataFromIDListA()

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

Definition at line 1150 of file pidl.c.

1152{
1153 LPSTR filename, shortname;
1155
1156 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1157
1158 pdump(pidl);
1159 if (!psf || !dest)
1160 return E_INVALIDARG;
1161
1162 switch (nFormat)
1163 {
1164 case SHGDFIL_FINDDATA:
1165 pfd = dest;
1166
1167 if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
1168 return E_INVALIDARG;
1169
1170 if (len < sizeof(WIN32_FIND_DATAA))
1171 return E_INVALIDARG;
1172
1173 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
1174 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1175 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1176 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1177
1179 shortname = _ILGetSTextPointer(pidl);
1180
1181 if (filename)
1182 lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
1183 else
1184 pfd->cFileName[0] = '\0';
1185
1186 if (shortname)
1187 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
1188 else
1189 pfd->cAlternateFileName[0] = '\0';
1190 return S_OK;
1191
1194 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1195 break;
1196
1197 default:
1198 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1199 }
1200
1201 return E_INVALIDARG;
1202}
#define FIXME_(x)
Definition: compat.h:77
const char * filename
Definition: ioapi.h:137
static char * dest
Definition: rtl.c:135
static LPSTR _ILGetSTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2328
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2637
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2497
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1984
#define ERR_(ch,...)
Definition: debug.h:156
#define SHGDFIL_FINDDATA
Definition: shlobj.h:1444
#define SHGDFIL_NETRESOURCE
Definition: shlobj.h:1445
#define SHGDFIL_DESCRIPTIONID
Definition: shlobj.h:1446
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67

◆ SHGetDataFromIDListW()

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

Definition at line 1208 of file pidl.c.

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

Referenced by CViewStatePropertyBag::_IsSystemFolder().

◆ SHGetIDListFromObject()

HRESULT WINAPI SHGetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 1517 of file pidl.c.

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

◆ SHGetNameFromIDList()

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

Definition at line 1454 of file pidl.c.

1455{
1456 IShellFolder *psfparent;
1457 LPCITEMIDLIST child_pidl;
1458 STRRET disp_name;
1459 HRESULT ret;
1460
1461 TRACE("%p 0x%08x %p\n", pidl, sigdnName, ppszName);
1462
1463 *ppszName = NULL;
1464 ret = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psfparent, &child_pidl);
1465 if(SUCCEEDED(ret))
1466 {
1467 switch(sigdnName)
1468 {
1469 /* sigdnName & 0xffff */
1470 case SIGDN_NORMALDISPLAY: /* SHGDN_NORMAL */
1471 case SIGDN_PARENTRELATIVEPARSING: /* SHGDN_INFOLDER | SHGDN_FORPARSING */
1472 case SIGDN_PARENTRELATIVEEDITING: /* SHGDN_INFOLDER | SHGDN_FOREDITING */
1473 case SIGDN_DESKTOPABSOLUTEPARSING: /* SHGDN_FORPARSING */
1474 case SIGDN_DESKTOPABSOLUTEEDITING: /* SHGDN_FOREDITING | SHGDN_FORADDRESSBAR*/
1475 case SIGDN_PARENTRELATIVEFORADDRESSBAR: /* SIGDN_INFOLDER | SHGDN_FORADDRESSBAR */
1476 case SIGDN_PARENTRELATIVE: /* SIGDN_INFOLDER */
1477
1478 disp_name.uType = STRRET_WSTR;
1479 ret = IShellFolder_GetDisplayNameOf(psfparent, child_pidl,
1480 sigdnName & 0xffff,
1481 &disp_name);
1482 if(SUCCEEDED(ret))
1483 ret = StrRetToStrW(&disp_name, pidl, ppszName);
1484
1485 break;
1486
1487 case SIGDN_FILESYSPATH:
1489 if(SHGetPathFromIDListW(pidl, *ppszName))
1490 {
1491 TRACE("Got string %s\n", debugstr_w(*ppszName));
1492 ret = S_OK;
1493 }
1494 else
1495 {
1497 ret = E_INVALIDARG;
1498 }
1499 break;
1500
1501 case SIGDN_URL:
1502 default:
1503 FIXME("Unsupported SIGDN %x\n", sigdnName);
1504 ret = E_FAIL;
1505 }
1506
1507 IShellFolder_Release(psfparent);
1508 }
1509 return ret;
1510}
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:1340
SIGDN PWSTR * ppszName
Definition: shobjidl.idl:601
SIGDN sigdnName
Definition: shobjidl.idl:601
@ STRRET_WSTR
Definition: shtypes.idl:85
UINT uType
Definition: shtypes.idl:93

Referenced by _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 1295 of file pidl.c.

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

Referenced by SHGetPathFromIDListW().

◆ SHGetPathFromIDListA()

BOOL WINAPI SHGetPathFromIDListA ( LPCITEMIDLIST  pidl,
LPSTR  pszPath 
)

Definition at line 1278 of file pidl.c.

1279{
1280 WCHAR wszPath[MAX_PATH];
1281 BOOL bSuccess;
1282
1283 bSuccess = SHGetPathFromIDListW(pidl, wszPath);
1284 WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL);
1285
1286 return bSuccess;
1287}
static BOOLEAN bSuccess
Definition: drive.cpp:433

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

1341{
1342 return SUCCEEDED(SHGetPathCchFromIDListW(pidl, pszPath, MAX_PATH));
1343}
HRESULT WINAPI SHGetPathCchFromIDListW(_In_ LPCITEMIDLIST pidl, _Out_writes_(cchPathMax) LPWSTR pszPath, _In_ SIZE_T cchPathMax)
Definition: pidl.c:1295

Referenced by BtrfsSend::AddClone(), BrowseCallbackProc(), BtrfsSend::BrowseParent(), BrsFolder_NewFolder(), BrsFolder_OnCommand(), BrsFolder_Treeview_Rename(), ChooseFolder(), CHSourceDlgProc(), CreateDirectoryWatcherFromRegEntry(), CNewMenu::CreateNewFolder(), CNewMenu::CreateNewItem(), CCopyMoveToMenu::DoAction(), CDefaultContextMenu::DoCreateNewFolder(), DoGetFileTitle(), DoInitAliasPIDLs(), CCopyMoveToMenu::DoRealFileOp(), DoTestEntry(), DoUpdateAutoCompleteWithCWD(), CFontExt::Drop(), CMyDocsDropHandler::Drop(), CDeskLinkDropHandler::Drop(), CAddressEditBox::ExecuteCommandLine(), CACListISF::Expand(), FileExtractDialogWndProc(), CSearchBar::GetAddressEditBoxPath(), CFSFolder::GetCustomViewInfo(), GetIconOverlay(), CShellLink::GetPath(), ILIsParentOrSpecialParent(), CFontExt::Initialize(), CZipFolder::Initialize(), CFSFolder::Initialize(), BtrfsContextMenu::Initialize(), COpenWithMenu::Initialize(), CFSFolder::InitializeEx(), CDefaultContextMenu::InvokePidl(), IsPidlPrograms(), LoadRdpSettingsFromFile(), CShellBrowser::OnAddToFavorites(), CZipExtract::CExtractSettingsPage::OnBrowse(), CDefView::OnChangeNotify(), 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 755 of file pidl.c.

756{
757 IDataObject* pDataObj;
758 HRESULT hr;
759
760 hr = IShellFolder_GetUIObjectOf(lpsf, 0, 1, &pidlSimple,
761 &IID_IDataObject, 0, (LPVOID*)&pDataObj);
762 if (SUCCEEDED(hr))
763 {
764 STGMEDIUM medium;
765 FORMATETC fmt;
766
768 fmt.ptd = NULL;
769 fmt.dwAspect = DVASPECT_CONTENT;
770 fmt.lindex = -1;
771 fmt.tymed = TYMED_HGLOBAL;
772
773 hr = IDataObject_GetData(pDataObj, &fmt, &medium);
774
775 IDataObject_Release(pDataObj);
776
777 if (SUCCEEDED(hr))
778 {
779 /*assert(pida->cidl==1);*/
780 LPIDA pida = GlobalLock(medium.u.hGlobal);
781
782 LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
783 LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
784
785 *pidlReal = ILCombine(pidl_folder, pidl_child);
786
787 if (!*pidlReal)
789
790 GlobalUnlock(medium.u.hGlobal);
791 GlobalFree(medium.u.hGlobal);
792 }
793 }
794
795 return hr;
796}
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:499
Definition: shlobj.h:565
UINT aoffset[1]
Definition: shlobj.h:566
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 805 of file pidl.c.

806{
807 FIXME("(pidl=%p)\n",pidl);
808
809 pdump(pidl);
810
811 return 0;
812}

◆ SHParseDisplayName()

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

Definition at line 1392 of file pidl.c.

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

1103{
1104 LPITEMIDLIST pidl = NULL;
1105 LPWSTR wPath = NULL;
1106 int len;
1107
1108 TRACE("%s\n", debugstr_a(lpszPath));
1109
1110 if (lpszPath)
1111 {
1112 len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0);
1113 wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1114 MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len);
1115 }
1116
1117 _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
1118
1119 HeapFree(GetProcessHeap(), 0, wPath);
1120 TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
1121 return pidl;
1122}
#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:1043

Referenced by SHSimpleIDListFromPathAW().

◆ SHSimpleIDListFromPathAW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW ( LPCVOID  lpszPath)

Definition at line 1136 of file pidl.c.

1137{
1138 if ( SHELL_OsIsUnicode())
1139 return SHSimpleIDListFromPathW (lpszPath);
1140 return SHSimpleIDListFromPathA (lpszPath);
1141}
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
Definition: pidl.c:1102
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1124

◆ SHSimpleIDListFromPathW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathW ( LPCWSTR  lpszPath)

Definition at line 1124 of file pidl.c.

1125{
1126 LPITEMIDLIST pidl = NULL;
1127
1128 TRACE("%s\n", debugstr_w(lpszPath));
1129
1130 _ILParsePathW(lpszPath, NULL, TRUE, &pidl, NULL);
1131
1132 TRACE("%s %p\n", debugstr_w(lpszPath), pidl);
1133 return pidl;
1134}

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

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( shell  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( pidl  )