ReactOS 0.4.15-dev-7958-gcd0bb1a
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 1620 of file pidl.c.

1621{
1622 LPITEMIDLIST pidlOut = NULL;
1623
1624 pidlOut = SHAlloc(size + 5);
1625 if(pidlOut)
1626 {
1628 LPITEMIDLIST pidlNext;
1629
1630 ZeroMemory(pidlOut, size + 5);
1631 pidlOut->mkid.cb = size + 3;
1632
1633 pData = _ILGetDataPointer(pidlOut);
1634 if (pData)
1635 pData->type = type;
1636
1637 pidlNext = ILGetNext(pidlOut);
1638 if (pidlNext)
1639 pidlNext->mkid.cb = 0x00;
1640 TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
1641 }
1642
1643 return pidlOut;
1644}
#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:2231
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 2707 of file pidl.c.

2708{
2709 UINT i;
2710 PITEMID_CHILD *apidldest;
2711
2712 if (!apidlsrc)
2713 return NULL;
2714
2715 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2716
2717 for (i = 0; i < cidl; i++)
2718 apidldest[i] = ILClone(apidlsrc[i]);
2719
2720 return apidldest;
2721}
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 2728 of file pidl.c.

2729{
2730 UINT i;
2732
2733 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2734 if (!dst)
2735 return NULL;
2736
2737 if (pidl)
2738 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2739
2740 for (i = 0; i < cida->cidl; i++)
2741 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2742
2743 return dst;
2744}
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 1725 of file pidl.c.

1726{
1727 TRACE("()\n");
1729}
const GUID CLSID_AdminFolderShortcut
#define PT_GUID
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1731

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1719 of file pidl.c.

1720{
1721 TRACE("()\n");
1722 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1723}

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1675 of file pidl.c.

1676{
1677 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1678
1679 TRACE("()\n");
1680 if (parent)
1681 {
1682 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1683
1684 if (cpl)
1685 {
1686 ret = ILCombine(parent, cpl);
1687 SHFree(cpl);
1688 }
1689 SHFree(parent);
1690 }
1691 return ret;
1692}
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 1646 of file pidl.c.

1647{
1649
1650 TRACE("()\n");
1651 ret = SHAlloc(2);
1652 if (ret)
1653 ret->mkid.cb = 0;
1654 return ret;
1655}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1852 of file pidl.c.

1853{
1854 LPITEMIDLIST pidlOut;
1855
1856 TRACE("(%s)\n",debugstr_w(lpszNew));
1857
1858 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1859 if (pidlOut)
1860 {
1861 LPSTR pszDest;
1862
1863 pszDest = _ILGetTextPointer(pidlOut);
1864 if (pszDest)
1865 {
1866 strcpy(pszDest, "x:\\");
1867 pszDest[0]=toupperW(lpszNew[0]);
1868 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1869 }
1870 }
1871 return pidlOut;
1872}
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:2298
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1620
#define PT_DRIVE
Definition: pidl.h:88
#define toupperW(n)
Definition: unicode.h:45
char * LPSTR
Definition: xmlstorage.h:182

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1874 of file pidl.c.

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

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

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

Referenced by CFSFolder::SetNameOf().

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1731 of file pidl.c.

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

1757{
1758 IID iid;
1759
1760 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1761 {
1762 ERR("%s is not a GUID\n", szGUID);
1763 return NULL;
1764 }
1765 return _ILCreateGuid(PT_GUID, &iid);
1766}
#define ERR(fmt,...)
Definition: debug.h:110
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 1769 of file pidl.c.

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

1670{
1671 TRACE("()\n");
1672 return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1673}

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

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1663 of file pidl.c.

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

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

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1713 of file pidl.c.

1714{
1715 TRACE("()\n");
1716 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1717}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1694 of file pidl.c.

1695{
1696 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1697
1698 TRACE("()\n");
1699 if (parent)
1700 {
1701 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1702
1703 if (printers)
1704 {
1705 ret = ILCombine(parent, printers);
1706 SHFree(printers);
1707 }
1708 SHFree(parent);
1709 }
1710 return ret;
1711}

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2690 of file pidl.c.

2691{
2692 UINT i;
2693
2694 if (apidl)
2695 {
2696 for (i = 0; i < cidl; i++)
2697 SHFree(apidl[i]);
2698 SHFree(apidl);
2699 }
2700}

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

