ReactOS 0.4.16-dev-1-gcf26321
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 _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
void _ILGetFileType (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
 
BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft) DECLSPEC_HIDDEN
 
DWORD _ILGetDrive (LPCITEMIDLIST, LPWSTR, 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 120 of file pidl.h.

◆ ValueWStruct

Function Documentation

◆ _ILCopyaPidl()

PITEMID_CHILD * _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2617 of file pidl.c.

2618{
2619 UINT i;
2620 PITEMID_CHILD *apidldest;
2621
2622 if (!apidlsrc)
2623 return NULL;
2624
2625 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2626
2627 for (i = 0; i < cidl; i++)
2628 apidldest[i] = ILClone(apidlsrc[i]);
2629
2630 return apidldest;
2631}
#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 2638 of file pidl.c.

2639{
2640 UINT i;
2642
2643 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2644 if (!dst)
2645 return NULL;
2646
2647 if (pidl)
2648 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2649
2650 for (i = 0; i < cida->cidl; i++)
2651 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2652
2653 return dst;
2654}
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 1722 of file pidl.c.

1723{
1724 TRACE("()\n");
1725 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1726}
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1734
#define PT_GUID
Definition: pidl.h:87
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1670 of file pidl.c.

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

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1641 of file pidl.c.

1642{
1644
1645 TRACE("()\n");
1646 ret = SHAlloc(2);
1647 if (ret)
1648 ret->mkid.cb = 0;
1649 return ret;
1650}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1855 of file pidl.c.

1856{
1857 LPITEMIDLIST pidlOut;
1858
1859 TRACE("(%s)\n",debugstr_w(lpszNew));
1860
1861 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1862 if (pidlOut)
1863 {
1864 LPSTR pszDest = _ILGetTextPointer(pidlOut);
1865 if (pszDest)
1866 {
1867 lstrcpyA(pszDest, "x:\\");
1868 pszDest[0] = toupper(lpszNew[0]);
1869 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1870 }
1871 }
1872 return pidlOut;
1873}
int toupper(int c)
Definition: utclib.c:881
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR _ILGetTextPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2227
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1615
#define PT_DRIVE
Definition: pidl.h:88
char * LPSTR
Definition: xmlstorage.h:182

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

◆ _ILCreateEntireNetwork()

LPITEMIDLIST _ILCreateEntireNetwork ( void  )

Definition at line 1875 of file pidl.c.

1876{
1877 LPITEMIDLIST pidlOut;
1878
1879 TRACE("\n");
1880
1881 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1882 if (pidlOut)
1883 {
1885
1886 pData->u.network.dummy = 0;
1887 strcpy(pData->u.network.szNames, "Entire Network");
1888 }
1889 return pidlOut;
1890}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
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:2160
#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 1788 of file pidl.c.

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

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

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1734 of file pidl.c.

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

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1759 of file pidl.c.

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

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

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1664 of file pidl.c.

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

Referenced by SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1652 of file pidl.c.

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

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1658 of file pidl.c.

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

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1716 of file pidl.c.

1717{
1718 TRACE("()\n");
1719 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1720}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1689 of file pidl.c.

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

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2600 of file pidl.c.

2601{
2602 UINT i;
2603
2604 if (apidl)
2605 {
2606 for (i = 0; i < cidl; i++)
2607 SHFree(apidl[i]);
2608 SHFree(apidl);
2609 }
2610}

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

◆ _ILGetDataPointer()

◆ _ILGetDrive()

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

Definition at line 1900 of file pidl.c.

1901{
1902 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1903
1904 if(_ILIsMyComputer(pidl))
1905 pidl = ILGetNext(pidl);
1906
1907 if (pidl && _ILIsDrive(pidl))
1908 return _ILSimpleGetTextW(pidl, pOut, uSize);
1909
1910 return 0;
1911}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1976
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:872
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2009
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2080

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2460 of file pidl.c.

2461{
2462 WCHAR szTemp[MAX_PATH];
2463 LPCWSTR pPoint;
2464 LPCITEMIDLIST pidlTemp = pidl;
2465
2466 TRACE("pidl=%p\n",pidl);
2467
2468 if (!pidl)
2469 return FALSE;
2470
2471 pidlTemp = ILFindLastID(pidl);
2472
2473 if (!_ILIsValue(pidlTemp))
2474 return FALSE;
2475 if (!_ILSimpleGetTextW(pidlTemp, szTemp, _countof(szTemp)))
2476 return FALSE;
2477
2478 pPoint = PathFindExtensionW(szTemp);
2479
2480 if (!*pPoint)
2481 return FALSE;
2482
2483 pPoint++;
2484 lstrcpynW(pOut, pPoint, uOutSize);
2485 TRACE("%s\n", debugstr_w(pOut));
2486
2487 return TRUE;
2488}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynW
Definition: compat.h:738
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2030
#define _countof(array)
Definition: sndvol32.h:70
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

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

◆ _ILGetFileAttributes()

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

Definition at line 2560 of file pidl.c.

2561{
2563 WORD wAttrib = 0;
2564 int i;
2565
2566 if (!pData)
2567 return 0;
2568
2569 switch(pData->type)
2570 {
2571 case PT_FOLDER:
2572 case PT_VALUE:
2573 wAttrib = pData->u.file.uFileAttribs;
2574 break;
2575 }
2576
2577 if(uOutSize >= 6)
2578 {
2579 i=0;
2580 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2581 pOut[i++] = L'R';
2582 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2583 pOut[i++] = L'H';
2584 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2585 pOut[i++] = L'S';
2586 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2587 pOut[i++] = L'A';
2588 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2589 pOut[i++] = L'C';
2590 pOut[i] = UNICODE_NULL;
2591 }
2592 return wAttrib;
2593}
#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
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50

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

◆ _ILGetFileDate()

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

Definition at line 2395 of file pidl.c.

2396{
2397 FILETIME ft,lft;
2399 BOOL ret;
2400
2401 if (_ILGetFileDateTime( pidl, &ft ))
2402 {
2403 FileTimeToLocalFileTime(&ft, &lft);
2404 FileTimeToSystemTime (&lft, &time);
2405
2407 if (ret)
2408 {
2409 /* Append space + time without seconds */
2410 pOut[ret - 1] = L' ';
2412 }
2413 }
2414 else
2415 {
2416 pOut[0] = UNICODE_NULL;
2417 ret = FALSE;
2418 }
2419 return ret;
2420}
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 GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
__u16 time
Definition: mkdosfs.c:8
#define LOCALE_USER_DEFAULT
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt)
Definition: pidl.c:2376
#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 2376 of file pidl.c.

