ReactOS  0.4.13-dev-101-g0ca4b50
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)
 
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)
 
LPITEMIDLIST WINAPI ILFindChild (LPCITEMIDLIST pidl1, LPCITEMIDLIST 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)
 
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 _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 1562 of file pidl.c.

1563 {
1564  LPITEMIDLIST pidlOut = NULL;
1565 
1566  pidlOut = SHAlloc(size + 5);
1567  if(pidlOut)
1568  {
1569  LPPIDLDATA pData;
1570  LPITEMIDLIST pidlNext;
1571 
1572  ZeroMemory(pidlOut, size + 5);
1573  pidlOut->mkid.cb = size + 3;
1574 
1575  pData = _ILGetDataPointer(pidlOut);
1576  if (pData)
1577  pData->type = type;
1578 
1579  pidlNext = ILGetNext(pidlOut);
1580  if (pidlNext)
1581  pidlNext->mkid.cb = 0x00;
1582  TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
1583  }
1584 
1585  return pidlOut;
1586 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ZeroMemory
Definition: winbase.h:1635
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

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

◆ _ILCopyaPidl()

PITEMID_CHILD* _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2638 of file pidl.c.

2639 {
2640  UINT i;
2641  PITEMID_CHILD *apidldest;
2642 
2643  if (!apidlsrc)
2644  return NULL;
2645 
2646  apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2647 
2648  for (i = 0; i < cidl; i++)
2649  apidldest[i] = ILClone(apidlsrc[i]);
2650 
2651  return apidldest;
2652 }
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
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
unsigned int UINT
Definition: ndis.h:50
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

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

◆ _ILCopyCidaToaPidl()

LPITEMIDLIST* _ILCopyCidaToaPidl ( LPITEMIDLIST pidl,
const CIDA cida 
)

Definition at line 2659 of file pidl.c.

2660 {
2661  UINT i;
2662  LPITEMIDLIST *dst;
2663 
2664  dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2665  if (!dst)
2666  return NULL;
2667 
2668  if (pidl)
2669  *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2670 
2671  for (i = 0; i < cida->cidl; i++)
2672  dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2673 
2674  return dst;
2675 }
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
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
smooth NULL
Definition: ftsmooth.c:416
UINT cidl
Definition: shlobj.h:491
unsigned char BYTE
Definition: mem.h:68
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

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

◆ _ILCreateAdminTools()

LPITEMIDLIST _ILCreateAdminTools ( void  )

Definition at line 1667 of file pidl.c.

1668 {
1669  TRACE("()\n");
1671 }
const GUID CLSID_AdminFolderShortcut
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1661 of file pidl.c.

1662 {
1663  TRACE("()\n");
1664  return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1665 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1617 of file pidl.c.

1618 {
1619  LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1620 
1621  TRACE("()\n");
1622  if (parent)
1623  {
1624  LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1625 
1626  if (cpl)
1627  {
1628  ret = ILCombine(parent, cpl);
1629  SHFree(cpl);
1630  }
1631  SHFree(parent);
1632  }
1633  return ret;
1634 }
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2659
int ret
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define PT_GUID
#define PT_SHELLEXT

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1588 of file pidl.c.

1589 {
1590  LPITEMIDLIST ret;
1591 
1592  TRACE("()\n");
1593  ret = SHAlloc(2);
1594  if (ret)
1595  ret->mkid.cb = 0;
1596  return ret;
1597 }
#define TRACE(s)
Definition: solgame.cpp:4
int ret
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1794 of file pidl.c.

1795 {
1796  LPITEMIDLIST pidlOut;
1797 
1798  TRACE("(%s)\n",debugstr_w(lpszNew));
1799 
1800  pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1801  if (pidlOut)
1802  {
1803  LPSTR pszDest;
1804 
1805  pszDest = _ILGetTextPointer(pidlOut);
1806  if (pszDest)
1807  {
1808  strcpy(pszDest, "x:\\");
1809  pszDest[0]=toupperW(lpszNew[0]);
1810  TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1811  }
1812  }
1813  return pidlOut;
1814 }
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1562
char * LPSTR
Definition: xmlstorage.h:182
#define debugstr_w
Definition: kernel32.h:32
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
#define PT_DRIVE
Definition: pidl.h:88
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1816 of file pidl.c.

1817 {
1818  LPITEMIDLIST pidlOut;
1819 
1820  TRACE("\n");
1821 
1822  pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1823  if (pidlOut)
1824  {
1825  LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
1826 
1827  pData->u.network.dummy = 0;
1828  strcpy(pData->u.network.szNames, "Entire Network");
1829  }
1830  return pidlOut;
1831 }
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
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1562
#define PT_NETWORK
Definition: pidl.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

◆ _ILCreateFromFindDataW()

LPITEMIDLIST _ILCreateFromFindDataW ( const WIN32_FIND_DATAW wfd)

Definition at line 1727 of file pidl.c.

1728 {
1729  char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1730  DWORD len, len1, wlen, alen;
1731  LPITEMIDLIST pidl;
1732  PIDLTYPE type;
1733 
1734  if (!wfd)
1735  return NULL;
1736 
1737  TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1738 
1739  /* prepare buffer with both names */
1740  len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1741  len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1742  alen = len + len1;
1743 
1744  type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1745 
1746  wlen = lstrlenW(wfd->cFileName) + 1;
1747  pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1748  FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1749  if (pidl)
1750  {
1752  FileStruct *fs = &pData->u.file;
1753  FileStructW *fsw;
1754  WORD *pOffsetW;
1755 
1756  FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1757  fs->dwFileSize = wfd->nFileSizeLow;
1758  fs->uFileAttribs = wfd->dwFileAttributes;
1759  memcpy(fs->szNames, buff, alen);
1760 
1761  fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1762  fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1763  FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1764  FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1765  memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1766 
1767  pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1768  *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1769  TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1770  }
1771  return pidl;
1772 
1773 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define WideCharToMultiByte
Definition: compat.h:101
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1562
#define CP_ACP
Definition: compat.h:99
WCHAR wszName[1]
Definition: shlfolder.c:1555
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: fs.h:235
#define lstrlenW
Definition: compat.h:407
unsigned char * LPBYTE
Definition: typedefs.h:52
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
BYTE PIDLTYPE
Definition: pidl.h:108
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
Definition: time.c:37
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define PT_VALUE
Definition: pidl.h:95
#define PT_FOLDER
Definition: pidl.h:94
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static unsigned char buff[32768]
Definition: fatten.c:17

Referenced by _ILCreateFromPathW(), CFileSysEnum::Initialize(), SHChangeNotify(), and SHELL32_CreatePidlFromBindCtx().

◆ _ILCreateFromPathW()

HRESULT _ILCreateFromPathW ( LPCWSTR  szPath,
LPITEMIDLIST ppidl 
)

Definition at line 1775 of file pidl.c.

1776 {
1777  HANDLE hFile;
1778  WIN32_FIND_DATAW stffile;
1779 
1780  if (!ppidl)
1781  return E_INVALIDARG;
1782 
1783  hFile = FindFirstFileW(szPath, &stffile);
1784  if (hFile == INVALID_HANDLE_VALUE)
1786 
1787  FindClose(hFile);
1788 
1789  *ppidl = _ILCreateFromFindDataW(&stffile);
1790 
1791  return *ppidl ? S_OK : E_OUTOFMEMORY;
1792 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
_In_ HANDLE hFile
Definition: mswsock.h:90
#define S_OK
Definition: intsafe.h:59
LPCWSTR szPath
Definition: env.c:35
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *wfd)
Definition: pidl.c:1727
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502

Referenced by CFSFolder::ParseDisplayName(), and CFSFolder::SetNameOf().

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1673 of file pidl.c.

1674 {
1675  LPITEMIDLIST pidlOut;
1676 
1677  if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1678  {
1679  pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1680  if (pidlOut)
1681  {
1682  LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
1683 
1684  pData->u.guid.guid = *guid;
1685  TRACE("-- create GUID-pidl %s\n",
1686  debugstr_guid(&(pData->u.guid.guid)));
1687  }
1688  }
1689  else
1690  {
1691  WARN("%d: invalid type for GUID\n", type);
1692  pidlOut = NULL;
1693  }
1694  return pidlOut;
1695 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1562
#define WARN(fmt,...)
Definition: debug.h:111
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const GUID * guid
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define PT_YAGUID
#define TRACE(s)
Definition: solgame.cpp:4
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define PT_GUID
#define PT_SHELLEXT

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1698 of file pidl.c.

1699 {
1700  IID iid;
1701 
1702  if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1703  {
1704  ERR("%s is not a GUID\n", szGUID);
1705  return NULL;
1706  }
1707  return _ILCreateGuid(PT_GUID, &iid);
1708 }
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:253
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
smooth NULL
Definition: ftsmooth.c:416
#define ERR(fmt,...)
Definition: debug.h:109
#define PT_GUID

◆ _ILCreateGuidFromStrW()

LPITEMIDLIST _ILCreateGuidFromStrW ( LPCWSTR  szGUID)

Definition at line 1711 of file pidl.c.

1712 {
1713  IID iid;
1714 
1715 #ifndef __REACTOS__
1716  if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1717 #else
1718  if (!GUIDFromStringW(szGUID, &iid))
1719 #endif
1720  {
1721  ERR("%s is not a GUID\n", debugstr_w(szGUID));
1722  return NULL;
1723  }
1724  return _ILCreateGuid(PT_GUID, &iid);
1725 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:261
#define ERR(fmt,...)
Definition: debug.h:109
#define PT_GUID

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

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1611 of file pidl.c.

1612 {
1613  TRACE("()\n");
1614  return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1615 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

Referenced by SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1599 of file pidl.c.

1600 {
1601  TRACE("()\n");
1602  return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
1603 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1605 of file pidl.c.

1606 {
1607  TRACE("()\n");
1608  return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1609 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

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

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1655 of file pidl.c.

1656 {
1657  TRACE("()\n");
1658  return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1659 }
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1636 of file pidl.c.

1637 {
1638  LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1639 
1640  TRACE("()\n");
1641  if (parent)
1642  {
1643  LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1644 
1645  if (printers)
1646  {
1647  ret = ILCombine(parent, printers);
1648  SHFree(printers);
1649  }
1650  SHFree(parent);
1651  }
1652  return ret;
1653 }
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1673
smooth NULL
Definition: ftsmooth.c:416
#define PT_YAGUID
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2659
int ret
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define PT_GUID

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2621 of file pidl.c.

2622 {
2623  UINT i;
2624 
2625  if (apidl)
2626  {
2627  for (i = 0; i < cidl; i++)
2628  SHFree(apidl[i]);
2629  SHFree(apidl);
2630  }
2631 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

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

◆ _ILGetDataPointer()

◆ _ILGetDrive()

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

Definition at line 1841 of file pidl.c.

1842 {
1843  TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1844 
1845  if(_ILIsMyComputer(pidl))
1846  pidl = ILGetNext(pidl);
1847 
1848  if (pidl && _ILIsDrive(pidl))
1849  return _ILSimpleGetText(pidl, pOut, uSize);
1850 
1851  return 0;
1852 }
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1906
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
#define TRACE(s)
Definition: solgame.cpp:4
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1939
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2010

Referenced by DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2462 of file pidl.c.

2463 {
2464  char szTemp[MAX_PATH];
2465  const char * pPoint;
2466  LPCITEMIDLIST pidlTemp=pidl;
2467 
2468  TRACE("pidl=%p\n",pidl);
2469 
2470  if (!pidl)
2471  return FALSE;
2472 
2473  pidlTemp = ILFindLastID(pidl);
2474 
2475  if (!_ILIsValue(pidlTemp))
2476  return FALSE;
2477  if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2478  return FALSE;
2479 
2480  pPoint = PathFindExtensionA(szTemp);
2481 
2482  if (!*pPoint)
2483  return FALSE;
2484 
2485  pPoint++;
2486  lstrcpynA(pOut, pPoint, uOutSize);
2487  TRACE("%s\n",pOut);
2488 
2489  return TRUE;
2490 }
#define TRUE
Definition: types.h:120
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_PATH
Definition: compat.h:26
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1960
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2010
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:417
#define lstrcpynA
Definition: compat.h:408

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

◆ _ILGetFileAttributes()

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

Definition at line 2581 of file pidl.c.

2582 {
2584  WORD wAttrib = 0;
2585  int i;
2586 
2587  if (!pData)
2588  return 0;
2589 
2590  switch(pData->type)
2591  {
2592  case PT_FOLDER:
2593  case PT_VALUE:
2594  wAttrib = pData->u.file.uFileAttribs;
2595  break;
2596  }
2597 
2598  if(uOutSize >= 6)
2599  {
2600  i=0;
2601  if(wAttrib & FILE_ATTRIBUTE_READONLY)
2602  pOut[i++] = 'R';
2603  if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2604  pOut[i++] = 'H';
2605  if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2606  pOut[i++] = 'S';
2607  if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2608  pOut[i++] = 'A';
2609  if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2610  pOut[i++] = 'C';
2611  pOut[i] = 0x00;
2612  }
2613  return wAttrib;
2614 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
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
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned short WORD
Definition: ntddk_ex.h:93
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define PT_VALUE
Definition: pidl.h:95
#define PT_FOLDER
Definition: pidl.h:94
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

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

◆ _ILGetFileDate()

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

Definition at line 2397 of file pidl.c.

2398 {
2399  FILETIME ft,lft;
2400  SYSTEMTIME time;
2401  BOOL ret;
2402 
2403  if (_ILGetFileDateTime( pidl, &ft ))
2404  {
2405  FileTimeToLocalFileTime(&ft, &lft);
2406  FileTimeToSystemTime (&lft, &time);
2407 
2409  if (ret)
2410  {
2411  /* Append space + time without seconds */
2412  pOut[ret-1] = ' ';
2414  }
2415  }
2416  else
2417  {
2418  pOut[0] = '\0';
2419  ret = FALSE;
2420  }
2421  return ret;
2422 }
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:922
#define LOCALE_USER_DEFAULT
#define DATE_SHORTDATE
Definition: winnls.h:193
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:211
INT WINAPI GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1030
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2378
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
int ret
#define TIME_NOSECONDS
Definition: winnls.h:275

Referenced by CFSFolder::GetDetailsOf().

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME pFt 
)

Definition at line 2378 of file pidl.c.

2379 {
2381 
2382  if (!pdata)
2383  return FALSE;
2384 
2385  switch (pdata->type)
2386  {
2387  case PT_FOLDER:
2388  case PT_VALUE:
2389  DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2390  break;
2391  default:
2392  return FALSE;
2393  }
2394  return TRUE;
2395 }
#define TRUE
Definition: types.h:120
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
static PROTOCOLDATA * pdata
Definition: protocol.c:157
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
#define PT_VALUE
Definition: pidl.h:95
#define PT_FOLDER
Definition: pidl.h:94

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

◆ _ILGetFileSize()

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

Definition at line 2441 of file pidl.c.

2442 {
2444  DWORD dwSize;
2445 
2446  if (!pdata)
2447  return 0;
2448 
2449  switch (pdata->type)
2450  {
2451  case PT_VALUE:
2452  dwSize = pdata->u.file.dwFileSize;
2453  if (pOut)
2454  StrFormatKBSizeA(dwSize, pOut, uOutSize);
2455  return dwSize;
2456  }
2457  if (pOut)
2458  *pOut = 0x00;
2459  return 0;
2460 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:1727
static PROTOCOLDATA * pdata
Definition: protocol.c:157
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PT_VALUE
Definition: pidl.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

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

◆ _ILGetFileStructW()

FileStructW* _ILGetFileStructW ( LPCITEMIDLIST  pidl)

Definition at line 2336 of file pidl.c.

2336  {
2337  FileStructW *pFileStructW;
2338  WORD cbOffset;
2339 
2340  if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2341  return NULL;
2342 
2343  cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2344  pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2345 
2346  /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2347  * style with a FileStructW member. If we switch all our shellfolder-implementations to
2348  * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2349  if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2350  /* FileStructW is positioned after FileStruct */
2351  cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2352  /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2353  cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2354  pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2355  {
2356  WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2357  return NULL;
2358  }
2359 
2360  return pFileStructW;
2361 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
#define WARN(fmt,...)
Definition: debug.h:111
unsigned char * LPBYTE
Definition: typedefs.h:52
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1951
smooth NULL
Definition: ftsmooth.c:416
BYTE PIDLTYPE
Definition: pidl.h:108
unsigned short WORD
Definition: ntddk_ex.h:93
struct tagFileStructW FileStructW
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1960
unsigned char BYTE
Definition: mem.h:68
struct tagFileStruct FileStruct

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

◆ _ILGetFileType()

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

Definition at line 2508 of file pidl.c.

2509 {
2510 #ifdef __REACTOS__ /* r32966 */
2511  char sType[64];
2512 #endif
2513 
2514  if(_ILIsValue(pidl))
2515  {
2516  char sTemp[64];
2517 
2518  if(uOutSize > 0)
2519  pOut[0] = 0;
2520 #ifdef __REACTOS__ /* r32966 */
2521  if (_ILGetExtension (pidl, sType, 64))
2522  {
2523  if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
2524  {
2525  /* retrieve description */
2526  if(HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE ))
2527  return;
2528  }
2529  /* display Ext-file as description */
2530  _strupr(sType);
2531  /* load localized file string */
2532  sTemp[0] = '\0';
2533  if(LoadStringA(shell32_hInstance, IDS_ANY_FILE, sTemp, 64))
2534  {
2535  sTemp[63] = '\0';
2536  StringCchPrintfA(pOut, uOutSize, sTemp, sType);
2537  }
2538  }
2539 #else
2540  if (_ILGetExtension (pidl, sTemp, 64))
2541  {
2542  if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
2543  && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
2544  {
2545  lstrcpynA (pOut, sTemp, uOutSize - 6);
2546  strcat (pOut, "-file");
2547  }
2548  }
2549 #endif
2550  }
2551  else
2552 #ifdef __REACTOS__ /* r32966 */
2553  {
2554  pOut[0] = '\0';
2555  LoadStringA(shell32_hInstance, IDS_DIRECTORY, pOut, uOutSize);
2556  /* make sure its null terminated */
2557  pOut[uOutSize-1] = '\0';
2558  }
2559 #else
2560  lstrcpynA(pOut, "Folder", uOutSize);
2561 #endif
2562 }
#define TRUE
Definition: types.h:120
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
#define IDS_DIRECTORY
Definition: shresdef.h:145
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520
#define IDS_ANY_FILE
Definition: shresdef.h:171
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2462
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:88
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1960
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
#define lstrcpynA
Definition: compat.h:408

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

◆ _ILGetGUIDPointer()

IID* _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2300 of file pidl.c.

2301 {
2303 
2304  TRACE("%p\n", pidl);
2305 
2306  if (!pdata)
2307  return NULL;
2308 
2309  TRACE("pdata->type 0x%04x\n", pdata->type);
2310  switch (pdata->type)
2311  {
2312  case PT_SHELLEXT:
2313  case PT_GUID:
2314  case PT_YAGUID:
2315  return &(pdata->u.guid.guid);
2316 
2317  default:
2318  TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2319  break;
2320  }
2321  return NULL;
2322 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define PT_YAGUID
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID
#define PT_SHELLEXT

Referenced by _ILHACKCompareSimpleIds(), _ILIsBitBucket(), _ILIsControlPanel(), _ILIsMyComputer(), _ILIsMyDocuments(), _ILIsNetHood(), _ILSimpleGetText(), _ILSimpleGetTextW(), 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 2272 of file pidl.c.

2273 {
2274  /* TRACE(pidl,"(pidl%p)\n", pidl); */
2275 
2277 
2278  if (!pdata)
2279  return NULL;
2280 
2281  switch (pdata->type)
2282  {
2283  case PT_FOLDER:
2284  case PT_VALUE:
2285  case PT_IESPECIAL1:
2286  case PT_IESPECIAL2:
2287  return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
2288 
2289  case PT_WORKGRP:
2290  return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
2291  }
2292  return NULL;
2293 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_IESPECIAL2
Definition: pidl.h:104
smooth NULL
Definition: ftsmooth.c:416
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define PT_IESPECIAL1
Definition: pidl.h:102
#define PT_VALUE
Definition: pidl.h:95
#define PT_FOLDER
Definition: pidl.h:94

Referenced by SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2229 of file pidl.c.

2230 {
2231  /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2232 
2234 
2235  if (!pdata)
2236  return NULL;
2237 
2238  switch (pdata->type)
2239  {
2240  case PT_GUID:
2241  case PT_SHELLEXT:
2242  case PT_YAGUID:
2243  return NULL;
2244 
2245  case PT_DRIVE:
2246  case PT_DRIVE1:
2247  case PT_DRIVE2:
2248  case PT_DRIVE3:
2249  return pdata->u.drive.szDriveName;
2250 
2251  case PT_FOLDER:
2252  case PT_FOLDER1:
2253  case PT_VALUE:
2254  case PT_IESPECIAL1:
2255  case PT_IESPECIAL2:
2256  return pdata->u.file.szNames;
2257 
2258  case PT_WORKGRP:
2259  case PT_COMP:
2260  case PT_NETWORK:
2261  case PT_NETPROVIDER:
2262  case PT_SHARE:
2263  return pdata->u.network.szNames;
2264  }
2265  return NULL;
2266 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_IESPECIAL2
Definition: pidl.h:104
#define PT_NETWORK
Definition: pidl.h:101
smooth NULL
Definition: ftsmooth.c:416
#define PT_DRIVE2
Definition: pidl.h:89
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define PT_DRIVE
Definition: pidl.h:88
#define PT_YAGUID
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_IESPECIAL1
Definition: pidl.h:102
#define PT_COMP
Definition: pidl.h:99
#define PT_DRIVE1
Definition: pidl.h:92
#define PT_VALUE
Definition: pidl.h:95
#define PT_NETPROVIDER
Definition: pidl.h:100
#define PT_FOLDER
Definition: pidl.h:94
#define PT_SHARE
Definition: pidl.h:105
#define PT_GUID
#define PT_SHELLEXT

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

◆ _ILGetTextPointerW()

static LPWSTR _ILGetTextPointerW ( LPCITEMIDLIST  pidl)
static

Definition at line 2173 of file pidl.c.

2174 {
2175  /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2176 
2178 
2179  if (!pdata)
2180  return NULL;
2181 
2182  switch (pdata->type)
2183  {
2184  case PT_GUID:
2185  case PT_SHELLEXT:
2186  case PT_YAGUID:
2187  return NULL;
2188 
2189  case PT_DRIVE:
2190  case PT_DRIVE1:
2191  case PT_DRIVE2:
2192  case PT_DRIVE3:
2193  /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
2194  return NULL;
2195 
2196  case PT_FOLDER:
2197  case PT_FOLDER1:
2198  case PT_VALUE:
2199  case PT_IESPECIAL1:
2200  case PT_IESPECIAL2:
2201  /*return (LPSTR)&(pdata->u.file.szNames);*/
2202  return NULL;
2203 
2204  case PT_WORKGRP:
2205  case PT_COMP:
2206  case PT_NETWORK:
2207  case PT_NETPROVIDER:
2208  case PT_SHARE:
2209  /*return (LPSTR)&(pdata->u.network.szNames);*/
2210  return NULL;
2211 
2212  case PT_VALUEW:
2213  return (LPWSTR)pdata->u.file.szNames;
2214 
2215 #ifdef __REACTOS__ /* r54423 */
2216  case PT_CPLAPPLET:
2217  return pdata->u.cpanel.szName;
2218 #endif
2219 
2220  }
2221  return NULL;
2222 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_IESPECIAL2
Definition: pidl.h:104
#define PT_NETWORK
Definition: pidl.h:101
smooth NULL
Definition: ftsmooth.c:416
#define PT_DRIVE2
Definition: pidl.h:89
static PROTOCOLDATA * pdata
Definition: protocol.c:157
#define PT_DRIVE
Definition: pidl.h:88
#define PT_YAGUID
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_IESPECIAL1
Definition: pidl.h:102
#define PT_COMP
Definition: pidl.h:99
#define PT_DRIVE1
Definition: pidl.h:92
#define PT_VALUE
Definition: pidl.h:95
#define PT_NETPROVIDER
Definition: pidl.h:100
#define PT_FOLDER
Definition: pidl.h:94
#define PT_SHARE
Definition: pidl.h:105
#define PT_CPLAPPLET
Definition: pidl.h:86
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define PT_GUID
#define PT_VALUEW
Definition: pidl.h:96
#define PT_SHELLEXT

Referenced by _ILSimpleGetText(), and _ILSimpleGetTextW().

◆ _ILHACKCompareSimpleIds()

BOOL _ILHACKCompareSimpleIds ( LPCITEMIDLIST  pidltemp1,
LPCITEMIDLIST  pidltemp2 
)

Definition at line 479 of file pidl.c.

480 {
481  LPPIDLDATA pdata1 = _ILGetDataPointer(pidltemp1);
482  LPPIDLDATA pdata2 = _ILGetDataPointer(pidltemp2);
483 
484  IID *iid1 = _ILGetGUIDPointer(pidltemp1);
485  IID *iid2 = _ILGetGUIDPointer(pidltemp2);
486 
487  FileStructW* pDataW1 = _ILGetFileStructW(pidltemp1);
488  FileStructW* pDataW2 = _ILGetFileStructW(pidltemp2);
489 
490  if (_ILIsDesktop(pidltemp1) && _ILIsDesktop(pidltemp2))
491  {
492  return TRUE;
493  }
494  else if (_ILIsDesktop(pidltemp1) || _ILIsDesktop(pidltemp2))
495  {
496  return FALSE;
497  }
498  else if (iid1 || iid2)
499  {
500  if (!iid1 || !iid2 || memcmp(iid1, iid2, sizeof(GUID)))
501  return FALSE;
502  }
503  else if (pDataW1 || pDataW2)
504  {
505  if (!pDataW1 || !pDataW2 || wcsicmp(pDataW1->wszName, pDataW2->wszName))
506  return FALSE;
507  }
508  else if (_ILIsFolder(pidltemp1) || _ILIsFolder(pidltemp2))
509  {
510  if (!_ILIsFolder(pidltemp1) || !_ILIsFolder(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
511  return FALSE;
512  }
513  else if (_ILIsValue(pidltemp1) || _ILIsValue(pidltemp2))
514  {
515  if (!_ILIsValue(pidltemp1) || !_ILIsValue(pidltemp2) || strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
516  return FALSE;
517  }
518  else if (_ILIsDrive(pidltemp1) || _ILIsDrive(pidltemp2))
519  {
520  if (!_ILIsDrive(pidltemp1) || !_ILIsDrive(pidltemp2) || pdata1->u.drive.szDriveName[0] != pdata2->u.drive.szDriveName[0])
521  return FALSE;
522  }
523  else
524  {
525  return FALSE;
526  }
527 
528  return TRUE;
529 }
#define TRUE
Definition: types.h:120
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WCHAR wszName[1]
Definition: shlfolder.c:1555
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1951
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1939
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:1960
#define wcsicmp
Definition: string.h:1152
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2336
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

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

◆ _ILIsBitBucket()

BOOL _ILIsBitBucket ( LPCITEMIDLIST  pidl)

Definition at line 1917 of file pidl.c.

1918 {
1919  IID *iid = _ILGetGUIDPointer(pidl);
1920 
1921  TRACE("(%p)\n", pidl);
1922 
1923  if (iid)
1924  return IsEqualIID(iid, &CLSID_RecycleBin);
1925  return FALSE;
1926 }
#define TRACE(s)
Definition: solgame.cpp:4
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

Referenced by CGuidItemExtractIcon_CreateInstance(), and RegFolderContextMenuCallback().

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 1969 of file pidl.c.

1970 {
1971  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1972 
1973  TRACE("(%p)\n",pidl);
1974 
1975  return (pidl && lpPData && (lpPData->type == 0));
1976 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define TRACE(s)
Definition: solgame.cpp:4

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

◆ _ILIsDesktop()

BOOL _ILIsDesktop ( LPCITEMIDLIST  pidl)
inline

Definition at line 1877 of file pidl.c.

1878 {
1879  TRACE("(%p)\n",pidl);
1880 
1881  return !pidl || !pidl->mkid.cb;
1882 }
#define TRACE(s)
Definition: solgame.cpp:4

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

◆ _ILIsDrive()

BOOL _ILIsDrive ( LPCITEMIDLIST  pidl)

Definition at line 1939 of file pidl.c.

1940 {
1941  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1942 
1943  TRACE("(%p)\n",pidl);
1944 
1945  return (pidl && lpPData && (PT_DRIVE == lpPData->type ||
1946  PT_DRIVE1 == lpPData->type ||
1947  PT_DRIVE2 == lpPData->type ||
1948  PT_DRIVE3 == lpPData->type));
1949 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_DRIVE2
Definition: pidl.h:89
#define PT_DRIVE
Definition: pidl.h:88
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_DRIVE1
Definition: pidl.h:92

Referenced by _ILGetDrive(), _ILHACKCompareSimpleIds(), CDrivesFolder::CompareIDs(), CDrivesFolder::GetAttributesOf(), CFSFolder::GetAttributesOf(), CDrivesFolder::GetDetailsOf(), CDrivesFolder::GetDisplayNameOf(), CDrivesFolder::GetUIObjectOf(), CDrivesFolder::ParseDisplayName(), CDrivesFolder::SetNameOf(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILIsFolder()

BOOL _ILIsFolder ( LPCITEMIDLIST  pidl)

Definition at line 1951 of file pidl.c.

1952 {
1953  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1954 
1955  TRACE("(%p)\n",pidl);
1956 
1957  return (pidl && lpPData && (PT_FOLDER == lpPData->type || PT_FOLDER1 == lpPData->type));
1958 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_FOLDER
Definition: pidl.h:94

Referenced by CFSFolder::_GetDropTarget(), _ILGetFileStructW(), _ILHACKCompareSimpleIds(), AddFSClassKeysToArray(), CFSFolder::BindToObject(), CFSExtractIcon_CreateInstance(), CFSFolder::CompareIDs(), CDesktopFolder::GetAttributesOf(), CFSFolder::GetAttributesOf(), CFSFolder::GetDisplayNameOf(), CFSFolder::SetNameOf(), and SHELL32_GetFSItemAttributes().

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1906 of file pidl.c.

1907 {
1908  REFIID iid = _ILGetGUIDPointer(pidl);
1909 
1910  TRACE("(%p)\n",pidl);
1911 
1912  if (iid)
1913  return IsEqualIID(iid, &CLSID_MyComputer);
1914  return FALSE;
1915 }
#define REFIID
Definition: guiddef.h:113
#define TRACE(s)
Definition: solgame.cpp:4
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

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

◆ _ILIsMyDocuments()

BOOL _ILIsMyDocuments ( LPCITEMIDLIST  pidl)

Definition at line 1884 of file pidl.c.

1885 {
1886  IID *iid = _ILGetGUIDPointer(pidl);
1887 
1888  TRACE("(%p)\n", pidl);
1889 
1890  if (iid)
1891  return IsEqualIID(iid, &CLSID_MyDocuments);
1892  return FALSE;
1893 }
#define TRACE(s)
Definition: solgame.cpp:4
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ _ILIsNetHood()

BOOL _ILIsNetHood ( LPCITEMIDLIST  pidl)

Definition at line 1895 of file pidl.c.

1896 {
1897  IID *iid = _ILGetGUIDPointer(pidl);
1898 
1899  TRACE("(%p)\n", pidl);
1900 
1901  if (iid)
1902  return IsEqualIID(iid, &CLSID_NetworkPlaces);
1903  return FALSE;
1904 }
#define TRACE(s)
Definition: solgame.cpp:4
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 1981 of file pidl.c.

1982 {
1983  BOOL ret = TRUE;
1984 
1985  if(! _ILIsDesktop(pidl)) /* pidl=NULL or mkid.cb=0 */
1986  {
1987  WORD len = pidl->mkid.cb;
1988  LPCITEMIDLIST pidlnext = (LPCITEMIDLIST) (((const BYTE*)pidl) + len );
1989 
1990  if (pidlnext->mkid.cb)
1991  ret = FALSE;
1992  }
1993 
1994  TRACE("%s\n", ret ? "Yes" : "No");
1995  return ret;
1996 }
#define TRUE
Definition: types.h:120
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
int ret
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68

Referenced by SHBindToParent().

◆ _ILIsSpecialFolder()

BOOL _ILIsSpecialFolder ( LPCITEMIDLIST  pidl)

Definition at line 1928 of file pidl.c.

1929 {
1930  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1931 
1932  TRACE("(%p)\n",pidl);
1933 
1934  return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
1935  (pidl && pidl->mkid.cb == 0x00)
1936  ));
1937 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define PT_YAGUID
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_GUID
#define PT_SHELLEXT

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1868 of file pidl.c.

1869 {
1870  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1871 
1872  TRACE("(%p)\n",pidl);
1873 
1874  return (pidl && lpPData && PT_VALUEW == lpPData->type);
1875 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_VALUEW
Definition: pidl.h:96

Referenced by pdump().

◆ _ILIsValue()

BOOL _ILIsValue ( LPCITEMIDLIST  pidl)

Definition at line 1960 of file pidl.c.

1961 {
1962  LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1963 
1964  TRACE("(%p)\n",pidl);
1965 
1966  return (pidl && lpPData && PT_VALUE == lpPData->type);
1967 }
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2162
#define TRACE(s)
Definition: solgame.cpp:4
#define PT_VALUE
Definition: pidl.h:95

Referenced by _ILGetExtension(), _ILGetFileStructW(), _ILGetFileType(), _ILHACKCompareSimpleIds(), AddFSClassKeysToArray(), CDesktopFolder::GetAttributesOf(), CFSFolder::GetAttributesOf(), CFSFolder::GetUIObjectOf(), COpenWithMenu::Initialize(), OpenKeyFromFileType(), and SHELL32_GetFSItemAttributes().

◆ _ILParsePathW()

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

Definition at line 1030 of file pidl.c.

1032 {
1033  LPSHELLFOLDER pSF = NULL;
1034  LPBC pBC = NULL;
1035  HRESULT ret;
1036 
1037  TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
1038  ppidl, ppidl ? *ppidl : NULL,
1039  prgfInOut, prgfInOut ? *prgfInOut : 0);
1040 
1041  ret = SHGetDesktopFolder(&pSF);
1042  if (FAILED(ret))
1043  return ret;
1044 
1045  if (lpFindFile || bBindCtx)
1046  ret = IFileSystemBindData_Constructor(lpFindFile, &pBC);
1047 
1048  if (SUCCEEDED(ret))
1049  {
1050  ret = IShellFolder_ParseDisplayName(pSF, 0, pBC, (LPOLESTR)path, NULL, ppidl, prgfInOut);
1051  }
1052 
1053  if (pBC)
1054  {
1055  IBindCtx_Release(pBC);
1056  pBC = NULL;
1057  }
1058 
1059  IShellFolder_Release(pSF);
1060 
1061  if (FAILED(ret) && ppidl)
1062  *ppidl = NULL;
1063 
1064  TRACE("%s %p 0x%x\n", debugstr_w(path), ppidl ? *ppidl : NULL, prgfInOut ? *prgfInOut : 0);
1065 
1066  return ret;
1067 }
interface IBindCtx * LPBC
Definition: objfwd.h:18
static LPOLESTR
Definition: stg_prop.c:27
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
int ret
Definition: services.c:325
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by SHSimpleIDListFromPathA(), and SHSimpleIDListFromPathW().

◆ _ILSimpleGetText()

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

Definition at line 2010 of file pidl.c.

2011 {
2012  DWORD dwReturn=0;
2013  LPSTR szSrc;
2014  LPWSTR szSrcW;
2015  GUID const * riid;
2016  char szTemp[MAX_PATH];
2017 
2018  TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2019 
2020  if (!pidl)
2021  return 0;
2022 
2023  if (szOut)
2024  *szOut = 0;
2025 
2026  if (_ILIsDesktop(pidl))
2027  {
2028  /* desktop */
2029  if (HCR_GetClassNameA(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2030  {
2031  if (szOut)
2032  lstrcpynA(szOut, szTemp, uOutSize);
2033 
2034  dwReturn = strlen (szTemp);
2035  }
2036  }
2037  else if (( szSrc = _ILGetTextPointer(pidl) ))
2038  {
2039  /* filesystem */
2040  if (szOut)
2041  lstrcpynA(szOut, szSrc, uOutSize);
2042 
2043  dwReturn = strlen(szSrc);
2044  }
2045  else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2046  {
2047  /* unicode filesystem */
2048  WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
2049 
2050  if (szOut)
2051  lstrcpynA(szOut, szTemp, uOutSize);
2052 
2053  dwReturn = strlen (szTemp);
2054  }
2055  else if (( riid = _ILGetGUIDPointer(pidl) ))
2056  {
2057  /* special folder */
2058  if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
2059  {
2060  if (szOut)
2061  lstrcpynA(szOut, szTemp, uOutSize);
2062 
2063  dwReturn = strlen (szTemp);
2064  }
2065  }
2066  else
2067  {
2068  ERR("-- no text\n");
2069  }
2070 
2071  TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
2072  return dwReturn;
2073 }
#define WideCharToMultiByte
Definition: compat.h:101
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
REFIID riid
Definition: precomp.h:44
#define CP_ACP
Definition: compat.h:99
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2173
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define MAX_PATH
Definition: compat.h:26
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:423
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
#define ERR(fmt,...)
Definition: debug.h:109
#define lstrcpynA
Definition: compat.h:408
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _ILGetDrive(), and _ILGetExtension().

◆ _ILSimpleGetTextW()

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

Definition at line 2082 of file pidl.c.

2083 {
2084  DWORD dwReturn;
2085  FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2086 
2087  TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2088 
2089  if (pFileStructW) {
2090  lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2091  dwReturn = lstrlenW(pFileStructW->wszName);
2092  } else {
2093  GUID const * riid;
2094  WCHAR szTemp[MAX_PATH];
2095  LPSTR szSrc;
2096  LPWSTR szSrcW;
2097  dwReturn=0;
2098 
2099  if (!pidl)
2100  return 0;
2101 
2102  if (szOut)
2103  *szOut = 0;
2104 
2105  if (_ILIsDesktop(pidl))
2106  {
2107  /* desktop */
2108  if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2109  {
2110  if (szOut)
2111  lstrcpynW(szOut, szTemp, uOutSize);
2112 
2113  dwReturn = lstrlenW (szTemp);
2114  }
2115  }
2116  else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2117  {
2118  /* unicode filesystem */
2119  if (szOut)
2120  lstrcpynW(szOut, szSrcW, uOutSize);
2121 
2122  dwReturn = lstrlenW(szSrcW);
2123  }
2124  else if (( szSrc = _ILGetTextPointer(pidl) ))
2125  {
2126  /* filesystem */
2127  MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, MAX_PATH);
2128 
2129  if (szOut)
2130  lstrcpynW(szOut, szTemp, uOutSize);
2131 
2132  dwReturn = lstrlenW (szTemp);
2133  }
2134  else if (( riid = _ILGetGUIDPointer(pidl) ))
2135  {
2136  /* special folder */
2137  if ( HCR_GetClassNameW(riid, szTemp, MAX_PATH) )
2138  {
2139  if (szOut)
2140  lstrcpynW(szOut, szTemp, uOutSize);
2141 
2142  dwReturn = lstrlenW (szTemp);
2143  }
2144  }
2145  else
2146  {
2147  ERR("-- no text\n");
2148  }
2149  }
2150 
2151  TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2152  return dwReturn;
2153 }
REFIID riid
Definition: precomp.h:44
#define CP_ACP
Definition: compat.h:99
WCHAR wszName[1]
Definition: shlfolder.c:1555
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2173
char * LPSTR
Definition: xmlstorage.h:182
#define lstrlenW
Definition: compat.h:407
#define lstrcpynW
Definition: compat.h:397
#define debugstr_w
Definition: kernel32.h:32
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2300
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
#define ERR(fmt,...)
Definition: debug.h:109
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2336
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:346

Referenced by CDesktopFolder::_GetSFFromPidl(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), RenderHDROP(), and CDrivesFolder::SetNameOf().

◆ Alloc()

LPVOID WINAPI Alloc ( INT  )

Referenced by ILGlobalClone().

◆ Free()

BOOL WINAPI Free ( LPVOID  )

Definition at line 116 of file comctl32undoc.c.

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

Referenced by AddMRUData(), AddMRUStringA(), FindMRUData(), FindMRUStringA(), FreeMRUList(), ILGlobalFree(), Str_SetPtrAtoW(), and Str_SetPtrWtoA().

◆ ILAppendID()

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

Definition at line 885 of file pidl.c.

886 {
887  LPITEMIDLIST idlRet;
888  LPCITEMIDLIST itemid = (LPCITEMIDLIST)item;
889 
890  WARN("(pidl=%p,pidl=%p,%08u)semi-stub\n",pidl,item,bEnd);
891 
892  pdump (pidl);
893  pdump (itemid);
894 
895  if (_ILIsDesktop(pidl))
896  {
897  idlRet = ILClone(itemid);
898  SHFree (pidl);
899  return idlRet;
900  }
901 
902  if (bEnd)
903  idlRet = ILCombine(pidl, itemid);
904  else
905  idlRet = ILCombine(itemid, pidl);
906 
907  SHFree(pidl);
908  return idlRet;
909 }
#define WARN(fmt,...)
Definition: debug.h:111
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
MaybeUInt64 bEnd[BZ_MAX_HANDLED_BLOCKS]
Definition: bzip2recover.c:297
static ATOM item
Definition: dde.c:856
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by init_function_pointers().

◆ ILClone()

LPITEMIDLIST WINAPI ILClone ( LPCITEMIDLIST  pidl)

Definition at line 228 of file pidl.c.

229 {
230  DWORD len;
231  LPITEMIDLIST newpidl;
232 
233  if (!pidl)
234  return NULL;
235 
236  len = ILGetSize(pidl);
237  newpidl = SHAlloc(len);
238  if (newpidl)
239  memcpy(newpidl,pidl,len);
240 
241  TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
242  pdump(pidl);
243 
244  return newpidl;
245 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:815
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

Referenced by _ILCopyaPidl(), _ILCopyCidaToaPidl(), _ILReadFromSharedMemory(), CAddressEditBox::AddComboBoxItem(), CMergedFolder::AddNameSpace(), CEnumMergedFolder::Begin(), CDesktopBrowser::BrowseObject(), CShellBrowser::BrowseToPath(), BrsFolder_OnCommand(), BrsFolder_Treeview_Changed(), CFSFolder::CallBack(), ExplorerMessageLoop(), FILEDLG95_LOOKIN_AddItem(), FM_SetMenuParameter(), CShellItem::get_parent_pidl(), get_to_absolute_pidl(), CISFBand::GetBandInfoSFB(), CNetworkConnections::GetCurFolder(), CRecycleBin::GetCurFolder(), CMyDocsFolder::GetCurFolder(), CAdminToolsFolder::GetCurFolder(), CFontsFolder::GetCurFolder(), CNetFolder::GetCurFolder(), CPrinterFolder::GetCurFolder(), CControlPanelFolder::GetCurFolder(), CDrivesFolder::GetCurFolder(), CDesktopFolder::GetCurFolder(), CFSFolder::GetCurFolder(), CZipFolder::GetCurFolder(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetCurFolder(), CShellItem::GetIDList(), CShellLink::GetIDList(), GetParentPidl(), CTravelEntry::GetPidl(), CShellBrowser::GetPidl(), GetPidlFromDataObject(), CMenuSFToolbar::GetShellFolder(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetUIObjectOf(), CShellBrowser::GetWindowData(), ILAppendID(), ILCombine(), init_function_pointers(), CNtObjectFolderExtractIcon::Initialize(), CRegistryFolderExtractIcon::Initialize(), CFolderItem::Initialize(), CNetworkConnections::Initialize(), CFolder::Initialize(), CRecycleBin::Initialize(), CMyDocsFolder::Initialize(), CAdminToolsFolder::Initialize(), CFontsFolder::Initialize(), CNetFolder::Initialize(), CPrinterFolder::Initialize(), CControlPanelFolder::Initialize(), CFolderItems::Initialize(), CFSFolder::Initialize(), CRegistryFolder::Initialize(), CNewMenu::Initialize(), CNtObjectFolder::Initialize(), CRecycleBinItemContextMenu::Initialize(), CDefaultContextMenu::Initialize(), CIDLDataObj::Initialize(), CMergedFolder::Initialize(), CRegFolder::Initialize(), CZipFolder::Initialize(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::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(), CAddressEditBox::OnWinEvent(), CMergedFolder::ParseDisplayName(), ParseSharedPacket(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), CExplorerBand::RenameItem(), CShellItem::SetIDList(), CRegFolder::SetNameOf(), CMenuSFToolbar::SetShellFolder(), CShellLink::SetTargetFromPIDLOrPath(), SHBindToFolderIDListParent(), SHBindToParent(), SHChangeNotify(), SHChangeNotifyRegister(), SHCloneIETHREADPARAM(), SHCreateFromDesktop(), SHCreateShellItem(), SHGetFileInfoW(), and CExplorerBand::UpdateBrowser().

◆ ILCloneFirst()

LPITEMIDLIST WINAPI ILCloneFirst ( LPCITEMIDLIST  pidl)

Definition at line 253 of file pidl.c.

254 {
255  DWORD len;
256  LPITEMIDLIST pidlNew = NULL;
257 
258  TRACE("pidl=%p\n", pidl);
259  pdump(pidl);
260 
261  if (pidl)
262  {
263  len = pidl->mkid.cb;
264  pidlNew = SHAlloc(len+2);
265  if (pidlNew)
266  {
267  memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */
268 
269  if (len)
270  ILGetNext(pidlNew)->mkid.cb = 0x00;
271  }
272  }
273  TRACE("-- newpidl=%p\n",pidlNew);
274 
275  return pidlNew;
276 }
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

Referenced by CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::BindToObject(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::CompareIDs(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetDisplayNameOf(), init_function_pointers(), SHELL32_BindToSF(), SHELL32_CompareChildren(), and SHELL32_GetDisplayNameOfChild().

◆ ILCombine()

LPITEMIDLIST WINAPI ILCombine ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 699 of file pidl.c.

700 {
701  DWORD len1,len2;
702  LPITEMIDLIST pidlNew;
703 
704  TRACE("pidl=%p pidl=%p\n",pidl1,pidl2);
705 
706  if (!pidl1 && !pidl2) return NULL;
707 
708  pdump (pidl1);
709  pdump (pidl2);
710 
711  if (!pidl1)
712  {
713  pidlNew = ILClone(pidl2);
714  return pidlNew;
715  }
716 
717  if (!pidl2)
718  {
719  pidlNew = ILClone(pidl1);
720  return pidlNew;
721  }
722 
723  len1 = ILGetSize(pidl1)-2;
724  len2 = ILGetSize(pidl2);
725  pidlNew = SHAlloc(len1+len2);
726 
727  if (pidlNew)
728  {
729  memcpy(pidlNew,pidl1,len1);
730  memcpy(((BYTE *)pidlNew)+len1,pidl2,len2);
731  }
732 
733  /* TRACE(pidl,"--new pidl=%p\n",pidlNew);*/
734  return pidlNew;
735 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:815
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309

Referenced by _ILCreateControlPanel(), _ILCreatePrinters(), _ReparsePIDL(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::BindToObject(), ShellPath::create_absolute_pidl(), FILEDLG95_LOOKIN_Init(), CAddressEditBox::FillOneLevel(), FM_InitMenuPopup(), get_to_absolute_pidl(), ICommDlgBrowser3_fnIncludeObject(), ILAppendID(), init_function_pointers(), COpenWithMenu::Initialize(), CZipFolder::Initialize(), CExplorerBand::InsertSubitems(), InsertTreeViewItem(), CDefaultContextMenu::InvokePidl(), IShellBrowserImpl_BrowseObject(), CExplorerBand::OnWinEvent(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::ParseDisplayName(), CFolder::ParseName(), CAddressEditBox::ParseNow(), CExplorerBand::RefreshTreePidl(), RenderFILENAMEA(), RenderFILENAMEW(), RenderHDROP(), SH_ShowDriveProperties(), SHChangeNotify(), SHCreateShellItem(), SHELL32_CoCreateInitSF(), SHELL32_ParseNextElement(), SHGetRealIDL(), SHOpenFolderAndSelectItems(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), and CDefaultContextMenu::TryToBrowse().

◆ ILCreateFromPathA()

LPITEMIDLIST WINAPI ILCreateFromPathA ( LPCSTR  path)

Definition at line 966 of file pidl.c.

967 {
968  LPITEMIDLIST pidlnew = NULL;
969 
970  TRACE_(shell)("%s\n", debugstr_a(path));
971 
972  if (SUCCEEDED(SHILCreateFromPathA(path, &pidlnew, NULL)))
973  return pidlnew;
974  return NULL;
975 }
HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:380
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
#define debugstr_a
Definition: kernel32.h:31
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by ILCreateFromPathAW(), and init_function_pointers().

◆ ILCreateFromPathAW()

LPITEMIDLIST WINAPI ILCreateFromPathAW ( LPCVOID  path)

Definition at line 996 of file pidl.c.

997 {
998  if ( SHELL_OsIsUnicode())
999  return ILCreateFromPathW (path);
1000  return ILCreateFromPathA (path);
1001 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path)
Definition: pidl.c:966
Definition: services.c:325
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:982

◆ ILCreateFromPathW()

LPITEMIDLIST WINAPI ILCreateFromPathW ( LPCWSTR  path)

Definition at line 982 of file pidl.c.

983 {
984  LPITEMIDLIST pidlnew = NULL;
985 
986  TRACE_(shell)("%s\n", debugstr_w(path));
987 
988  if (SUCCEEDED(SHILCreateFromPathW(path, &pidlnew, NULL)))
989  return pidlnew;
990  return NULL;
991 }
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:392
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CBandSiteMenu::_GetQLaunchPidl(), DDE_OnViewFolder(), DDW_OnExploreFolder(), ILCreateFromPathAW(), init_function_pointers(), SHCreateFromDesktop(), shellex_get_dataobj(), and SHExplorerParseCmdLine().

◆ ILFindChild()

LPITEMIDLIST WINAPI ILFindChild ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 641 of file pidl.c.

642 {
643  LPCITEMIDLIST pidltemp1 = pidl1;
644  LPCITEMIDLIST pidltemp2 = pidl2;
646 
647  TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
648 
649  /* explorer reads from registry directly (StreamMRU),
650  so we can only check here */
651  if ((!pcheck (pidl1)) || (!pcheck (pidl2)))
652  return FALSE;
653 
654  pdump (pidl1);
655  pdump (pidl2);
656 
657  if (_ILIsDesktop(pidl1))
658  {
659  ret = pidl2;
660  }
661  else
662  {
663  while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
664  {
665  if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
666  return FALSE;
667 
668  pidltemp1 = ILGetNext(pidltemp1);
669  pidltemp2 = ILGetNext(pidltemp2);
670  ret = pidltemp2;
671  }
672 
673  if (pidltemp1->mkid.cb)
674  ret = NULL; /* elements of pidl1 left*/
675  }
676  TRACE_(shell)("--- %p\n", ret);
677  return (LPITEMIDLIST)ret; /* pidl 1 is shorter */
678 }
BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
Definition: pidl.c:479
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
#define TRACE(s)
Definition: solgame.cpp:4
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1877
int ret
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:336
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

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

◆ ILFindLastID()

LPITEMIDLIST WINAPI ILFindLastID ( LPCITEMIDLIST  pidl)

Definition at line 189 of file pidl.c.

190 {
191  LPCITEMIDLIST pidlLast = pidl;
192 
193  TRACE("(pidl=%p)\n",pidl);
194 
195  if (!pidl)
196  return NULL;
197 
198  while (pidl->mkid.cb)
199  {
200  pidlLast = pidl;
201  pidl = ILGetNext(pidl);
202  }
203  return (LPITEMIDLIST)pidlLast;
204 }
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by _ILGetExtension(), CShellItem::BindToHandler(), CFSFolder::CallBack(), CDefaultContextMenu::DoCreateNewFolder(), CNetworkConnections::Execute(), ExplorerMessageLoop(), ShellDirectory::find_entry(), CShellItem::GetAttributes(), CFSFolder::GetAttributesOf(), getIconLocationForFolder(), ILRemoveLastID(), init_function_pointers(), InitializeTreeView(), loadShell32(), CExplorerBand::NavigateToPIDL(), CDefView::OnChangeNotify(), CStartMenuBtnCtxMenu::QueryContextMenu(), CDefView::RemoveObject(), CExplorerBand::RenameItem(), CNewMenu::SelectNewItem(), CFSFolder::SetNameOf(), SHBindToFolderIDListParent(), SHBindToParent(), test_GetDisplayName(), and test_ParseDisplayName().

◆ ILFree()

void WINAPI ILFree ( LPITEMIDLIST  pidl)

Definition at line 925 of file pidl.c.

926 {
927  TRACE("(pidl=%p)\n",pidl);
928  SHFree(pidl);
929 }
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

Referenced by CMenuBand::_CallCB(), _ReparsePIDL(), _tmain(), CEnumMergedFolder::Begin(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::BindToObject(), BrowseSelectedFolder(), CShellBrowser::BrowseToPath(), BrsFolder_OnSetExpanded(), BrsFolder_Treeview_Changed(), CFSFolder::CallBack(), CShellItem::Compare(), CEnumMergedFolder::DsaDeleteCallback(), ebrowser_browse_to_desktop(), 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< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetDisplayNameOf(), GetFavoritesFolder(), GetFileDialog95(), GetMergedFolder(), GetNormalAndSelectedIcons(), CMenuCallback::GetObject(), CShellItem::GetParent(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetUIObjectOf(), ICommDlgBrowser3_fnIncludeObject(), IEGetNameAndFlagsEx(), ILIsParentOrSpecialParent(), CExplorerBand::InitializeExplorerBand(), InitializeTreeView(), CExplorerBand::InsertSubitems(), CAddressEditBox::Invoke(), CDefaultContextMenu::InvokePidl(), IShellBrowserImpl_BrowseObject(), IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(), CShellBrowser::LoadHistory(), CShellBrowser::NavigateToParent(), on_default_action(), CMenuSFToolbar::OnDeletingButton(), CShellBrowser::OnDestroy(), CExplorerBand::OnShellEvent(), CExplorerBand::OnTreeItemDeleted(), CAddressEditBox::OnWinEvent(), CExplorerBand::OnWinEvent(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::ParseDisplayName(), CAddressEditBox::ParseNow(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), CExplorerBand::RefreshTreePidl(), CExplorerBand::RenameItem(), RenderHDROP(), CShellLink::Reset(), RSHELL_CStartMenu_CreateInstance(), CShellItem::SetIDList(), CShellLink::SetTargetFromPIDLOrPath(), SH_ShowDriveProperties(), SHBindToFolderIDListParent(), SHBrowseForFolderW(), SHChangeNotify(), SHCreateShellItem(), SHDestroyIETHREADPARAM(), SHELL32_BindToSF(), SHELL32_CoCreateInitSF(), SHELL32_CompareChildren(), SHELL32_GetDisplayNameOfChild(), SHELL32_ParseNextElement(), SHExplorerParseCmdLine(), SHGetFileInfoW(), SHOpenNewFrame(), StartWithCommandLine(), test_basics(), test_BindToObject(), test_DataObject(), 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(), CTravelEntry::Update(), CExplorerBand::UpdateBrowser(), CAddressEditBox::~CAddressEditBox(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::~CCommonFolder(), CExplorerBand::~CExplorerBand(), CIDLDataObj::~CIDLDataObj(), CMergedFolder::~CMergedFolder(), CNewMenu::~CNewMenu(), CNtObjectFolderExtractIcon::~CNtObjectFolderExtractIcon(), CRecycleBinItemContextMenu::~CRecycleBinItemContextMenu(), CRegistryFolderExtractIcon::~CRegistryFolderExtractIcon(), CShellItem::~CShellItem(), CShellLink::~CShellLink(), CStartMenuBtnCtxMenu::~CStartMenuBtnCtxMenu(), and CTravelEntry::~CTravelEntry().

◆ ILGetDisplayName()

BOOL WINAPI ILGetDisplayName ( LPCITEMIDLIST  pidl,
LPVOID  path 
)

Definition at line 174 of file pidl.c.

175 {
176  TRACE_(shell)("%p %p\n", pidl, path);
177 
178  if (SHELL_OsIsUnicode())
181 }
GLsizei const GLchar ** path
Definition: glext.h:7234
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
#define ILGDN_FORPARSING
Definition: undocshell.h:68
smooth NULL
Definition: ftsmooth.c:416
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
#define TRACE_(x)
Definition: compat.h:66
static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
Definition: pidl.c:74
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325

◆ ILGetDisplayNameEx()

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

Definition at line 162 of file pidl.c.

163 {
164  TRACE_(shell)("%p %p %p %d\n", psf, pidl, path, type);
165 
166  if (SHELL_OsIsUnicode())
167  return ILGetDisplayNameExW(psf, pidl, path, type);
168  return ILGetDisplayNameExA(psf, pidl, path, type);
169 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
#define TRACE_(x)
Definition: compat.h:66
static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR path, DWORD type)
Definition: pidl.c:74
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325

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

75 {
76  BOOL ret = FALSE;
77  WCHAR wPath[MAX_PATH];
78 
79  TRACE("%p %p %p %d\n", psf, pidl, path, type);
80 
81  if (!pidl || !path)
82  return FALSE;
83 
84  ret = ILGetDisplayNameExW(psf, pidl, wPath, type);
85  WideCharToMultiByte(CP_ACP, 0, wPath, -1, path, MAX_PATH, NULL, NULL);
86  TRACE("%p %p %s\n", psf, pidl, debugstr_a(path));
87 
88  return ret;
89 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:91
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:26
int ret
Definition: services.c:325

Referenced by ILGetDisplayName(), and ILGetDisplayNameEx().

◆ ILGetDisplayNameExW()

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

Definition at line 91 of file pidl.c.

92 {
93  LPSHELLFOLDER psfParent, lsf = psf;
95  LPCITEMIDLIST pidllast;
96  STRRET strret;
97  DWORD flag;
98 
99  TRACE("%p %p %p %x\n", psf, pidl, path, type);
100 
101  if (!pidl || !path)
102  return FALSE;
103 
104  if (!lsf)
105  {
106  ret = SHGetDesktopFolder(&lsf);
107  if (FAILED(ret))
108  return FALSE;
109  }
110 
111  switch (type)
112  {
113  case ILGDN_FORPARSING:
114  flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
115  break;
116  case ILGDN_NORMAL:
117  flag = SHGDN_NORMAL;
118  break;
119  case ILGDN_INFOLDER:
120  flag = SHGDN_INFOLDER;
121  break;
122  default:
123  FIXME("Unknown type parameter = %x\n", type);
124  flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
125  break;
126  }
127 
128  if (!*(const WORD*)pidl || type == ILGDN_FORPARSING)
129  {
130  ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
131  if (SUCCEEDED(ret))
132  {
133  if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
134  ret = E_FAIL;
135  }
136  }
137  else
138  {
139  ret = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidllast);
140  if (SUCCEEDED(ret))
141  {
142  ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
143  if (SUCCEEDED(ret))
144  {
145  if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
146  ret = E_FAIL;
147  }
148  IShellFolder_Release(psfParent);
149  }
150  }
151 
152  TRACE("%p %p %s\n", psf, pidl, debugstr_w(path));
153 
154  if (!psf)
155  IShellFolder_Release(lsf);
156  return SUCCEEDED(ret);
157 }
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
#define ILGDN_FORPARSING
Definition: undocshell.h:68
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define ILGDN_NORMAL
Definition: undocshell.h:69
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
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
#define ILGDN_INFOLDER
Definition: undocshell.h:70
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1323
Definition: services.c:325
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:84
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ ILGetNext()

LPITEMIDLIST WINAPI ILGetNext ( LPCITEMIDLIST  pidl)

Definition at line 851 of file pidl.c.

852 {
853  WORD len;
854 
855  TRACE("%p\n", pidl);
856 
857  if (pidl)
858  {
859  len = pidl->mkid.cb;
860  if (len)
861  {
862  pidl = (LPCITEMIDLIST) (((const BYTE*)pidl)+len);
863  TRACE("-- %p\n", pidl);
864  return (LPITEMIDLIST)pidl;
865  }
866  }
867  return NULL;
868 }
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by _ILAlloc(), _ILGetDrive(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::BindToObject(), CZipFolder::BindToObject(), BrsFolder_OnSetExpanded(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::CompareIDs(), CZipFolder::CompareIDs(), DumpIdList(), ExplorerMessageLoop(), FILEDLG95_LOOKIN_AddItem(), CZipFolder::GetDetailsOf(), CFontsFolder::GetDisplayNameOf(), CAdminToolsFolder::GetDisplayNameOf(), CMyDocsFolder::GetDisplayNameOf(), CZipFolder::GetDisplayNameOf(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetDisplayNameOf(), ILCloneFirst(), ILFindChild(), ILFindLastID(), ILIsEqual(), ILIsParent(), init_function_pointers(), CAddressEditBox::PopulateComboBox(), SHELL32_BindToSF(), SHELL32_CompareChildren(), SHELL32_GetDisplayNameOfChild(), and SHOpenFolderAndSelectItems().

◆ ILGetSize()

UINT WINAPI ILGetSize ( LPCITEMIDLIST  pidl)

Definition at line 815 of file pidl.c.

816 {
817  LPCSHITEMID si;
818  UINT len=0;
819 
820  if (pidl)
821  {
822  si = &(pidl->mkid);
823 
824  while (si->cb)
825  {
826  len += si->cb;
827  si = (LPCSHITEMID)(((const BYTE*)si)+si->cb);
828  }
829  len += 2;
830  }
831  TRACE("pidl=%p size=%u\n",pidl, len);
832  return len;
833 }
const SHITEMID * LPCSHITEMID
Definition: shtypes.idl:30
WORD cb
Definition: shtypes.idl:27
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
unsigned int UINT
Definition: ndis.h:50

Referenced by ILClone(), ILCombine(), ILGlobalClone(), and ILSaveToStream().

◆ ILGlobalClone()

LPITEMIDLIST WINAPI ILGlobalClone ( LPCITEMIDLIST  pidl)

Definition at line 460 of file pidl.c.

461 {
462  DWORD len;
463  LPITEMIDLIST newpidl;
464 
465  if (!pidl)
466  return NULL;
467 
468  len = ILGetSize(pidl);
469  newpidl = Alloc(len);
470  if (newpidl)
471  memcpy(newpidl,pidl,len);
472 
473  TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
474  pdump(pidl);
475 
476  return newpidl;
477 }
LPVOID WINAPI Alloc(INT)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:815
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

◆ ILGlobalFree()

void WINAPI ILGlobalFree ( LPITEMIDLIST  pidl)

Definition at line 945 of file pidl.c.

946 {
947  TRACE("%p\n", pidl);
948 
949  Free(pidl);
950 }
BOOL WINAPI Free(LPVOID)
#define TRACE(s)
Definition: solgame.cpp:4

◆ ILIsEqual()

BOOL WINAPI ILIsEqual ( LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 535 of file pidl.c.

536 {
537  LPCITEMIDLIST pidltemp1 = pidl1;
538  LPCITEMIDLIST pidltemp2 = pidl2;
539 
540  TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
541 
542  /*
543  * Explorer reads from registry directly (StreamMRU),
544  * so we can only check here
545  */
546  if (!pcheck(pidl1) || !pcheck (pidl2))
547  return FALSE;
548 
549  pdump (pidl1);
550  pdump (pidl2);
551 
552  if (!pidl1 || !pidl2)
553  return FALSE;
554 
555  while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
556  {
557  if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
558  return FALSE;
559 
560  pidltemp1 = ILGetNext(pidltemp1);
561  pidltemp2 = ILGetNext(pidltemp2);
562  }
563 
564  if (!pidltemp1->mkid.cb && !pidltemp2->mkid.cb)
565  return TRUE;
566 
567  return FALSE;
568 }
#define TRUE
Definition: types.h:120
BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
Definition: pidl.c:479
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
#define TRACE(s)
Definition: solgame.cpp:4
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:336

Referenced by FILEDLG95_LOOKIN_Init(), FILEDLG95_LOOKIN_SearchItem(), FILEDLG95_OnOpen(), CAddressEditBox::FillOneLevel(), init_function_pointers(), IShellBrowserImpl_BrowseObject(), CAddressEditBox::PopulateComboBox(), should_notify(), 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 592 of file pidl.c.

593 {
594  LPCITEMIDLIST pParent = pidlParent;
595  LPCITEMIDLIST pChild = pidlChild;
596 
597  TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate);
598 
599  if (!pParent || !pChild)
600  return FALSE;
601 
602  while (pParent->mkid.cb && pChild->mkid.cb)
603  {
604  if (!_ILHACKCompareSimpleIds(pParent, pChild))
605  return FALSE;
606 
607  pParent = ILGetNext(pParent);
608  pChild = ILGetNext(pChild);
609  }
610 
611  /* child has shorter name than parent */
612  if (pParent->mkid.cb)
613  return FALSE;
614 
615  /* not immediate descent */
616  if ((!pChild->mkid.cb || ILGetNext(pChild)->mkid.cb) && bImmediate)
617  return FALSE;
618 
619  return TRUE;
620 }
#define TRUE
Definition: types.h:120
BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
Definition: pidl.c:479
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ILIsParentOrSpecialParent(), init_function_pointers(), and should_notify().

◆ ILLoadFromStream()

HRESULT WINAPI ILLoadFromStream ( IStream pStream,
LPITEMIDLIST ppPidl 
)

Definition at line 284 of file pidl.c.

285 {
286  WORD wLen = 0;
287  DWORD dwBytesRead;
288  HRESULT ret = E_FAIL;
289 
290 
291  TRACE_(shell)("%p %p\n", pStream , ppPidl);
292 
293  SHFree(*ppPidl);
294  *ppPidl = NULL;
295 
296  IStream_AddRef (pStream);
297 
298  if (SUCCEEDED(IStream_Read(pStream, &wLen, 2, &dwBytesRead)))
299  {
300  TRACE("PIDL length is %d\n", wLen);
301  if (wLen != 0)
302  {
303  *ppPidl = SHAlloc (wLen);
304  if (SUCCEEDED(IStream_Read(pStream, *ppPidl , wLen, &dwBytesRead)))
305  {
306  TRACE("Stream read OK\n");
307  ret = S_OK;
308  }
309  else
310  {
311  WARN("reading pidl failed\n");
312  SHFree(*ppPidl);
313  *ppPidl = NULL;
314  }
315  }
316  else
317  {
318  *ppPidl = NULL;
319  ret = S_OK;
320  }
321  }
322 
323  /* we are not yet fully compatible */
324  if (*ppPidl && !pcheck(*ppPidl))
325  {
326  WARN("Check failed\n");
327  SHFree(*ppPidl);
328  *ppPidl = NULL;
329  }
330 
331  IStream_Release (pStream);
332  TRACE("done\n");
333  return ret;
334 }
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define S_OK
Definition: intsafe.h:59
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:336
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CShellLink::Load().

◆ ILRemoveLastID()

BOOL WINAPI ILRemoveLastID ( LPITEMIDLIST  pidl)

Definition at line 212 of file pidl.c.

213 {
214  TRACE_(shell)("pidl=%p\n",pidl);
215 
216  if (_ILIsEmpty(pidl))
217  return FALSE;
218  ILFindLastID(pidl)->mkid.cb = 0;
219  return TRUE;
220 }
#define TRUE
Definition: types.h:120
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:256
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
#define TRACE_(x)
Definition: compat.h:66
void shell(int argc, const char *argv[])
Definition: cmds.c:1231

Referenced by CFSFolder::CallBack(), ExplorerMessageLoop(), CShellItem::get_parent_pidl(), GetParentPidl(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetUIObjectOf(), init_function_pointers(), InitializeTreeView(), CShellBrowser::NavigateToParent(), CAddressEditBox::PopulateComboBox(), CStartMenuBtnCtxMenu::QueryContextMenu(), SHBindToFolderIDListParent(), SHBindToParent(), and SHChangeNotify().

◆ ILSaveToStream()

HRESULT WINAPI ILSaveToStream ( IStream pStream,
LPCITEMIDLIST  pPidl 
)

Definition at line 342 of file pidl.c.

343 {
344  WORD wLen = 0;
345  HRESULT ret = E_FAIL;
346 
347  TRACE_(shell)("%p %p\n", pStream, pPidl);
348 
349  IStream_AddRef (pStream);
350 
351  wLen = ILGetSize(pPidl);
352 
353  if (SUCCEEDED(IStream_Write(pStream, &wLen, 2, NULL)))
354  {
355  if (SUCCEEDED(IStream_Write(pStream, pPidl, wLen, NULL)))
356  ret = S_OK;
357  }
358  IStream_Release (pStream);
359 
360  return ret;
361 }
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
LONG HRESULT
Definition: typedefs.h:77
unsigned short WORD
Definition: ntddk_ex.h:93
int ret
#define S_OK
Definition: intsafe.h:59
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:815
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ SHBindToParent()

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

Definition at line 1323 of file pidl.c.

1324 {
1325  IShellFolder * psfDesktop;
1326  HRESULT hr=E_FAIL;
1327 
1328  TRACE_(shell)("pidl=%p\n", pidl);
1329  pdump(pidl);
1330 
1331  if (!pidl || !ppv)
1332  return E_INVALIDARG;
1333 
1334  *ppv = NULL;
1335  if (ppidlLast)
1336  *ppidlLast = NULL;
1337 
1338  hr = SHGetDesktopFolder(&psfDesktop);
1339  if (FAILED(hr))
1340  return hr;
1341 
1342  if (_ILIsPidlSimple(pidl))
1343  {
1344  /* we are on desktop level */
1345  hr = IShellFolder_QueryInterface(psfDesktop, riid, ppv);
1346  }
1347  else
1348  {
1349  LPITEMIDLIST pidlParent = ILClone(pidl);
1350  ILRemoveLastID(pidlParent);
1351  hr = IShellFolder_BindToObject(psfDesktop, pidlParent, NULL, riid, ppv);
1352  SHFree (pidlParent);
1353  }
1354 
1355  IShellFolder_Release(psfDesktop);
1356 
1357  if (SUCCEEDED(hr) && ppidlLast)
1358  *ppidlLast = ILFindLastID(pidl);
1359 
1360  TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08x\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
1361  return hr;
1362 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:212
#define E_FAIL
Definition: ddrawi.h:102
BOOL _ILIsPidlSimple(LPCITEMIDLIST pidl)
Definition: pidl.c:1981
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:189
#define TRACE_(x)
Definition: compat.h:66
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by _ReparsePIDL(), CAddressEditBox::AddComboBoxItem(), CShellBrowser::BrowseToPath(), ChildWndProc(), CreateIDataObject(), Entry::do_context_menu(), CShellLink::DragEnter(), CExplorerBand::DragOver(), CAddressEditBox::Execute(), CFolderItem::get_Name(), CFSFolder::GetAttributesOf(), GetDisplayName(), CCommonFolder< CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon >::GetUIObjectOf(), ILGetDisplayNameExW(), CFolderItemVerbs::Init(), CExplorerBand::InsertItem(), CAddressEditBox::Invoke(), CExplorerBand::OnContextMenu(), CExplorerBand::OnTreeItemDragging(), CExplorerBand::OnWinEvent(), r_verify_pidl(), RSHELL_CStartMenu_CreateInstance(), SHELL_execute(), SHELL_PidlGetIconLocationW(), SHGetFileInfoW(), SHGetNameFromIDList(), SHGetPathFromIDListW(), test_GetDisplayName(), test_GetUIObject(), and test_SHCreateDefaultContextMenu().

◆ SHCloneSpecialIDList()

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

Definition at line 434 of file pidl.c.

435 {
436  LPITEMIDLIST ppidl;
437  TRACE_(shell)("(hwnd=%p,csidl=0x%x,%s).\n", hwndOwner, nFolder, fCreate ? "T" : "F");
438 
439  if (fCreate)
441 
442  SHGetSpecialFolderLocation(hwndOwner, nFolder, &ppidl);
443  return ppidl;
444 }
_In_ int nFolder
Definition: shlobj.h:1435
#define TRACE_(x)
Definition: compat.h:66
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2687
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define CSIDL_FLAG_CREATE
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by CStartMenuBtnCtxMenu::QueryContextMenu().

◆ SHGetDataFromIDListA()

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

Definition at line 1136 of file pidl.c.

1138 {
1139  LPSTR filename, shortname;
1141 
1142  TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1143 
1144  pdump(pidl);
1145  if (!psf || !dest)
1146  return E_INVALIDARG;
1147 
1148  switch (nFormat)
1149  {
1150  case SHGDFIL_FINDDATA:
1151  pfd = dest;
1152 
1153  if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
1154  return E_INVALIDARG;
1155 
1156  if (len < sizeof(WIN32_FIND_DATAA))
1157  return E_INVALIDARG;
1158 
1159  ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
1160  _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1161  pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1162  pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1163 
1164  filename = _ILGetTextPointer(pidl);
1165  shortname = _ILGetSTextPointer(pidl);
1166 
1167  if (filename)
1168  lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
1169  else
1170  pfd->cFileName[0] = '\0';
1171 
1172  if (shortname)
1173  lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
1174  else
1175  pfd->cAlternateFileName[0] = '\0';
1176  return S_OK;
1177 
1178  case SHGDFIL_NETRESOURCE:
1179  case SHGDFIL_DESCRIPTIONID:
1180  FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1181  break;
1182 
1183  default:
1184  ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1185  }
1186 
1187  return E_INVALIDARG;
1188 }
#define SHGDFIL_NETRESOURCE
Definition: shlobj.h:1369
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1928
#define SHGDFIL_DESCRIPTIONID
Definition: shlobj.h:1370
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2581
#define ERR_(ch,...)
Definition: debug.h:156
#define ZeroMemory
Definition: winbase.h:1635
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
#define FIXME_(x)
Definition: compat.h:67
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2441
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2378
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
#define TRACE_(x)
Definition: compat.h:66
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1939
#define SHGDFIL_FINDDATA
Definition: shlobj.h:1368
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
GLenum GLsizei len
Definition: glext.h:6722
static LPSTR _ILGetSTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2272
#define S_OK
Definition: intsafe.h:59
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
#define lstrcpynA
Definition: compat.h:408
static char * dest
Definition: rtl.c:135

◆ SHGetDataFromIDListW()

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

Definition at line 1194 of file pidl.c.

1196 {
1197  LPSTR filename, shortname;
1199 
1200  TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len);
1201 
1202  pdump(pidl);
1203 
1204  if (!psf || !dest)
1205  return E_INVALIDARG;
1206 
1207  switch (nFormat)
1208  {
1209  case SHGDFIL_FINDDATA:
1210  pfd = dest;
1211 
1212  if (_ILIsDrive(pidl))
1213  return E_INVALIDARG;
1214 
1215  if (len < sizeof(WIN32_FIND_DATAW))
1216  return E_INVALIDARG;
1217 
1218  ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
1219  _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
1220  pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
1221  pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
1222 
1223  filename = _ILGetTextPointer(pidl);
1224  shortname = _ILGetSTextPointer(pidl);
1225 
1226  if (!filename)
1227  pfd->cFileName[0] = '\0';
1228  else if (!MultiByteToWideChar(CP_ACP, 0, filename, -1, pfd->cFileName, MAX_PATH))
1229  pfd->cFileName[MAX_PATH-1] = 0;
1230 
1231  if (!shortname)
1232  pfd->cAlternateFileName[0] = '\0';
1233  else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1, pfd->cAlternateFileName, 14))
1234  pfd->cAlternateFileName[13] = 0;
1235  return S_OK;
1236 
1237  case SHGDFIL_NETRESOURCE:
1238  case SHGDFIL_DESCRIPTIONID:
1239  FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
1240  break;
1241 
1242  default:
1243  ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
1244  }
1245 
1246  return E_INVALIDARG;
1247 }
#define SHGDFIL_NETRESOURCE
Definition: shlobj.h:1369
#define SHGDFIL_DESCRIPTIONID
Definition: shlobj.h:1370
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2581
#define CP_ACP
Definition: compat.h:99
#define ERR_(ch,...)
Definition: debug.h:156
#define ZeroMemory
Definition: winbase.h:1635
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
#define FIXME_(x)
Definition: compat.h:67
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
Definition: pidl.c:2441
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2378
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2229
#define TRACE_(x)
Definition: compat.h:66
#define MAX_PATH
Definition: compat.h:26
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1939
#define SHGDFIL_FINDDATA
Definition: shlobj.h:1368
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
GLenum GLsizei len
Definition: glext.h:6722
static LPSTR _ILGetSTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2272
#define S_OK
Definition: intsafe.h:59
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
#define MultiByteToWideChar
Definition: compat.h:100
static char * dest
Definition: rtl.c:135

Referenced by fill_w32fdata_shell().

◆ SHGetIDListFromObject()

HRESULT WINAPI SHGetIDListFromObject ( IUnknown punk,
PIDLIST_ABSOLUTE ppidl 
)

Definition at line 1472 of file pidl.c.

1473 {
1474  IPersistIDList *ppersidl;
1475  IPersistFolder2 *ppf2;
1476  IDataObject *pdo;
1477  IFolderView *pfv;
1478  HRESULT ret;
1479 
1480  if(!punk)
1481  return E_NOINTERFACE;
1482 
1483  *ppidl = NULL;
1484 
1485  /* Try IPersistIDList */
1486  ret = IUnknown_QueryInterface(punk, &IID_IPersistIDList, (void**)&ppersidl);
1487  if(SUCCEEDED(ret))
1488  {
1489  TRACE("IPersistIDList (%p)\n", ppersidl);
1490  ret = IPersistIDList_GetIDList(ppersidl, ppidl);
1491  IPersistIDList_Release(ppersidl);
1492  if(SUCCEEDED(ret))
1493  return ret;
1494  }
1495 
1496  /* Try IPersistFolder2 */
1497  ret = IUnknown_QueryInterface(punk, &IID_IPersistFolder2, (void**)&ppf2);
1498  if(SUCCEEDED(ret))
1499  {
1500  TRACE("IPersistFolder2 (%p)\n", ppf2);
1501  ret = IPersistFolder2_GetCurFolder(ppf2, ppidl);
1502  IPersistFolder2_Release(ppf2);
1503  if(SUCCEEDED(ret))
1504  return ret;
1505  }
1506 
1507  /* Try IDataObject */
1508  ret = IUnknown_QueryInterface(punk, &IID_IDataObject, (void**)&pdo);
1509  if(SUCCEEDED(ret))
1510  {
1511  IShellItem *psi;
1512  TRACE("IDataObject (%p)\n", pdo);
1514  &IID_IShellItem, (void**)&psi);
1515  if(SUCCEEDED(ret))
1516  {
1517  ret = SHGetIDListFromObject((IUnknown*)psi, ppidl);
1518  IShellItem_Release(psi);
1519  }
1520  IDataObject_Release(pdo);
1521 
1522  if(SUCCEEDED(ret))
1523  return ret;
1524  }
1525 
1526  /* Try IFolderView */
1527  ret = IUnknown_QueryInterface(punk, &IID_IFolderView, (void**)&pfv);
1528  if(SUCCEEDED(ret))
1529  {
1530  IShellFolder *psf;
1531  TRACE("IFolderView (%p)\n", pfv);
1532  ret = IFolderView_GetFolder(pfv, &IID_IShellFolder, (void**)&psf);
1533  if(SUCCEEDED(ret))
1534  {
1535  /* We might be able to get IPersistFolder2 from a shellfolder. */
1536  ret = SHGetIDListFromObject((IUnknown*)psf, ppidl);
1537  }
1538  IFolderView_Release(pfv);
1539  return ret;
1540  }
1541 
1542  return ret;
1543 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv)
const GUID IID_IDataObject
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int ret
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1472
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

1410 {
1411  IShellFolder *psfparent;
1412  LPCITEMIDLIST child_pidl;
1413  STRRET disp_name;
1414  HRESULT ret;
1415 
1416  TRACE("%p 0x%08x %p\n", pidl, sigdnName, ppszName);
1417 
1418  *ppszName = NULL;
1419  ret = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psfparent, &child_pidl);
1420  if(SUCCEEDED(ret))
1421  {
1422  switch(sigdnName)
1423  {
1424  /* sigdnName & 0xffff */
1425  case SIGDN_NORMALDISPLAY: /* SHGDN_NORMAL */
1426  case SIGDN_PARENTRELATIVEPARSING: /* SHGDN_INFOLDER | SHGDN_FORPARSING */
1427  case SIGDN_PARENTRELATIVEEDITING: /* SHGDN_INFOLDER | SHGDN_FOREDITING */
1428  case SIGDN_DESKTOPABSOLUTEPARSING: /* SHGDN_FORPARSING */
1429  case SIGDN_DESKTOPABSOLUTEEDITING: /* SHGDN_FOREDITING | SHGDN_FORADDRESSBAR*/
1430  case SIGDN_PARENTRELATIVEFORADDRESSBAR: /* SIGDN_INFOLDER | SHGDN_FORADDRESSBAR */
1431  case SIGDN_PARENTRELATIVE: /* SIGDN_INFOLDER */
1432 
1433  disp_name.uType = STRRET_WSTR;
1434  ret = IShellFolder_GetDisplayNameOf(psfparent, child_pidl,
1435  sigdnName & 0xffff,
1436  &disp_name);
1437  if(SUCCEEDED(ret))
1438  ret = StrRetToStrW(&disp_name, pidl, ppszName);
1439 
1440  break;
1441 
1442  case SIGDN_FILESYSPATH:
1443  *ppszName = CoTaskMemAlloc(sizeof(WCHAR)*MAX_PATH);
1444  if(SHGetPathFromIDListW(pidl, *ppszName))
1445  {
1446  TRACE("Got string %s\n", debugstr_w(*ppszName));
1447  ret = S_OK;
1448  }
1449  else
1450  {
1452  ret = E_INVALIDARG;
1453  }
1454  break;
1455 
1456  case SIGDN_URL:
1457  default:
1458  FIXME("Unsupported SIGDN %x\n", sigdnName);
1459  ret = E_FAIL;
1460  }
1461 
1462  IShellFolder_Release(psfparent);
1463  }
1464  return ret;
1465 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
SIGDN sigdnName
Definition: shobjidl.idl:588
smooth NULL
Definition: ftsmooth.c:416
SIGDN PWSTR * ppszName
Definition: shobjidl.idl:588
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1323
UINT uType
Definition: shtypes.idl:93
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StrRetToStrW(LPSTRRET lpStrRet, const ITEMIDLIST *pidl, LPWSTR *ppszName)
Definition: string.c:1623

Referenced by CShellItem::GetDisplayName(), and init_function_pointers().

◆ SHGetPathFromIDListA()

BOOL WINAPI SHGetPathFromIDListA ( LPCITEMIDLIST  pidl,
LPSTR  pszPath 
)

Definition at line 1264 of file pidl.c.

1265 {
1266  WCHAR wszPath[MAX_PATH];
1267  BOOL bSuccess;
1268 
1269  bSuccess = SHGetPathFromIDListW(pidl, wszPath);
1270  WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL);
1271 
1272  return bSuccess;
1273 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
static BOOLEAN bSuccess
Definition: drive.cpp:417
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26

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

1281 {
1282  HRESULT hr;
1283  LPCITEMIDLIST pidlLast;
1284  LPSHELLFOLDER psfFolder;
1286  STRRET strret;
1287 
1288  TRACE_(shell)("(pidl=%p,%p)\n", pidl, pszPath);
1289  pdump(pidl);
1290 
1291  *pszPath = '\0';
1292  if (!pidl)
1293  return FALSE;
1294 
1295  hr = SHBindToParent(pidl, &IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
1296  if (FAILED(hr))
1297  {
1298  ERR("SHBindToParent failed: %x\n", hr);
1299  return FALSE;
1300  }
1301 
1302  dwAttributes = SFGAO_FILESYSTEM;
1303  hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes);
1304  if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) {
1305  WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr);
1306  IShellFolder_Release(psfFolder);
1307  return FALSE;
1308  }
1309 
1310  hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret);
1311  IShellFolder_Release(psfFolder);
1312  if (FAILED(hr)) return FALSE;
1313 
1314  hr = StrRetToBufW(&strret, pidlLast, pszPath, MAX_PATH);
1315 
1316  TRACE_(shell)("-- %s, 0x%08x\n",debugstr_w(pszPath), hr);
1317  return SUCCEEDED(hr);
1318 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:1522
#define WARN(fmt,...)
Definition: debug.h:111
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
DWORD dwAttributes
Definition: vdmdbg.h:34
#define debugstr_w
Definition: kernel32.h:32
#define TRACE_(x)
Definition: compat.h:66
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:109
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1323
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BtrfsSend::AddClone(), BtrfsSend::BrowseParent(), BrsFolder_NewFolder(), BrsFolder_OnCommand(), BrsFolder_Treeview_Rename(), ChooseFolder(), CHSourceDlgProc(), CNewMenu::CreateNewFolder(), CNewMenu::CreateNewItem(), CDefaultContextMenu::DoCreateNewFolder(), FileExtractDialogWndProc(), CFSFolder::GetCustomViewInfo(), GetIconOverlay(), CShellLink::GetPath(), COpenWithMenu::Initialize(), BtrfsContextMenu::Initialize(), CFSFolder::Initialize(), CZipFolder::Initialize(), CFSFolder::InitializeEx(), CDefaultContextMenu::InvokePidl(), LoadRdpSettingsFromFile(), NodeName(), CZipExtract::CExtractSettingsPage::OnBrowse(), RenderFILENAMEW(), RenderHDROP(), CShellLink::Resolve(), SaveRdpSettingsToFile(), CShellLink::SetTargetFromPIDLOrPath(), SHELL_execute(), SHGetFileInfoW(), SHGetNameFromIDList(), SHGetPathFromIDListA(), SHGetPathFromIDListWrapW(), SHOpenFolderWindow(), test_GetDisplayName(), test_ParseDisplayName(), test_SHGetNameFromIDList(), test_SHGetPathFromIDList(), TestCommandLine(), WelcomeDlgProc(), and WshCollection_Item().

◆ SHGetRealIDL()

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

Definition at line 742 of file pidl.c.

743 {
744  IDataObject* pDataObj;
745  HRESULT hr;
746 
747  hr = IShellFolder_GetUIObjectOf(lpsf, 0, 1, &pidlSimple,
748  &IID_IDataObject, 0, (LPVOID*)&pDataObj);
749  if (SUCCEEDED(hr))
750  {
751  STGMEDIUM medium;
752  FORMATETC fmt;
753 
755  fmt.ptd = NULL;
756  fmt.dwAspect = DVASPECT_CONTENT;
757  fmt.lindex = -1;
758  fmt.tymed = TYMED_HGLOBAL;
759 
760  hr = IDataObject_GetData(pDataObj, &fmt, &medium);
761 
762  IDataObject_Release(pDataObj);
763 
764  if (SUCCEEDED(hr))
765  {
766  /*assert(pida->cidl==1);*/
767  LPIDA pida = GlobalLock(medium.u.hGlobal);
768 
769  LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
770  LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
771 
772  *pidlReal = ILCombine(pidl_folder, pidl_child);
773 
774  if (!*pidlReal)
775  hr = E_OUTOFMEMORY;
776 
777  GlobalUnlock(medium.u.hGlobal);
778  GlobalFree(medium.u.hGlobal);
779  }
780  }
781 
782  return hr;
783 }
HRESULT hr
Definition: shlfolder.c:183
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
const char * fmt
Definition: wsprintf.c:30
const GUID IID_IDataObject
unsigned char * LPBYTE
Definition: typedefs.h:52
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR CFSTR_SHELLIDLISTW[]
Definition: shlobj.h:425
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
UINT aoffset[1]
Definition: shlobj.h:492
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
Definition: dsound.c:943
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: shlobj.h:490

◆ SHILCreateFromPathA()

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

Definition at line 380 of file pidl.c.

381 {
382  WCHAR lpszDisplayName[MAX_PATH];
383 
384  TRACE_(shell)("%s %p 0x%08x\n", path, ppidl, attributes ? *attributes : 0);
385 
386  if (!MultiByteToWideChar(CP_ACP, 0, path, -1, lpszDisplayName, MAX_PATH))
387  lpszDisplayName[MAX_PATH-1] = 0;
388 
389  return SHILCreateFromPathW(lpszDisplayName, ppidl, attributes);
390 }
GLsizei const GLchar ** path
Definition: glext.h:7234
#define CP_ACP
Definition: compat.h:99
#define TRACE_(x)
Definition: compat.h:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:392

Referenced by ILCreateFromPathA(), and SHILCreateFromPathAW().

◆ SHILCreateFromPathAW()

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

Definition at line 408 of file pidl.c.

409 {
410  if ( SHELL_OsIsUnicode())
411  return SHILCreateFromPathW (path, ppidl, attributes);
412  return SHILCreateFromPathA (path, ppidl, attributes);
413 }
HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:380
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
Definition: services.c:325
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:392

◆ SHILCreateFromPathW()

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

Definition at line 392 of file pidl.c.

393 {
394  LPSHELLFOLDER sf;
395  DWORD pchEaten;
396  HRESULT ret = E_FAIL;
397 
398  TRACE_(shell)("%s %p 0x%08x\n", debugstr_w(path), ppidl, attributes ? *attributes : 0);
399 
400  if (SUCCEEDED (SHGetDesktopFolder(&sf)))
401  {
402  ret = IShellFolder_ParseDisplayName(sf, 0, NULL, (LPWSTR)path, &pchEaten, ppidl, attributes);
403  IShellFolder_Release(sf);
404  }
405  return ret;
406 }
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE_(x)
Definition: compat.h:66
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
Definition: services.c:325
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ SHLogILFromFSIL()

LPITEMIDLIST WINAPI SHLogILFromFSIL ( LPITEMIDLIST  pidl)

Definition at line 792 of file pidl.c.

793 {
794  FIXME("(pidl=%p)\n",pidl);
795 
796  pdump(pidl);
797 
798  return 0;
799 }
#define FIXME(fmt,...)
Definition: debug.h:110
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:248

◆ SHParseDisplayName()

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

Definition at line 1367 of file pidl.c.

1369 {
1370  IShellFolder *psfDesktop;
1371  HRESULT hr=E_FAIL;
1372  ULONG dwAttr=sfgaoIn;
1373 
1374  if(!ppidl)
1375  return E_INVALIDARG;
1376 
1377  if (!pszName)
1378  {
1379  *ppidl = NULL;
1380  return E_INVALIDARG;
1381  }
1382 
1383  hr = SHGetDesktopFolder(&psfDesktop);
1384  if (FAILED(hr))
1385  {
1386  *ppidl = NULL;
1387  return hr;
1388  }
1389 
1390  hr = IShellFolder_ParseDisplayName(psfDesktop, (HWND)NULL, pbc, (LPOLESTR)pszName, (ULONG *)NULL, ppidl, &dwAttr);
1391 
1392  IShellFolder_Release(psfDesktop);
1393 
1394  if (SUCCEEDED(hr))
1395  {
1396  if (psfgaoOut) *psfgaoOut = dwAttr;
1397  }
1398  else
1399  {
1400  *ppidl = NULL;
1401  }
1402 
1403  return hr;
1404 }
HRESULT hr
Definition: shlfolder.c:183
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BtrfsSend::AddClone(), BtrfsSend::BrowseParent(), CreateIDataObject(), filedlg_collect_places_pidls(), CZipFolder::Initialize(), PathToIDList(), START_TEST(), test_ACListISF_CURRENTDIR(), test_ACListISF_FILESYSDIRS(), test_ACListISF_FILESYSONLY(), test_ACListISF_MYCOMPUTER(), test_ACListISF_NONE(), and test_SHParseDisplayName().

◆ SHSimpleIDListFromPathA()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathA ( LPCSTR  lpszPath)

Definition at line 1089 of file pidl.c.

1090 {
1091  LPITEMIDLIST pidl = NULL;
1092  LPWSTR wPath = NULL;
1093  int len;
1094 
1095  TRACE("%s\n", debugstr_a(lpszPath));
1096 
1097  if (lpszPath)
1098  {
1099  len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0);
1100  wPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1101  MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len);
1102  }
1103 
1104  _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
1105 
1106  HeapFree(GetProcessHeap(), 0, wPath);
1107  TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
1108  return pidl;
1109 }
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
Definition: pidl.c:1030
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SHChangeNotify(), and SHSimpleIDListFromPathAW().

◆ SHSimpleIDListFromPathAW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW ( LPCVOID  lpszPath)

Definition at line 1122 of file pidl.c.

1123 {
1124  if ( SHELL_OsIsUnicode())
1125  return SHSimpleIDListFromPathW (lpszPath);
1126  return SHSimpleIDListFromPathA (lpszPath);
1127 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1111
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath)
Definition: pidl.c:1089

◆ SHSimpleIDListFromPathW()

LPITEMIDLIST WINAPI SHSimpleIDListFromPathW ( LPCWSTR  lpszPath)

Definition at line 1111 of file pidl.c.

1112 {
1113  LPITEMIDLIST pidl = NULL;
1114 
1115  TRACE("%s\n", debugstr_w(lpszPath));
1116 
1117  _ILParsePathW(lpszPath, NULL, TRUE, &pidl, NULL);
1118  TRACE("%s %p\n", debugstr_w(lpszPath), pidl);
1119  return pidl;
1120 }
#define TRUE
Definition: types.h:120
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
Definition: pidl.c:1030
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

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  )