1900{
1901 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1902
1903 if(_ILIsMyComputer(pidl))
1904 pidl = ILGetNext(pidl);
1905
1906 if (pidl && _ILIsDrive(pidl))
1907 return _ILSimpleGetText(pidl, pOut, uSize);
1908
1909 return 0;
1910}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1975
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2079
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2008

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2531 of file pidl.c.

2532{
2533 char szTemp[MAX_PATH];
2534 const char * pPoint;
2535 LPCITEMIDLIST pidlTemp=pidl;
2536
2537 TRACE("pidl=%p\n",pidl);
2538
2539 if (!pidl)
2540 return FALSE;
2541
2542 pidlTemp = ILFindLastID(pidl);
2543
2544 if (!_ILIsValue(pidlTemp))
2545 return FALSE;
2546 if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2547 return FALSE;
2548
2549 pPoint = PathFindExtensionA(szTemp);
2550
2551 if (!*pPoint)
2552 return FALSE;
2553
2554 pPoint++;
2555 lstrcpynA(pOut, pPoint, uOutSize);
2556 TRACE("%s\n",pOut);
2557
2558 return TRUE;
2559}
#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:2029

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

◆ _ILGetFileAttributes()

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

Definition at line 2650 of file pidl.c.

2651{
2653 WORD wAttrib = 0;
2654 int i;
2655
2656 if (!pData)
2657 return 0;
2658
2659 switch(pData->type)
2660 {
2661 case PT_FOLDER:
2662 case PT_VALUE:
2663 wAttrib = pData->u.file.uFileAttribs;
2664 break;
2665 }
2666
2667 if(uOutSize >= 6)
2668 {
2669 i=0;
2670 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2671 pOut[i++] = 'R';
2672 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2673 pOut[i++] = 'H';
2674 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2675 pOut[i++] = 'S';
2676 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2677 pOut[i++] = 'A';
2678 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2679 pOut[i++] = 'C';
2680 pOut[i] = 0x00;
2681 }
2682 return wAttrib;
2683}
#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 2466 of file pidl.c.

2467{
2468 FILETIME ft,lft;
2470 BOOL ret;
2471
2472 if (_ILGetFileDateTime( pidl, &ft ))
2473 {
2474 FileTimeToLocalFileTime(&ft, &lft);
2475 FileTimeToSystemTime (&lft, &time);
2476
2478 if (ret)
2479 {
2480 /* Append space + time without seconds */
2481 pOut[ret-1] = ' ';
2483 }
2484 }
2485 else
2486 {
2487 pOut[0] = '\0';
2488 ret = FALSE;
2489 }
2490 return ret;
2491}
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:2447
#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 2447 of file pidl.c.

2448{
2450
2451 if (!pdata)
2452 return FALSE;
2453
2454 switch (pdata->type)
2455 {
2456 case PT_FOLDER:
2457 case PT_VALUE:
2458 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2459 break;
2460 default:
2461 return FALSE;
2462 }
2463 return TRUE;
2464}
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 2510 of file pidl.c.

2511{
2513 DWORD dwSize;
2514
2515 if (!pdata)
2516 return 0;
2517
2518 switch (pdata->type)
2519 {
2520 case PT_VALUE:
2521 dwSize = pdata->u.file.dwFileSize;
2522 if (pOut)
2523 StrFormatKBSizeA(dwSize, pOut, uOutSize);
2524 return dwSize;
2525 }
2526 if (pOut)
2527 *pOut = 0x00;
2528 return 0;
2529}
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 2405 of file pidl.c.

2405 {
2406 FileStructW *pFileStructW;
2407 WORD cbOffset;
2408
2409 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2410 return NULL;
2411
2412 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2413 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2414
2415 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2416 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2417 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2418 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2419 /* FileStructW is positioned after FileStruct */
2420 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2421 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2422 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2423 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2424 {
2425 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2426 return NULL;
2427 }
2428
2429 return pFileStructW;
2430}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2020
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 2577 of file pidl.c.