2377{
2379
2380 if (!pdata)
2381 return FALSE;
2382
2383 switch (pdata->type)
2384 {
2385 case PT_FOLDER:
2386 case PT_VALUE:
2387 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2388 break;
2389 default:
2390 return FALSE;
2391 }
2392 return TRUE;
2393}
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,
LPWSTR  pOut,
UINT  uOutSize 
)

Definition at line 2439 of file pidl.c.

2440{
2442 DWORD dwSize;
2443
2444 if (!pdata)
2445 return 0;
2446
2447 switch (pdata->type)
2448 {
2449 case PT_VALUE:
2450 dwSize = pdata->u.file.dwFileSize;
2451 if (pOut)
2452 StrFormatKBSizeW(dwSize, pOut, uOutSize);
2453 return dwSize;
2454 }
2455 if (pOut)
2456 *pOut = UNICODE_NULL;
2457 return 0;
2458}
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1751
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 2334 of file pidl.c.

2334 {
2335 FileStructW *pFileStructW;
2336 WORD cbOffset;
2337
2338 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2339 return NULL;
2340
2341 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2342 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2343
2344 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2345 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2346 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2347 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2348 /* FileStructW is positioned after FileStruct */
2349 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2350 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2351 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2352 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2353 {
2354 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2355 return NULL;
2356 }
2357
2358 return pFileStructW;
2359}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:2021
struct tagFileStruct FileStruct

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

◆ _ILGetFileType()

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

Definition at line 2506 of file pidl.c.

