ReactOS 0.4.15-dev-8138-g1e75ea8
pidl.h File Reference
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for pidl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagPIDLCPanelStruct
 
struct  tagGUIDStruct
 
struct  tagDriveStruct
 
struct  tagFileStruct
 
struct  tagFileStructW
 
struct  tagValueW
 
struct  tagPIDLDATA
 

Macros

#define PT_CPLAPPLET   0x00
 
#define PT_GUID   0x1F
 
#define PT_DRIVE   0x23
 
#define PT_DRIVE2   0x25
 
#define PT_DRIVE3   0x29
 
#define PT_SHELLEXT   0x2E
 
#define PT_DRIVE1   0x2F
 
#define PT_FOLDER1   0x30
 
#define PT_FOLDER   0x31
 
#define PT_VALUE   0x32
 
#define PT_VALUEW   0x34
 
#define PT_FOLDERW   0x35
 
#define PT_WORKGRP   0x41
 
#define PT_COMP   0x42
 
#define PT_NETPROVIDER   0x46
 
#define PT_NETWORK   0x47
 
#define PT_IESPECIAL1   0x61
 
#define PT_YAGUID   0x70 /* yet another guid.. */
 
#define PT_IESPECIAL2   0xb1
 
#define PT_SHARE   0xc3
 

Typedefs

typedef BYTE PIDLTYPE
 
typedef struct tagPIDLCPanelStruct PIDLCPanelStruct
 
typedef struct tagGUIDStruct GUIDStruct
 
typedef struct tagDriveStruct DriveStruct
 
typedef struct tagFileStruct FileStruct
 
typedef struct tagFileStructW FileStructW
 
typedef struct tagValueW ValueWStruct
 
typedef struct tagPIDLDATA PIDLDATA
 
typedef struct tagPIDLDATALPPIDLDATA
 

Functions

DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft) DECLSPEC_HIDDEN
 
DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT) DECLSPEC_HIDDEN
 