2578{
2579#ifdef __REACTOS__ /* r32966 */
2580 char sType[64];
2581#endif
2582
2583 if(_ILIsValue(pidl))
2584 {
2585 char sTemp[64];
2586
2587 if(uOutSize > 0)
2588 pOut[0] = 0;
2589#ifdef __REACTOS__ /* r32966 */
2590 if (_ILGetExtension (pidl, sType, 64))
2591 {
2592 if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
2593 {
2594 /* retrieve description */
2595 if(HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE ))
2596 return;
2597 }
2598 /* display Ext-file as description */
2599 _strupr(sType);
2600 /* load localized file string */
2601 sTemp[0] = '\0';
2603 {
2604 sTemp[63] = '\0';
2605 StringCchPrintfA(pOut, uOutSize, sTemp, sType);
2606 }
2607 }
2608#else
2609 if (_ILGetExtension (pidl, sTemp, 64))
2610 {
2611 if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
2612 && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
2613 {
2614 lstrcpynA (pOut, sTemp, uOutSize - 6);
2615 strcat (pOut, "-file");
2616 }
2617 }
2618#endif
2619 }
2620 else
2621#ifdef __REACTOS__ /* r32966 */
2622 {
2623 pOut[0] = '\0';
2625 /* make sure its null terminated */
2626 pOut[uOutSize-1] = '\0';
2627 }
2628#else
2629 lstrcpynA(pOut, "Folder", uOutSize);
2630#endif
2631}
#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:2531
_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 2369 of file pidl.c.

2370{
2372
2373 TRACE("%p\n", pidl);
2374
2375 if (!pdata)
2376 return NULL;
2377
2378 TRACE("pdata->type 0x%04x\n", pdata->type);
2379 switch (pdata->type)
2380 {
2381 case PT_SHELLEXT:
2382 case PT_GUID:
2383 case PT_YAGUID:
2384 return &(pdata->u.guid.guid);
2385
2386 default:
2387 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2388 break;
2389 }
2390 return NULL;
2391}

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

2342{
2343 /* TRACE(pidl,"(pidl%p)\n", pidl); */
2344
2346
2347 if (!pdata)
2348 return NULL;
2349
2350 switch (pdata->type)
2351 {
2352 case PT_FOLDER:
2353 case PT_VALUE:
2354 case PT_IESPECIAL1:
2355 case PT_IESPECIAL2:
2356 return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
2357
2358 case PT_WORKGRP:
2359 return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
2360 }
2361 return NULL;
2362}
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 2298 of file pidl.c.

2299{
2300 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2301
2303
2304 if (!pdata)
2305 return NULL;
2306
2307 switch (pdata->type)
2308 {
2309 case PT_GUID:
2310 case PT_SHELLEXT:
2311 case PT_YAGUID:
2312 return NULL;
2313
2314 case PT_DRIVE:
2315 case PT_DRIVE1:
2316 case PT_DRIVE2:
2317 case PT_DRIVE3:
2318 return pdata->u.drive.szDriveName;
2319
2320 case PT_FOLDER:
2321 case PT_FOLDER1:
2322 case PT_VALUE:
2323 case PT_IESPECIAL1:
2324 case PT_IESPECIAL2:
2325 return pdata->u.file.szNames;
2326
2327 case PT_WORKGRP:
2328 case PT_COMP:
2329 case PT_NETWORK:
2330 case PT_NETPROVIDER:
2331 case PT_SHARE:
2332 return pdata->u.network.szNames;
2333 }
2334 return NULL;
2335}
#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 2242 of file pidl.c.

2243{
2244 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2245
2247
2248 if (!pdata)
2249 return NULL;
2250
2251 switch (pdata->type)
2252 {
2253 case PT_GUID:
2254 case PT_SHELLEXT:
2255 case PT_YAGUID:
2256 return NULL;
2257
2258 case PT_DRIVE:
2259 case PT_DRIVE1:
2260 case PT_DRIVE2:
2261 case PT_DRIVE3:
2262 /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
2263 return NULL;
2264
2265 case PT_FOLDER:
2266 case PT_FOLDER1:
2267 case PT_VALUE:
2268 case PT_IESPECIAL1:
2269 case PT_IESPECIAL2:
2270 /*return (LPSTR)&(pdata->u.file.szNames);*/
2271 return NULL;
2272
2273 case PT_WORKGRP:
2274 case PT_COMP:
2275 case PT_NETWORK:
2276 case PT_NETPROVIDER:
2277 case PT_SHARE:
2278 /*return (LPSTR)&(pdata->u.network.szNames);*/
2279 return NULL;
2280
2281 case PT_VALUEW:
2282 return (LPWSTR)pdata->u.file.szNames;
2283
2284#ifdef __REACTOS__ /* r54423 */
2285 case PT_CPLAPPLET:
2286 return pdata->u.cpanel.szName;
2287#endif
2288
2289 }
2290 return NULL;
2291}
#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:2405
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2369
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1935

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