2507{
2508 WCHAR sType[64], sTemp[64];
2509
2510 if(_ILIsValue(pidl))
2511 {
2512 if(uOutSize > 0)
2513 pOut[0] = 0;
2514 if (_ILGetExtension(pidl, sType, _countof(sType)))
2515 {
2516 if (HCR_MapTypeToValueW(sType, sTemp, _countof(sTemp), TRUE))
2517 {
2518 /* retrieve description */
2519 if (HCR_MapTypeToValueW(sTemp, pOut, uOutSize, FALSE))
2520 return;
2521 }
2522
2523 /* display Ext-file as description */
2524 CharUpperW(sType);
2525 /* load localized file string */
2526 sTemp[0] = UNICODE_NULL;
2528 {
2529 sTemp[_countof(sTemp) - 1] = UNICODE_NULL;
2530 StringCchPrintfW(pOut, uOutSize, sTemp, sType);
2531 }
2532 }
2533 }
2534 else
2535 {
2536 pOut[0] = UNICODE_NULL;
2538 /* make sure its null terminated */
2539 pOut[uOutSize - 1] = UNICODE_NULL;
2540 }
2541}
#define shell32_hInstance
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize)
Definition: pidl.c:2460
BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:49
#define IDS_DIRECTORY
Definition: shresdef.h:158
#define IDS_ANY_FILE
Definition: shresdef.h:184
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)

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

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2298 of file pidl.c.

2299{
2301
2302 TRACE("%p\n", pidl);
2303
2304 if (!pdata)
2305 return NULL;
2306
2307 TRACE("pdata->type 0x%04x\n", pdata->type);
2308 switch (pdata->type)
2309 {
2310 case PT_SHELLEXT:
2311 case PT_GUID:
2312 case PT_YAGUID:
2313 return &(pdata->u.guid.guid);
2314
2315 default:
2316 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2317 break;
2318 }
2319 return NULL;
2320}

Referenced by _ILHACKCompareSimpleIds(), _ILIsBitBucket(), _ILIsControlPanel(), _ILIsMyComputer(), _ILIsMyDocuments(), _ILIsNetHood(), _ILSimpleGetTextW(), CRegFolder::_IsInNameSpace(), CRegFolder::BindToObject(), CGuidItemExtractIcon_CreateInstance(), CRegFolder::CompareIDs(), CRegItemContextMenu_CreateInstance(), CRegFolder::GetDetailsOf(), CRegFolder::GetDisplayNameOf(), CRegFolder::GetUIObjectOf(), HCR_GetFolderAttributes(), CRegFolderInfo::IsRegItem(), and CRegFolder::SetNameOf().

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2227 of file pidl.c.

2228{
2229 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2230
2232
2233 if (!pdata)
2234 return NULL;
2235
2236 switch (pdata->type)
2237 {
2238 case PT_GUID:
2239 case PT_SHELLEXT:
2240 case PT_YAGUID:
2241 return NULL;
2242
2243 case PT_DRIVE:
2244 case PT_DRIVE1:
2245 case PT_DRIVE2:
2246 case PT_DRIVE3:
2247 return pdata->u.drive.szDriveName;
2248
2249 case PT_FOLDER:
2250 case PT_FOLDER1:
2251 case PT_VALUE:
2252 case PT_IESPECIAL1:
2253 case PT_IESPECIAL2:
2254 return pdata->u.file.szNames;
2255
2256 case PT_WORKGRP:
2257 case PT_COMP:
2258 case PT_NETWORK:
2259 case PT_NETPROVIDER:
2260 case PT_SHARE:
2261 return pdata->u.network.szNames;
2262 }
2263 return NULL;
2264}
#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(), _ILSimpleGetTextW(), SHGetDataFromIDListA(), and SHGetDataFromIDListW().

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2039 of file pidl.c.

2040{
2041 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2042
2043 TRACE("(%p)\n",pidl);
2044
2045 return (pidl && lpPData && (lpPData->type == 0));
2046}
PIDLTYPE type
Definition: pidl.h:204

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

◆ _ILIsDesktop()

◆ _ILIsDrive()

◆ _ILIsEmpty()

