ReactOS 0.4.15-dev-7953-g1f49173
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 2707 of file pidl.c.

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

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

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

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1719 of file pidl.c.

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

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1675 of file pidl.c.

1676{
1677 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1678
1679 TRACE("()\n");
1680 if (parent)
1681 {
1682 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1683
1684 if (cpl)
1685 {
1686 ret = ILCombine(parent, cpl);
1687 SHFree(cpl);
1688 }
1689 SHFree(parent);
1690 }
1691 return ret;
1692}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
r parent
Definition: btrfs.c:3010
#define PT_SHELLEXT
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
int ret

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1646 of file pidl.c.

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

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1852 of file pidl.c.

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

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1874 of file pidl.c.

1875{
1876 LPITEMIDLIST pidlOut;
1877
1878 TRACE("\n");
1879
1880 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1881 if (pidlOut)
1882 {
1884
1885 pData->u.network.dummy = 0;
1886 strcpy(pData->u.network.szNames, "Entire Network");
1887 }
1888 return pidlOut;
1889}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2231
#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 1785 of file pidl.c.

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

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

Referenced by CFSFolder::SetNameOf().

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1731 of file pidl.c.

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

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1756 of file pidl.c.

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

◆ _ILCreateGuidFromStrW()

LPITEMIDLIST _ILCreateGuidFromStrW ( LPCWSTR  szGUID)

Definition at line 1769 of file pidl.c.

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

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

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1669 of file pidl.c.

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

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

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1663 of file pidl.c.

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

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1713 of file pidl.c.

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

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1694 of file pidl.c.

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

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2690 of file pidl.c.

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

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

◆ _ILGetDataPointer()

◆ _ILGetDrive()

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

Definition at line 1899 of file pidl.c.

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

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2531 of file pidl.c.

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

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

◆ _ILGetFileAttributes()

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

Definition at line 2650 of file pidl.c.

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

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

◆ _ILGetFileDate()

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

Definition at line 2466 of file pidl.c.

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

Referenced by CFSFolder::GetDetailsOf().

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME ft 
)

Definition at line 2447 of file pidl.c.

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

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

◆ _ILGetFileSize()

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

Definition at line 2510 of file pidl.c.

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

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

◆ _ILGetFileStructW()

FileStructW * _ILGetFileStructW ( LPCITEMIDLIST  pidl)

Definition at line 2405 of file pidl.c.

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

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

◆ _ILGetFileType()

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

Definition at line 2577 of file pidl.c.

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

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

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2369 of file pidl.c.

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

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

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2298 of file pidl.c.

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

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

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

◆ _ILIsDesktop()

◆ _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(), BrsFolder_OnSetExpanded(), BrsFolder_Treeview_Expand(), ILRemoveLastID(), and InitializeTreeView().

◆ _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 BrsFolder_OnSetExpanded().

◆ _ILIsFolder()

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 1975 of file pidl.c.

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

Referenced by _ILGetDrive(), BrsFolder_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 CDesktopFolder::GetDisplayNameOf(), CDrivesFolder::GetDisplayNameOf(), CFSFolder::GetDisplayNameOf(), HCR_GetFolderAttributes(), SHBindToFolderIDListParent(), SHBindToParent(), and SHELL32_BindToSF().

◆ _ILIsSpecialFolder()

BOOL _ILIsSpecialFolder ( LPCITEMIDLIST  pidl)

Definition at line 1997 of file pidl.c.

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

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1926 of file pidl.c.

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

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILSimpleGetText()

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

Definition at line 2079 of file pidl.c.

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

2152{
2153 DWORD dwReturn;
2154 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2155
2156 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2157
2158 if (pFileStructW) {
2159 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2160 dwReturn = lstrlenW(pFileStructW->wszName);
2161 } else {
2162 GUID const * riid;
2163 WCHAR szTemp[MAX_PATH];
2164 LPSTR szSrc;
2165 LPWSTR szSrcW;
2166 dwReturn=0;
2167
2168 if (!pidl)
2169 return 0;
2170
2171 if (szOut)
2172 *szOut = 0;
2173
2174 if (_ILIsDesktop(pidl))
2175 {
2176 /* desktop */
2177 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2178 {
2179 if (szOut)
2180 lstrcpynW(szOut, szTemp, uOutSize);
2181
2182 dwReturn = lstrlenW (szTemp);
2183 }
2184 }
2185 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2186 {
2187 /* unicode filesystem */
2188 if (szOut)
2189 lstrcpynW(szOut, szSrcW, uOutSize);
2190
2191 dwReturn = lstrlenW(szSrcW);
2192 }
2193 else if (( szSrc = _ILGetTextPointer(pidl) ))
2194 {
2195 /* filesystem */
2196 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, MAX_PATH);
2197
2198 if (szOut)
2199 lstrcpynW(szOut, szTemp, uOutSize);
2200
2201 dwReturn = lstrlenW (szTemp);
2202 }
2203 else if (( riid = _ILGetGUIDPointer(pidl) ))
2204 {
2205 /* special folder */
2206 if ( HCR_GetClassNameW(riid, szTemp, MAX_PATH) )
2207 {
2208 if (szOut)
2209 lstrcpynW(szOut, szTemp, uOutSize);
2210
2211 dwReturn = lstrlenW (szTemp);
2212 }
2213 }
2214 else
2215 {
2216 ERR("-- no text\n");
2217 }
2218 }
2219
2220 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2221 return dwReturn;
2222}
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2405
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:111
#define NO_ERROR
Definition: dderror.h:5
#define E_FAIL
Definition: ddrawi.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1361
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:71
#define ILGDN_INFOLDER
Definition: undocshell.h:72
#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()