◆ _ILIsBitBucket()

BOOL _ILIsBitBucket ( LPCITEMIDLIST  pidl)

Definition at line 1986 of file pidl.c.

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

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

◆ _ILIsControlPanel()

BOOL _ILIsControlPanel ( LPCITEMIDLIST  pidl)

Definition at line 1964 of file pidl.c.

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

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

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2038 of file pidl.c.

2039{
2040 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2041
2042 TRACE("(%p)\n",pidl);
2043
2044 return (pidl && lpPData && (lpPData->type == 0));
2045}

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

◆ _ILIsDesktop()

BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 1935 of file pidl.c.

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

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

◆ _ILIsDrive()

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1975 of file pidl.c.

1976{
1977 REFIID iid = _ILGetGUIDPointer(pidl);
1978
1979 TRACE("(%p)\n",pidl);
1980
1981 if (iid)
1982 return IsEqualIID(iid, &CLSID_MyComputer);
1983 return FALSE;
1984}
#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 1942 of file pidl.c.

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

◆ _ILIsNetHood()

BOOL _ILIsNetHood ( LPCITEMIDLIST  pidl)

Definition at line 1953 of file pidl.c.

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

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 2050 of file pidl.c.

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

Referenced by SHBindToParent().

◆ _ILIsSpecialFolder()

BOOL _ILIsSpecialFolder ( LPCITEMIDLIST  pidl)

Definition at line 1997 of file pidl.c.

1998{
1999 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2000
2001 TRACE("(%p)\n",pidl);
2002
2003 return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
2004 (pidl && pidl->mkid.cb == 0x00)
2005 ));
2006}

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1926 of file pidl.c.

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

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