static BOOL _ILIsEmpty ( LPCITEMIDLIST  pidl)
inlinestatic

Definition at line 267 of file pidl.h.

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

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

◆ _ILIsEqualSimple()

static BOOL _ILIsEqualSimple ( LPCITEMIDLIST  pidlA,
LPCITEMIDLIST  pidlB 
)
inlinestatic

Definition at line 261 of file pidl.h.

262{
263 return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) ||
264 (!pidlA->mkid.cb && !pidlB->mkid.cb);
265}
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 1976 of file pidl.c.

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

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

◆ _ILIsPidlSimple()

BOOL _ILIsPidlSimple ( LPCITEMIDLIST  pidl)

Definition at line 910 of file shellbrowser.cpp.

911{
912 LPCITEMIDLIST pidlnext;
913 WORD length;
914 BOOL ret;
915
916 ret = TRUE;
917 if (! _ILIsDesktop(pidl))
918 {
919 length = pidl->mkid.cb;
920 pidlnext =
921 reinterpret_cast<LPCITEMIDLIST>(
922 reinterpret_cast<const BYTE *>(pidl) + length);
923 if (pidlnext->mkid.cb != 0)
924 ret = FALSE;
925 }
926 return ret;
927}
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()

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1927 of file pidl.c.

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

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILSimpleGetTextW()

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

Definition at line 2080 of file pidl.c.

2081{
2082 DWORD dwReturn;
2083 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2084
2085 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2086
2087 if (pFileStructW) {
2088 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2089 dwReturn = lstrlenW(pFileStructW->wszName);
2090 } else {
2091 GUID const * riid;
2092 WCHAR szTemp[MAX_PATH];
2093 LPSTR szSrc;
2094 LPWSTR szSrcW;
2095 dwReturn=0;
2096
2097 if (!pidl)
2098 return 0;
2099
2100 if (szOut)
2101 *szOut = 0;
2102
2103 if (_ILIsDesktop(pidl))
2104 {
2105 /* desktop */
2106 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, _countof(szTemp)))
2107 {
2108 if (szOut)
2109 lstrcpynW(szOut, szTemp, uOutSize);
2110
2111 dwReturn = lstrlenW (szTemp);
2112 }
2113 }
2114 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2115 {
2116 /* unicode filesystem */
2117 if (szOut)
2118 lstrcpynW(szOut, szSrcW, uOutSize);
2119
2120 dwReturn = lstrlenW(szSrcW);
2121 }
2122 else if (( szSrc = _ILGetTextPointer(pidl) ))
2123 {
2124 /* filesystem */
2125 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, _countof(szTemp));
2126
2127 if (szOut)
2128 lstrcpynW(szOut, szTemp, uOutSize);
2129
2130 dwReturn = lstrlenW (szTemp);
2131 }
2132 else if (( riid = _ILGetGUIDPointer(pidl) ))
2133 {
2134 /* special folder */
2135 if ( HCR_GetClassNameW(riid, szTemp, _countof(szTemp)))
2136 {
2137 if (szOut)
2138 lstrcpynW(szOut, szTemp, uOutSize);
2139
2140 dwReturn = lstrlenW (szTemp);
2141 }
2142 }
2143 else
2144 {
2145 ERR("-- no text\n");
2146 }
2147 }
2148
2149 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2150 return dwReturn;
2151}
#define MultiByteToWideChar
Definition: compat.h:110
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2171
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2334
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1936
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:405
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CDesktopFolder::_GetSFFromPidl(), _ILGetDrive(), _ILGetExtension(), 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: precomp.h:53
#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:1356
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:72
#define ILGDN_INFOLDER
Definition: undocshell.h:73
#define ILGDN_FORPARSING
Definition: undocshell.h:71

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 break;
383 default:
384 ERR("unknown IDLIST %p [%p] size=%u type=%x\n",
385 pidl, pidltemp, pidltemp->mkid.cb,type );
386 dump_pidl_hex( pidltemp );
387 return FALSE;
388 }
389 pidltemp = _dbg_ILGetNext(pidltemp);
390 }
391 else
392 {
393 return FALSE;
394 }
395 }
396 return TRUE;
397}
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()