BOOL _ILIsUnicode (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsDesktop (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsMyComputer (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsDrive (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsFolder (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsValue (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
static BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
 
static BOOL _ILIsEmpty (LPCITEMIDLIST pidl)
 
LPITEMIDLIST _ILCreateGuid (PIDLTYPE type, REFIID guid) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateGuidFromStrA (LPCSTR szGUID) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateGuidFromStrW (LPCWSTR szGUID) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateDesktop (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateFromFindDataW (const WIN32_FIND_DATAW *stffile) DECLSPEC_HIDDEN
 
HRESULT _ILCreateFromPathW (LPCWSTR szPath, LPITEMIDLIST *ppidl) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateMyComputer (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateMyDocuments (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateIExplore (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateControlPanel (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreatePrinters (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateNetwork (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateNetHood (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateBitBucket (void) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateDrive (LPCWSTR) DECLSPEC_HIDDEN
 
LPITEMIDLIST _ILCreateEntireNetwork (void) DECLSPEC_HIDDEN
 
LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST) DECLSPEC_HIDDEN
 
LPSTR _ILGetTextPointer (LPCITEMIDLIST) DECLSPEC_HIDDEN
 
IID_ILGetGUIDPointer (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
FileStructW_ILGetFileStructW (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
void pdump (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
BOOL pcheck (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
 
void _ILFreeaPidl (LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
 
PITEMID_CHILD_ILCopyaPidl (PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl) DECLSPEC_HIDDEN
 
LPITEMIDLIST_ILCopyCidaToaPidl (LPITEMIDLIST *pidl, const CIDA *cida) DECLSPEC_HIDDEN
 
BOOL ILGetDisplayNameExW (LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ PT_COMP

#define PT_COMP   0x42

Definition at line 99 of file pidl.h.

◆ PT_CPLAPPLET

#define PT_CPLAPPLET   0x00

Definition at line 86 of file pidl.h.

◆ PT_DRIVE

#define PT_DRIVE   0x23

Definition at line 88 of file pidl.h.

◆ PT_DRIVE1

#define PT_DRIVE1   0x2F

Definition at line 92 of file pidl.h.

◆ PT_DRIVE2

#define PT_DRIVE2   0x25

Definition at line 89 of file pidl.h.

◆ PT_DRIVE3

#define PT_DRIVE3   0x29

Definition at line 90 of file pidl.h.

◆ PT_FOLDER

#define PT_FOLDER   0x31

Definition at line 94 of file pidl.h.

◆ PT_FOLDER1

#define PT_FOLDER1   0x30

Definition at line 93 of file pidl.h.

◆ PT_FOLDERW

#define PT_FOLDERW   0x35

Definition at line 97 of file pidl.h.

◆ PT_GUID

#define PT_GUID   0x1F

Definition at line 87 of file pidl.h.

◆ PT_IESPECIAL1

#define PT_IESPECIAL1   0x61

Definition at line 102 of file pidl.h.

◆ PT_IESPECIAL2

#define PT_IESPECIAL2   0xb1

Definition at line 104 of file pidl.h.

◆ PT_NETPROVIDER

#define PT_NETPROVIDER   0x46

Definition at line 100 of file pidl.h.

◆ PT_NETWORK

#define PT_NETWORK   0x47

Definition at line 101 of file pidl.h.

◆ PT_SHARE

#define PT_SHARE   0xc3

Definition at line 105 of file pidl.h.

◆ PT_SHELLEXT

#define PT_SHELLEXT   0x2E

Definition at line 91 of file pidl.h.

◆ PT_VALUE

#define PT_VALUE   0x32

Definition at line 95 of file pidl.h.

◆ PT_VALUEW

#define PT_VALUEW   0x34

Definition at line 96 of file pidl.h.

◆ PT_WORKGRP

#define PT_WORKGRP   0x41

Definition at line 98 of file pidl.h.

◆ PT_YAGUID

#define PT_YAGUID   0x70 /* yet another guid.. */

Definition at line 103 of file pidl.h.

Typedef Documentation

◆ DriveStruct

◆ FileStruct

◆ FileStructW

◆ GUIDStruct

◆ LPPIDLDATA

◆ PIDLCPanelStruct

◆ PIDLDATA

◆ PIDLTYPE

typedef BYTE PIDLTYPE

Definition at line 108 of file pidl.h.

◆ ValueWStruct

Function Documentation

◆ _ILCopyaPidl()

PITEMID_CHILD * _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2704 of file pidl.c.

2705{
2706 UINT i;
2707 PITEMID_CHILD *apidldest;
2708
2709 if (!apidlsrc)
2710 return NULL;
2711
2712 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2713
2714 for (i = 0; i < cidl; i++)
2715 apidldest[i] = ILClone(apidlsrc[i]);
2716
2717 return apidldest;
2718}
#define NULL
Definition: types.h:112
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

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

◆ _ILCopyCidaToaPidl()

LPITEMIDLIST * _ILCopyCidaToaPidl ( LPITEMIDLIST pidl,
const CIDA cida 
)

Definition at line 2725 of file pidl.c.

2726{
2727 UINT i;
2729
2730 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2731 if (!dst)
2732 return NULL;
2733
2734 if (pidl)
2735 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2736
2737 for (i = 0; i < cida->cidl; i++)
2738 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2739
2740 return dst;
2741}
GLenum GLenum dst
Definition: glext.h:6340
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
UINT cidl
Definition: shlobj.h:572
unsigned char BYTE
Definition: xxhash.c:193

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

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1716 of file pidl.c.

1717{
1718 TRACE("()\n");
1719 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1720}
#define PT_GUID
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1728
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1664 of file pidl.c.

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

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1635 of file pidl.c.

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

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1849 of file pidl.c.

1850{
1851 LPITEMIDLIST pidlOut;
1852
1853 TRACE("(%s)\n",debugstr_w(lpszNew));
1854
1855 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1856 if (pidlOut)
1857 {
1858 LPSTR pszDest;
1859
1860 pszDest = _ILGetTextPointer(pidlOut);
1861 if (pszDest)
1862 {
1863 strcpy(pszDest, "x:\\");
1864 pszDest[0]=toupperW(lpszNew[0]);
1865 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1866 }
1867 }
1868 return pidlOut;
1869}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2295
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1609
#define PT_DRIVE
Definition: pidl.h:88
#define toupperW(n)
Definition: unicode.h:51
char * LPSTR
Definition: xmlstorage.h:182

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1871 of file pidl.c.

1872{
1873 LPITEMIDLIST pidlOut;
1874
1875 TRACE("\n");
1876
1877 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1878 if (pidlOut)
1879 {
1881
1882 pData->u.network.dummy = 0;
1883 strcpy(pData->u.network.szNames, "Entire Network");
1884 }
1885 return pidlOut;
1886}
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:2228
#define PT_NETWORK
Definition: pidl.h:101
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

◆ _ILCreateFromFindDataW()

LPITEMIDLIST _ILCreateFromFindDataW ( const WIN32_FIND_DATAW stffile)

Definition at line 1782 of file pidl.c.

1783{
1784 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1785 DWORD len, len1, wlen, alen;
1786 LPITEMIDLIST pidl;
1787 PIDLTYPE type;
1788
1789 if (!wfd)
1790 return NULL;
1791
1792 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1793
1794 /* prepare buffer with both names */
1795 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1796 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1797 alen = len + len1;
1798
1799 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1800
1801 wlen = lstrlenW(wfd->cFileName) + 1;
1802 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1803 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1804 if (pidl)
1805 {
1807 FileStruct *fs = &pData->u.file;
1808 FileStructW *fsw;
1809 WORD *pOffsetW;
1810
1811 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1812 fs->dwFileSize = wfd->nFileSizeLow;
1813 fs->uFileAttribs = wfd->dwFileAttributes;
1814 memcpy(fs->szNames, buff, alen);
1815
1816 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1817 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1818 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1819 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1820 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1821
1822 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1823 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1824 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1825 }
1826 return pidl;
1827
1828}
#define CP_ACP
Definition: compat.h:109
#define MAX_PATH
Definition: compat.h:34
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
Definition: time.c:37
static unsigned char buff[32768]
Definition: fatten.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define PT_FOLDER
Definition: pidl.h:94
#define PT_VALUE
Definition: pidl.h:95
BYTE PIDLTYPE
Definition: pidl.h:108
WCHAR wszName[1]
Definition: shlfolder.c:1555
Definition: ffs.h:70
unsigned char * LPBYTE
Definition: typedefs.h:53
__wchar_t WCHAR
Definition: xmlstorage.h:180

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

◆ _ILCreateFromPathW()

HRESULT _ILCreateFromPathW ( LPCWSTR  szPath,
LPITEMIDLIST ppidl 
)

Definition at line 1830 of file pidl.c.

1831{
1832 HANDLE hFile;
1833 WIN32_FIND_DATAW stffile;
1834
1835 if (!ppidl)
1836 return E_INVALIDARG;
1837
1838 hFile = FindFirstFileW(szPath, &stffile);
1841
1843
1844 *ppidl = _ILCreateFromFindDataW(&stffile);
1845
1846 return *ppidl ? S_OK : E_OUTOFMEMORY;
1847}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
#define S_OK
Definition: intsafe.h:52
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LPCWSTR szPath
Definition: env.c:37
_In_ HANDLE hFile
Definition: mswsock.h:90
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *wfd)
Definition: pidl.c:1782
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by CFSFolder::SetNameOf().

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1728 of file pidl.c.

1729{
1730 LPITEMIDLIST pidlOut;
1731
1732 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1733 {
1734 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1735 if (pidlOut)
1736 {
1738
1739 pData->u.guid.guid = *guid;
1740 TRACE("-- create GUID-pidl %s\n",
1741 debugstr_guid(&(pData->u.guid.guid)));
1742 }
1743 }
1744 else
1745 {
1746 WARN("%d: invalid type for GUID\n", type);
1747 pidlOut = NULL;
1748 }
1749 return pidlOut;
1750}
#define WARN(fmt,...)
Definition: debug.h:115
#define PT_YAGUID
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1753 of file pidl.c.

1754{
1755 IID iid;
1756
1757 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1758 {
1759 ERR("%s is not a GUID\n", szGUID);
1760 return NULL;
1761 }
1762 return _ILCreateGuid(PT_GUID, &iid);
1763}
#define ERR(fmt,...)
Definition: debug.h:113
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:248
#define FAILED(hr)
Definition: intsafe.h:51

◆ _ILCreateGuidFromStrW()

LPITEMIDLIST _ILCreateGuidFromStrW ( LPCWSTR  szGUID)

Definition at line 1766 of file pidl.c.

1767{
1768 IID iid;
1769
1770#ifndef __REACTOS__
1771 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1772#else
1773 if (!GUIDFromStringW(szGUID, &iid))
1774#endif
1775 {
1776 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1777 return NULL;
1778 }
1779 return _ILCreateGuid(PT_GUID, &iid);
1780}
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)

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

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1658 of file pidl.c.

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

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

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1652 of file pidl.c.

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

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1710 of file pidl.c.

1711{
1712 TRACE("()\n");
1713 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1714}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1683 of file pidl.c.

1684{
1685#ifdef __REACTOS__
1686 // Note: Wine returns the PIDL as it was in Windows 95, NT5 moved it into CSIDL_CONTROLS
1687 extern HRESULT SHGetFolderLocationHelper(HWND hwnd, int nFolder, REFCLSID clsid, LPITEMIDLIST *ppidl);
1688 LPITEMIDLIST pidl;
1689 SHGetFolderLocationHelper(NULL, CSIDL_CONTROLS, &CLSID_Printers, &pidl);
1690 return pidl;
1691#else
1692 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1693
1694 TRACE("()\n");
1695 if (parent)
1696 {
1697 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1698
1699 if (printers)
1700 {
1701 ret = ILCombine(parent, printers);
1702 SHFree(printers);
1703 }
1704 SHFree(parent);
1705 }
1706 return ret;
1707#endif
1708}
REFCLSID clsid
Definition: msctf.c:82
#define REFCLSID
Definition: guiddef.h:117
#define CSIDL_CONTROLS
Definition: shlobj.h:2169
_In_ int nFolder
Definition: shlobj.h:1518
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2687 of file pidl.c.

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

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

◆ _ILGetDataPointer()

◆ _ILGetDrive()

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

Definition at line 1896 of file pidl.c.

1897{
1898 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1899
1900 if(_ILIsMyComputer(pidl))
1901 pidl = ILGetNext(pidl);
1902
1903 if (pidl && _ILIsDrive(pidl))
1904 return _ILSimpleGetText(pidl, pOut, uSize);
1905
1906 return 0;
1907}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1972
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:866
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2076
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2005

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2528 of file pidl.c.

2529{
2530 char szTemp[MAX_PATH];
2531 const char * pPoint;
2532 LPCITEMIDLIST pidlTemp=pidl;
2533
2534 TRACE("pidl=%p\n",pidl);
2535
2536 if (!pidl)
2537 return FALSE;
2538
2539 pidlTemp = ILFindLastID(pidl);
2540
2541 if (!_ILIsValue(pidlTemp))
2542 return FALSE;
2543 if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2544 return FALSE;
2545
2546 pPoint = PathFindExtensionA(szTemp);
2547
2548 if (!*pPoint)
2549 return FALSE;
2550
2551 pPoint++;
2552 lstrcpynA(pOut, pPoint, uOutSize);
2553 TRACE("%s\n",pOut);
2554
2555 return TRUE;
2556}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynA
Definition: compat.h:751
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:422
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2026

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

◆ _ILGetFileAttributes()

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

Definition at line 2647 of file pidl.c.

2648{
2650 WORD wAttrib = 0;
2651 int i;
2652
2653 if (!pData)
2654 return 0;
2655
2656 switch(pData->type)
2657 {
2658 case PT_FOLDER:
2659 case PT_VALUE:
2660 wAttrib = pData->u.file.uFileAttribs;
2661 break;
2662 }
2663
2664 if(uOutSize >= 6)
2665 {
2666 i=0;
2667 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2668 pOut[i++] = 'R';
2669 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2670 pOut[i++] = 'H';
2671 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2672 pOut[i++] = 'S';
2673 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2674 pOut[i++] = 'A';
2675 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2676 pOut[i++] = 'C';
2677 pOut[i] = 0x00;
2678 }
2679 return wAttrib;
2680}
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706

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

◆ _ILGetFileDate()

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

Definition at line 2463 of file pidl.c.

2464{
2465 FILETIME ft,lft;
2467 BOOL ret;
2468
2469 if (_ILGetFileDateTime( pidl, &ft ))
2470 {
2471 FileTimeToLocalFileTime(&ft, &lft);
2472 FileTimeToSystemTime (&lft, &time);
2473
2475 if (ret)
2476 {
2477 /* Append space + time without seconds */
2478 pOut[ret-1] = ' ';
2480 }
2481 }
2482 else
2483 {
2484 pOut[0] = '\0';
2485 ret = FALSE;
2486 }
2487 return ret;
2488}
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
unsigned int BOOL
Definition: ntddk_ex.h:94
INT WINAPI GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1044
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:936
__u16 time
Definition: mkdosfs.c:8
#define LOCALE_USER_DEFAULT
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2444
#define TIME_NOSECONDS
Definition: winnls.h:278
#define DATE_SHORTDATE
Definition: winnls.h:196

Referenced by CFSFolder::GetDetailsOf().

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME ft 
)

Definition at line 2444 of file pidl.c.

2445{
2447
2448 if (!pdata)
2449 return FALSE;
2450
2451 switch (pdata->type)
2452 {
2453 case PT_FOLDER:
2454 case PT_VALUE:
2455 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2456 break;
2457 default:
2458 return FALSE;
2459 }
2460 return TRUE;
2461}
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
static PROTOCOLDATA * pdata
Definition: protocol.c:158

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

◆ _ILGetFileSize()

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

Definition at line 2507 of file pidl.c.

2508{
2510 DWORD dwSize;
2511
2512 if (!pdata)
2513 return 0;
2514
2515 switch (pdata->type)
2516 {
2517 case PT_VALUE:
2518 dwSize = pdata->u.file.dwFileSize;
2519 if (pOut)
2520 StrFormatKBSizeA(dwSize, pOut, uOutSize);
2521 return dwSize;
2522 }
2523 if (pOut)
2524 *pOut = 0x00;
2525 return 0;
2526}
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:1735
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

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

◆ _ILGetFileStructW()

FileStructW * _ILGetFileStructW ( LPCITEMIDLIST  pidl)

Definition at line 2402 of file pidl.c.

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

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

◆ _ILGetFileType()

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

Definition at line 2574 of file pidl.c.

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

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

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2366 of file pidl.c.

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

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

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2295 of file pidl.c.

2296{
2297 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2298
2300
2301 if (!pdata)
2302 return NULL;
2303
2304 switch (pdata->type)
2305 {
2306 case PT_GUID:
2307 case PT_SHELLEXT:
2308 case PT_YAGUID:
2309 return NULL;
2310
2311 case PT_DRIVE:
2312 case PT_DRIVE1:
2313 case PT_DRIVE2:
2314 case PT_DRIVE3:
2315 return pdata->u.drive.szDriveName;
2316
2317 case PT_FOLDER:
2318 case PT_FOLDER1:
2319 case PT_VALUE:
2320 case PT_IESPECIAL1:
2321 case PT_IESPECIAL2:
2322 return pdata->u.file.szNames;
2323
2324 case PT_WORKGRP:
2325 case PT_COMP:
2326 case PT_NETWORK:
2327 case PT_NETPROVIDER:
2328 case PT_SHARE:
2329 return pdata->u.network.szNames;
2330 }
2331 return NULL;
2332}
#define PT_DRIVE1
Definition: pidl.h:92
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_IESPECIAL1
Definition: pidl.h:102
#define PT_DRIVE2
Definition: pidl.h:89
#define PT_SHARE
Definition: pidl.h:105
#define PT_COMP
Definition: pidl.h:99
#define PT_NETPROVIDER
Definition: pidl.h:100
#define PT_IESPECIAL2
Definition: pidl.h:104

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

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2035 of file pidl.c.

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

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

◆ _ILIsDesktop()

◆ _ILIsDrive()

◆ _ILIsEmpty()

static BOOL _ILIsEmpty ( LPCITEMIDLIST  pidl)
inlinestatic

Definition at line 257 of file pidl.h.

257{ return _ILIsDesktop(pidl); }
BOOL _ILIsDesktop(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: CBandSite.h:24

Referenced by _ILGetDataPointer(), BrFolder_OnSetExpandedPidl(), BrFolder_Treeview_Expand(), and ILRemoveLastID().

◆ _ILIsEqualSimple()

static BOOL _ILIsEqualSimple ( LPCITEMIDLIST  pidlA,
LPCITEMIDLIST  pidlB 
)
inlinestatic

Definition at line 251 of file pidl.h.

252{
253 return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) ||
254 (!pidlA->mkid.cb && !pidlB->mkid.cb);
255}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by BrFolder_OnSetExpandedPidl().

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1972 of file pidl.c.

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

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 834 of file shellbrowser.cpp.

835{
836 LPCITEMIDLIST pidlnext;
837 WORD length;
838 BOOL ret;
839
840 ret = TRUE;
841 if (! _ILIsDesktop(pidl))
842 {
843 length = pidl->mkid.cb;
844 pidlnext =
845 reinterpret_cast<LPCITEMIDLIST>(
846 reinterpret_cast<const BYTE *>(pidl) + length);
847 if (pidlnext->mkid.cb != 0)
848 ret = FALSE;
849 }
850 return ret;
851}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Referenced by CFSFolder::CompareIDs(), CDesktopFolder::GetDisplayNameOf(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), HCR_GetFolderAttributes(), SHBindToFolderIDListParent(), SHBindToParent(), and SHELL32_BindToSF().

◆ _ILIsSpecialFolder()

BOOL _ILIsSpecialFolder ( LPCITEMIDLIST  pidl)

Definition at line 1994 of file pidl.c.

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

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1923 of file pidl.c.

1924{
1925 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1926
1927 TRACE("(%p)\n",pidl);
1928
1929 return (pidl && lpPData && PT_VALUEW == lpPData->type);
1930}
#define PT_VALUEW
Definition: pidl.h:96

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILSimpleGetText()

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

Definition at line 2076 of file pidl.c.

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

Referenced by _ILGetDrive(), and _ILGetExtension().

◆ _ILSimpleGetTextW()

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

Definition at line 2148 of file pidl.c.

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

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

◆ ILGetDisplayNameExW()

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

Definition at line 100 of file pidl.c.

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

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

◆ pcheck()

BOOL pcheck ( LPCITEMIDLIST  pidl)

Definition at line 349 of file debughlp.cpp.

350{
351 DWORD type;
352 LPCITEMIDLIST pidltemp = pidl;
353
354 while( pidltemp && pidltemp->mkid.cb )
355 {
356 LPPIDLDATA pidlData = _dbg_ILGetDataPointer(pidltemp);
357
358 if (pidlData)
359 {
360 type = pidlData->type;
361 switch( type )
362 {
363 case PT_CPLAPPLET:
364 case PT_GUID:
365 case PT_SHELLEXT:
366 case PT_DRIVE:
367 case PT_DRIVE1:
368 case PT_DRIVE2:
369 case PT_DRIVE3:
370 case PT_FOLDER:
371 case PT_VALUE:
372 case PT_VALUEW:
373 case PT_FOLDER1:
374 case PT_WORKGRP:
375 case PT_COMP:
376 case PT_NETPROVIDER:
377 case PT_NETWORK:
378 case PT_IESPECIAL1:
379 case PT_YAGUID:
380 case PT_IESPECIAL2:
381 case PT_SHARE:
382 case 0x99: /* Network Connection pidl type */
383 break;
384 default:
385 ERR("unknown IDLIST %p [%p] size=%u type=%x\n",
386 pidl, pidltemp, pidltemp->mkid.cb,type );
387 dump_pidl_hex( pidltemp );
388 return FALSE;
389 }
390 pidltemp = _dbg_ILGetNext(pidltemp);
391 }
392 else
393 {
394 return FALSE;
395 }
396 }
397 return TRUE;
398}
static LPPIDLDATA _dbg_ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:48
static LPITEMIDLIST _dbg_ILGetNext(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:26
static void dump_pidl_hex(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:325
#define PT_CPLAPPLET
Definition: pidl.h:86

Referenced by _ILCreateCPanelApplet(), ILFindChild(), ILIsEqual(), ILLoadFromStream(), and pdump_impl().

◆ pdump()