2080{
2081 DWORD dwReturn=0;
2082 LPSTR szSrc;
2083 LPWSTR szSrcW;
2084 GUID const * riid;
2085 char szTemp[MAX_PATH];
2086
2087 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2088
2089 if (!pidl)
2090 return 0;
2091
2092 if (szOut)
2093 *szOut = 0;
2094
2095 if (_ILIsDesktop(pidl))
2096 {
2097 /* desktop */
2098 if (HCR_GetClassNameA(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2099 {
2100 if (szOut)
2101 lstrcpynA(szOut, szTemp, uOutSize);
2102
2103 dwReturn = strlen (szTemp);
2104 }
2105 }
2106 else if (( szSrc = _ILGetTextPointer(pidl) ))
2107 {
2108 /* filesystem */
2109 if (szOut)
2110 lstrcpynA(szOut, szSrc, uOutSize);
2111
2112 dwReturn = strlen(szSrc);
2113 }
2114 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2115 {
2116 /* unicode filesystem */
2117 WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
2118
2119 if (szOut)
2120 lstrcpynA(szOut, szTemp, uOutSize);
2121
2122 dwReturn = strlen (szTemp);
2123 }
2124 else if (( riid = _ILGetGUIDPointer(pidl) ))
2125 {
2126 /* special folder */
2127 if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
2128 {
2129 if (szOut)
2130 lstrcpynA(szOut, szTemp, uOutSize);
2131
2132 dwReturn = strlen (szTemp);
2133 }
2134 }
2135 else
2136 {
2137 ERR("-- no text\n");
2138 }
2139
2140 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
2141 return dwReturn;
2142}
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2242
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 2151 of file pidl.c.

2152{
2153 DWORD dwReturn;
2154 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2155
2156 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2157
2158 if (pFileStructW) {
2159 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2160 dwReturn = lstrlenW(pFileStructW->wszName);
2161 } else {
2162 GUID const * riid;
2163 WCHAR szTemp[MAX_PATH];
2164 LPSTR szSrc;
2165 LPWSTR szSrcW;
2166 dwReturn=0;
2167
2168 if (!pidl)
2169 return 0;
2170
2171 if (szOut)
2172 *szOut = 0;
2173
2174 if (_ILIsDesktop(pidl))
2175 {
2176 /* desktop */
2177 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2178 {
2179 if (szOut)
2180 lstrcpynW(szOut, szTemp, uOutSize);
2181
2182 dwReturn = lstrlenW (szTemp);
2183 }
2184 }
2185 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2186 {
2187 /* unicode filesystem */
2188 if (szOut)
2189 lstrcpynW(szOut, szSrcW, uOutSize);
2190
2191 dwReturn = lstrlenW(szSrcW);
2192 }
2193 else if (( szSrc = _ILGetTextPointer(pidl) ))
2194 {
2195 /* filesystem */
2196 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, MAX_PATH);
2197
2198 if (szOut)
2199 lstrcpynW(szOut, szTemp, uOutSize);
2200
2201 dwReturn = lstrlenW (szTemp);
2202 }
2203 else if (( riid = _ILGetGUIDPointer(pidl) ))
2204 {
2205 /* special folder */
2206 if ( HCR_GetClassNameW(riid, szTemp, MAX_PATH) )
2207 {
2208 if (szOut)
2209 lstrcpynW(szOut, szTemp, uOutSize);
2210
2211 dwReturn = lstrlenW (szTemp);
2212 }
2213 }
2214 else
2215 {
2216 ERR("-- no text\n");
2217 }
2218 }
2219
2220 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2221 return dwReturn;
2222}
#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:111
#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:1361
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(), 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 1361 of file pidl.c.

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

Referenced by CViewStatePropertyBag::_IsSystemFolder(), _ReparsePIDL(), CAddressEditBox::AddComboBoxItem(), CShellBrowser::BrowseToPath(), CreateIDataObject(), Entry::do_context_menu(), CShellLink::DragEnter(), CExplorerBand::DragOver(), CCopyAsPathMenu::Drop(), 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:1510

Referenced by CStartMenuBtnCtxMenu::QueryContextMenu().

◆ SHGetDataFromIDListA()

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

Definition at line 1163 of file pidl.c.

1165{
1166 LPSTR filename, shortname;
1168
1169 TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1170
1171 pdump(pidl);
1172 if (!psf || !dest)
1173 return E_INVALIDARG;
1174
1175 switch (nFormat)
1176 {
1177 case SHGDFIL_FINDDATA:
1178 pfd = dest;
1179
1180 if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
1181 return E_INVALIDARG;
1182
1183 if (len < sizeof(WIN32_FIND_DATAA))
1184 return E_INVALIDARG;
1185
1186 ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
1187 _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1188 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1189 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1190
1192 shortname = _ILGetSTextPointer(pidl);
1193
1194 if (filename)
1195 lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
1196 else
1197 pfd->cFileName[0] = '\0';
1198
1199 if (shortname)
1200 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
1201 else
1202 pfd->cAlternateFileName[0] = '\0';
1203 return S_OK;
1204
1207 FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1208 break;
1209
1210 default:
1211 ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1212 }
1213
1214 return E_INVALIDARG;
1215}
#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:2341
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2650
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2510
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1997
#define ERR_(ch,...)
Definition: debug.h:156
#define SHGDFIL_FINDDATA
Definition: shlobj.h:1443
#define SHGDFIL_NETRESOURCE
Definition: shlobj.h:1444
#define SHGDFIL_DESCRIPTIONID
Definition: shlobj.h:1445
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67

◆ SHGetDataFromIDListW()

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

Definition at line 1221 of file pidl.c.

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

Referenced by CViewStatePropertyBag::_IsSystemFolder().

◆ SHGetIDListFromObject()

HRESULT WINAPI SHGetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 1530 of file pidl.c.

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

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

1312{
1313 HRESULT hr;
1314 LPCITEMIDLIST pidlLast;
1315 LPSHELLFOLDER psfFolder;
1317 STRRET strret;
1318
1319 TRACE_(shell)("(pidl=%p,%p)\n", pidl, pszPath);
1320 pdump(pidl);
1321
1322 *pszPath = UNICODE_NULL;
1323 if (!pidl)
1324 return E_FAIL;
1325
1326 hr = SHBindToParent(pidl, &IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
1327 if (FAILED(hr))
1328 {
1329 ERR("SHBindToParent failed: %x\n", hr);
1330 return hr;
1331 }
1332
1333 dwAttributes = SFGAO_FILESYSTEM;
1334 hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes);
1335 if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM))
1336 {
1337 WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr);
1338 IShellFolder_Release(psfFolder);
1339 return E_FAIL;
1340 }
1341
1342 hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
1343 IShellFolder_Release(psfFolder);
1344 if (FAILED(hr))
1345 return hr;
1346
1347 hr = StrRetToBufW(&strret, pidlLast, pszPath, cchPathMax);
1348
1349 TRACE_(shell)("-- %s, 0x%08x\n",debugstr_w(pszPath), hr);
1350 return hr;
1351}
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 1291 of file pidl.c.

1292{
1293 WCHAR wszPath[MAX_PATH];
1294 BOOL bSuccess;
1295
1296 bSuccess = SHGetPathFromIDListW(pidl, wszPath);
1297 WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL);
1298
1299 return bSuccess;
1300}
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 1353 of file pidl.c.

1354{
1355 return SUCCEEDED(SHGetPathCchFromIDListW(pidl, pszPath, MAX_PATH));
1356}
HRESULT WINAPI SHGetPathCchFromIDListW(_In_ LPCITEMIDLIST pidl, _Out_writes_(cchPathMax) LPWSTR pszPath, _In_ SIZE_T cchPathMax)
Definition: pidl.c:1308

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

1407{
1408 HRESULT hr;
1409 LPWSTR pszNameDup;
1410 IShellFolder *psfDesktop;
1411 IBindCtx *pBindCtx = NULL;
1412
1413 TRACE("(%s, %p, %p, 0x%X, %p)\n", pszName, pbc, ppidl, sfgaoIn, psfgaoOut);
1414
1415 *ppidl = NULL;
1416
1417 if (psfgaoOut)
1418 *psfgaoOut = 0;
1419
1420 pszNameDup = StrDupW(pszName);
1421 if (!pszNameDup)
1422 return E_OUTOFMEMORY;
1423
1424 psfDesktop = NULL;
1425 hr = SHGetDesktopFolder(&psfDesktop);
1426 if (FAILED(hr))
1427 {
1428 LocalFree(pszNameDup);
1429 return hr;
1430 }
1431
1432 if (!pbc)
1433 {
1434 hr = BindCtx_RegisterObjectParam(NULL, STR_PARSE_TRANSLATE_ALIASES, NULL, &pBindCtx);
1435 pbc = pBindCtx;
1436 }
1437
1438 if (SUCCEEDED(hr))
1439 {
1440 ULONG sfgao = sfgaoIn, cchEaten;
1441 HWND hwndUI = BindCtx_GetUIWindow(pbc);
1442 hr = psfDesktop->lpVtbl->ParseDisplayName(psfDesktop,
1443 hwndUI,
1444 pbc,
1445 pszNameDup,
1446 &cchEaten,
1447 ppidl,
1448 (psfgaoOut ? &sfgao : NULL));
1449 if (SUCCEEDED(hr) && psfgaoOut)
1450 *psfgaoOut = (sfgao & sfgaoIn);
1451 }
1452
1453 LocalFree(pszNameDup);
1454
1455 if (psfDesktop)
1456 psfDesktop->lpVtbl->Release(psfDesktop);
1457
1458 if (pBindCtx)
1459 pBindCtx->lpVtbl->Release(pBindCtx);
1460
1461 return hr;
1462}
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#ifdef __REACTOS__
1117 // FIXME: Needs folder attribute
1118 if (PathFileExistsW(wPath))
1119 {
1120 pidl = ILCreateFromPathW(wPath);
1121 HeapFree(GetProcessHeap(), 0, wPath);
1122 return pidl;
1123 }
1124#endif
1125
1126 _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
1127
1128 HeapFree(GetProcessHeap(), 0, wPath);
1129 TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
1130 return pidl;
1131}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
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 1149 of file pidl.c.

1150{
1151 if ( SHELL_OsIsUnicode())
1152 return SHSimpleIDListFromPathW (lpszPath);
1153 return SHSimpleIDListFromPathA (lpszPath);
1154}
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
Definition: pidl.c:1102
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1133

◆ SHSimpleIDListFromPathW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathW ( LPCWSTR  lpszPath)

Definition at line 1133 of file pidl.c.

1134{
1135 LPITEMIDLIST pidl = NULL;
1136
1137 TRACE("%s\n", debugstr_w(lpszPath));
1138#ifdef __REACTOS__
1139 // FIXME: Needs folder attribute
1140 if (PathFileExistsW(lpszPath))
1141 return ILCreateFromPathW(lpszPath);
1142#endif
1143
1144 _ILParsePathW(lpszPath, NULL, TRUE, &pidl, NULL);
1145 TRACE("%s %p\n", debugstr_w(lpszPath), pidl);
1146 return pidl;
1147}

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  )