ReactOS 0.4.16-dev-2206-gc56950d
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

static BYTE _ILGetType (LPCITEMIDLIST pidl)
 
static BYTE _ILGetFSType (LPCITEMIDLIST pidl)
 
DWORD _ILSimpleGetTextW (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
 
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 _ILIsEmpty (LPCITEMIDLIST pidl)
 
UINT _ILGetDepth (LPCITEMIDLIST pidl)
 
LPITEMIDLIST _ILCreateGuid (PIDLTYPE type, REFIID guid, BYTE SortOrder)
 
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 SHELL32_CreateSimpleIDListFromPath (LPCWSTR pszPath, DWORD dwAttributes)
 
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 156 of file pidl.h.

◆ ValueWStruct

Function Documentation

◆ _ILCopyaPidl()

PITEMID_CHILD * _ILCopyaPidl ( PCUITEMID_CHILD_ARRAY  apidlsrc,
UINT  cidl 
)

Definition at line 2629 of file pidl.c.

2630{
2631 PITEMID_CHILD *apidldest;
2632
2633 if (!apidlsrc)
2634 return NULL;
2635
2636 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2637 for (UINT i = 0; i < cidl; i++)
2638 {
2639 PITEMID_CHILD clone = ILClone(apidlsrc[i]);
2640 if ((apidldest[i] = clone) == NULL)
2641 {
2642 _ILFreeaPidl(apidldest, i);
2643 return NULL;
2644 }
2645 }
2646 return apidldest;
2647}
#define NULL
Definition: types.h:112
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:348
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:238
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2614

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

◆ _ILCopyCidaToaPidl()

LPITEMIDLIST * _ILCopyCidaToaPidl ( LPITEMIDLIST pidl,
const CIDA cida 
)

Definition at line 2654 of file pidl.c.

2655{
2656 UINT i;
2657 LPITEMIDLIST *dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2658 if (!dst)
2659 return NULL;
2660
2661 for (i = 0; i < cida->cidl; i++)
2662 {
2663 PITEMID_CHILD clone = ILClone(HIDA_GetPIDLItem(cida, i));
2664 if ((dst[i] = clone) == NULL)
2665 {
2666 _ILFreeaPidl(dst, i);
2667 return NULL;
2668 }
2669 }
2670
2671 if (pidl)
2672 {
2673 *pidl = ILClone(HIDA_GetPIDLFolder(cida));
2674 if (!*pidl)
2675 {
2676 _ILFreeaPidl(dst, cida->cidl);
2677 return NULL;
2678 }
2679 }
2680 return dst;
2681}
GLenum GLenum dst
Definition: glext.h:6340
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:713
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:708
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
UINT cidl
Definition: shlobj.h:580

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

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1874 of file pidl.c.

1875{
1876 TRACE("()\n");
1877 return _ILCreateGuid(PT_DESKTOP_REGITEM, &CLSID_RecycleBin, REGITEMORDER_RECYCLEBIN);
1878}
#define PT_DESKTOP_REGITEM
Definition: lnktool.cpp:38
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid, BYTE SortOrder)
Definition: pidl.c:1886
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1823 of file pidl.c.

1824{
1826
1827 TRACE("()\n");
1828 if (parent)
1829 {
1830 LPITEMIDLIST cpl = _ILCreateGuid(PT_COMPUTER_REGITEM, &CLSID_ControlPanel, REGITEMORDER_MYCOMPUTER_CONTROLS);
1831 if (cpl)
1832 {
1833 ret = ILCombine(parent, cpl);
1834 SHFree(cpl);
1835 }
1836 SHFree(parent);
1837 }
1838 return ret;
1839}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:370
return ret
Definition: mutex.c:146
r parent
Definition: btrfs.c:3010
#define PT_COMPUTER_REGITEM
Definition: lnktool.cpp:39
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1805
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1794 of file pidl.c.

1795{
1797
1798 TRACE("()\n");
1799 ret = SHAlloc(2);
1800 if (ret)
1801 ret->mkid.cb = 0;
1802 return ret;
1803}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 2007 of file pidl.c.

2008{
2009 LPITEMIDLIST pidlOut;
2010
2011 TRACE("(%s)\n",debugstr_w(lpszNew));
2012
2013 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
2014 if (pidlOut)
2015 {
2016 LPSTR pszDest = _ILGetTextPointer(pidlOut);
2017 if (pszDest)
2018 {
2019 lstrcpyA(pszDest, "x:\\");
2020 pszDest[0] = toupper(lpszNew[0]);
2021 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
2022 }
2023 }
2024 return pidlOut;
2025}
int CDECL toupper(int c)
Definition: ctype.c:514
#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:2342
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1768
#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 2027 of file pidl.c.

2028{
2029 LPITEMIDLIST pidlOut;
2030
2031 TRACE("\n");
2032
2033 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
2034 if (pidlOut)
2035 {
2037
2038 pData->u.network.dummy = 0;
2039 strcpy(pData->u.network.szNames, "Entire Network");
2040 }
2041 return pidlOut;
2042}
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:2278
#define PT_NETWORK
Definition: pidl.h:101
strcpy
Definition: string.h:131
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 1940 of file pidl.c.

1941{
1942 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1943 DWORD len, len1, wlen, alen;
1944 LPITEMIDLIST pidl;
1945 PIDLTYPE type;
1946
1947 if (!wfd)
1948 return NULL;
1949
1950 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1951
1952 /* prepare buffer with both names */
1953 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1954 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1955 alen = len + len1;
1956
1957 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1958
1959 wlen = lstrlenW(wfd->cFileName) + 1;
1960 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1961 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1962 if (pidl)
1963 {
1965 FileStruct *fs = &pData->u.file;
1966 FileStructW *fsw;
1967 WORD *pOffsetW;
1968
1969 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1970 fs->dwFileSize = wfd->nFileSizeLow;
1971 fs->uFileAttribs = wfd->dwFileAttributes;
1972 memcpy(fs->szNames, buff, alen);
1973
1974 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1975 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1976 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1977 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1978 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1979
1980 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1981 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1982 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1983 }
1984 return pidl;
1985
1986}
#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 short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
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:156
WCHAR wszName[1]
Definition: shlfolder.c:1557
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 1988 of file pidl.c.

1989{
1990 HANDLE hFile;
1991 WIN32_FIND_DATAW stffile;
1992
1993 if (!ppidl)
1994 return E_INVALIDARG;
1995
1996 hFile = FindFirstFileW(szPath, &stffile);
1999
2001
2002 *ppidl = _ILCreateFromFindDataW(&stffile);
2003
2004 return *ppidl ? S_OK : E_OUTOFMEMORY;
2005}
#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:1940
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid,
BYTE  SortOrder 
)

Definition at line 1886 of file pidl.c.

1887{
1888 LPITEMIDLIST pidlOut;
1889
1890 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1891 {
1892 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1893 if (pidlOut)
1894 {
1896 pData->u.guid.uSortOrder = SortOrder;
1897 pData->u.guid.guid = *guid;
1898 TRACE("-- create GUID-pidl %s\n",
1899 debugstr_guid(&(pData->u.guid.guid)));
1900 }
1901 }
1902 else
1903 {
1904 WARN("%d: invalid type for GUID\n", type);
1905 pidlOut = NULL;
1906 }
1907 return pidlOut;
1908}
#define WARN(fmt,...)
Definition: precomp.h:61
GUID guid
Definition: version.c:147
#define debugstr_guid
Definition: kernel32.h:35
#define PT_GUID
Definition: pidl.h:87
#define PT_YAGUID
Definition: pidl.h:103
#define PT_SHELLEXT
Definition: pidl.h:91

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

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1911 of file pidl.c.

1912{
1913 IID iid;
1914
1915 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1916 {
1917 ERR("%s is not a GUID\n", szGUID);
1918 return NULL;
1919 }
1920 return _ILCreateGuid(PT_GUID, &iid);
1921}
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:292
#define FAILED(hr)
Definition: intsafe.h:51

◆ _ILCreateGuidFromStrW()

LPITEMIDLIST _ILCreateGuidFromStrW ( LPCWSTR  szGUID)

Definition at line 1923 of file pidl.c.

1924{
1925 IID iid;
1926
1927#ifndef __REACTOS__
1928 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1929#else
1930 if (!GUIDFromStringW(szGUID, &iid))
1931#endif
1932 {
1933 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1934 return NULL;
1935 }
1936 return _ILCreateGuid(PT_GUID, &iid);
1937}
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:300
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1817 of file pidl.c.

1818{
1819 TRACE("()\n");
1820 return _ILCreateGuid(PT_DESKTOP_REGITEM, &CLSID_Internet, REGITEMORDER_INTERNET);
1821}

Referenced by SHGetFolderLocation().

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1805 of file pidl.c.

1806{
1807 TRACE("()\n");
1808 return _ILCreateGuid(PT_DESKTOP_REGITEM, &CLSID_MyComputer, REGITEMORDER_MYCOMPUTER);
1809}

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1811 of file pidl.c.

1812{
1813 TRACE("()\n");
1814 return _ILCreateGuid(PT_DESKTOP_REGITEM, &CLSID_MyDocuments, REGITEMORDER_MYDOCS_DEFAULT);
1815}

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1868 of file pidl.c.

1869{
1870 TRACE("()\n");
1871 return _ILCreateGuid(PT_DESKTOP_REGITEM, &CLSID_NetworkPlaces, REGITEMORDER_NETHOOD);
1872}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1841 of file pidl.c.

1842{
1843#ifdef __REACTOS__
1844 // Note: Wine returns the PIDL as it was in Windows 95, NT5 moved it into CSIDL_CONTROLS
1845 extern HRESULT SHGetFolderLocationHelper(HWND hwnd, int nFolder, REFCLSID clsid, LPITEMIDLIST *ppidl);
1846 LPITEMIDLIST pidl;
1847 SHGetFolderLocationHelper(NULL, CSIDL_CONTROLS, &CLSID_Printers, &pidl);
1848 return pidl;
1849#else
1850 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1851
1852 TRACE("()\n");
1853 if (parent)
1854 {
1855 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1856
1857 if (printers)
1858 {
1859 ret = ILCombine(parent, printers);
1860 SHFree(printers);
1861 }
1862 SHFree(parent);
1863 }
1864 return ret;
1865#endif
1866}
const CLSID * clsid
Definition: msctf.cpp:50
#define REFCLSID
Definition: guiddef.h:117
#define CSIDL_CONTROLS
Definition: shlobj.h:2182
_In_ int nFolder
Definition: shlobj.h:1524
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

◆ _ILGetDataPointer()

◆ _ILGetDepth()

UINT _ILGetDepth ( LPCITEMIDLIST  pidl)

Referenced by BrFolder_ExpandToPidl(), and ILIsEqual().

◆ _ILGetDrive()

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

Definition at line 2052 of file pidl.c.

2053{
2054 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
2055
2056 if(_ILIsMyComputer(pidl))
2057 pidl = ILGetNext(pidl);
2058
2059 if (pidl && _ILIsDrive(pidl))
2060 return _ILSimpleGetTextW(pidl, pOut, uSize);
2061
2062 return 0;
2063}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:2104
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:977
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2137
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
Definition: pidl.c:2198

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2538 of file pidl.c.

2539{
2540 WCHAR szTemp[MAX_PATH];
2541 LPCWSTR pPoint;
2542 LPCITEMIDLIST pidlTemp = pidl;
2543
2544 TRACE("pidl=%p\n",pidl);
2545
2546 if (!pidl)
2547 return FALSE;
2548
2549 pidlTemp = ILFindLastID(pidl);
2550
2551 if (!_ILIsValue(pidlTemp))
2552 return FALSE;
2553 if (!_ILSimpleGetTextW(pidlTemp, szTemp, _countof(szTemp)))
2554 return FALSE;
2555
2556 pPoint = PathFindExtensionW(szTemp);
2557
2558 if (!*pPoint)
2559 return FALSE;
2560
2561 pPoint++;
2562 lstrcpynW(pOut, pPoint, uOutSize);
2563 TRACE("%s\n", debugstr_w(pOut));
2564
2565 return TRUE;
2566}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpynW
Definition: compat.h:738
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
Definition: path.c:1274
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:199
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2151
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define _countof(array)
Definition: sndvol32.h:70
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by SHELL32_GetFSItemAttributes(), and SHELL_IsShortcut().

◆ _ILGetFileAttributes()

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

Definition at line 2585 of file pidl.c.

2586{
2587 DWORD wAttrib = 0;
2588 if (_ILGetFSType(pidl))
2589 wAttrib = _ILGetDataPointer(pidl)->u.file.uFileAttribs;
2590
2591 if (uOutSize >= 6)
2592 {
2593 UINT i = 0;
2594 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2595 pOut[i++] = L'R';
2596 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2597 pOut[i++] = L'H';
2598 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2599 pOut[i++] = L'S';
2600 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2601 pOut[i++] = L'A';
2602 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2603 pOut[i++] = L'C';
2604 pOut[i] = UNICODE_NULL;
2605 }
2606 return wAttrib;
2607}
#define L(x)
Definition: resources.c:13
#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
static BYTE _ILGetFSType(LPCITEMIDLIST pidl)
Definition: pidl.h:149
union tagPIDLDATA::@633 u
struct tagFileStruct file
Definition: pidl.h:235

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

◆ _ILGetFileDateTime()

BOOL _ILGetFileDateTime ( LPCITEMIDLIST  pidl,
FILETIME ft 
)

Definition at line 2492 of file pidl.c.

2493{
2494 if (_ILGetFSType(pidl) > PT_FS) /* Only non-simple FS items have a date */
2495 {
2497 return DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2498 }
2499 return FALSE;
2500}
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
#define PT_FS
Definition: lnktool.cpp:40
static PROTOCOLDATA * pdata
Definition: protocol.c:158

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

◆ _ILGetFileSize()

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

Definition at line 2519 of file pidl.c.

2520{
2522 if (!pdata)
2523 return 0;
2524
2525 if (_ILGetFSType(pidl) & PT_FS_FILE_FLAG)
2526 {
2527 /* FIXME: Handle INVALID_FILE_SIZE (get size from disk) */
2528 DWORD dwSize = pdata->u.file.dwFileSize;
2529 if (pOut)
2530 StrFormatKBSizeW(dwSize, pOut, uOutSize);
2531 return dwSize;
2532 }
2533 if (pOut)
2534 *pOut = UNICODE_NULL;
2535 return 0;
2536}
LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:1887
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

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

◆ _ILGetFileStructW()

FileStructW * _ILGetFileStructW ( LPCITEMIDLIST  pidl)

Definition at line 2450 of file pidl.c.

2450 {
2451 FileStructW *pFileStructW;
2452 WORD cbOffset;
2453
2454 if (!_ILIsFolderOrFile(pidl))
2455 return NULL;
2456
2457 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2458 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2459
2460 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2461 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2462 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2463 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2464 /* FileStructW is positioned after FileStruct */
2465 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2466 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2467 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2468 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2469 {
2470 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2471 return NULL;
2472 }
2473
2474 return pFileStructW;
2475}
struct tagFileStruct FileStruct
unsigned char BYTE
Definition: xxhash.c:193

Referenced by _ILHACKCompareSimpleIds(), _ILSimpleGetTextW(), AddFSClassKeysToArray(), CreateItem(), and GetItemFileName().

◆ _ILGetFSType()

static BYTE _ILGetFSType ( LPCITEMIDLIST  pidl)
inlinestatic

◆ _ILGetGUIDPointer()

IID * _ILGetGUIDPointer ( LPCITEMIDLIST  pidl)

Definition at line 2414 of file pidl.c.

2415{
2417
2418 TRACE("%p\n", pidl);
2419
2420 if (!pdata)
2421 return NULL;
2422
2423 TRACE("pdata->type 0x%04x\n", pdata->type);
2424 switch (pdata->type)
2425 {
2426 case PT_SHELLEXT:
2427 case PT_GUID:
2428 case PT_YAGUID:
2429 return &(pdata->u.guid.guid);
2430
2431 default:
2432 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2433 break;
2434 }
2435 return NULL;
2436}

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

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2342 of file pidl.c.

2343{
2344 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2345
2346 PIDLTYPE type;
2348 if (!pdata)
2349 return NULL;
2350
2351 type = _ILGetFSType(pidl);
2352 if (type && !(type & PT_FS_UNICODE_FLAG))
2353 return pdata->u.file.szNames;
2354
2355 if (_ILIsDrive(pidl))
2356 return pdata->u.drive.szDriveName;
2357
2358 switch (pdata->type)
2359 {
2360 case PT_GUID:
2361 case PT_SHELLEXT:
2362 case PT_YAGUID:
2363 return NULL;
2364
2365 case PT_IESPECIAL1:
2366 case PT_IESPECIAL2:
2367 return pdata->u.file.szNames;
2368
2369 case PT_WORKGRP:
2370 case PT_COMP:
2371 case PT_NETWORK:
2372 case PT_NETPROVIDER:
2373 case PT_SHARE:
2374 return pdata->u.network.szNames;
2375 }
2376 return NULL;
2377}
#define PT_FS_UNICODE_FLAG
Definition: lnktool.cpp:41
#define PT_WORKGRP
Definition: pidl.h:98
#define PT_IESPECIAL1
Definition: pidl.h:102
#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().

◆ _ILGetType()

static BYTE _ILGetType ( LPCITEMIDLIST  pidl)
inlinestatic

Definition at line 144 of file pidl.h.

145{
146 return pidl && pidl->mkid.cb >= 3 ? pidl->mkid.abID[0] : 0;
147}

Referenced by _ILGetFSType(), _ILIsDrive(), IsRegItem(), ItemIsFolder(), and ValidateItem().

◆ _ILIsCPanelStruct()

BOOL _ILIsCPanelStruct ( LPCITEMIDLIST  pidl)

Definition at line 2157 of file pidl.c.

2158{
2159 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2160
2161 TRACE("(%p)\n",pidl);
2162
2163 return (pidl && lpPData && (lpPData->type == 0));
2164}
PIDLTYPE type
Definition: pidl.h:230

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

◆ _ILIsDesktop()

◆ _ILIsDrive()

◆ _ILIsEmpty()

static BOOL _ILIsEmpty ( LPCITEMIDLIST  pidl)
inlinestatic

Definition at line 282 of file pidl.h.

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

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

◆ _ILIsFolder()

BOOL _ILIsFolder ( LPCITEMIDLIST  pidl)

Definition at line 2144 of file pidl.c.

2145{
2146 /* A folder or a simple PT_FS with a child */
2147 const BYTE type = _ILGetFSType(pidl);
2148 return (type & PT_FS_FOLDER_FLAG) != 0 || (type == PT_FS && ILGetNext(pidl));
2149}

Referenced by CFSFolder::_GetDropTarget(), _ILHACKCompareSimpleIds(), AddFSClassKeysToArray(), CFSFolder::BindToObject(), CFSExtractIcon_CreateInstance(), CFSFolder::CompareSortFoldersFirst(), CFSFolder::GetDisplayNameOf(), and CDefView::UpdateStatusbar().

◆ _ILIsMyComputer()

BOOL _ILIsMyComputer ( LPCITEMIDLIST  pidl)

Definition at line 2104 of file pidl.c.

2105{
2106 REFIID iid = _ILGetGUIDPointer(pidl);
2107
2108 TRACE("(%p)\n",pidl);
2109
2110 if (iid)
2111 return IsEqualIID(iid, &CLSID_MyComputer);
2112 return FALSE;
2113}
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2414
#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 925 of file shellbrowser.cpp.

926{
927 LPCITEMIDLIST pidlnext;
928 WORD length;
929 BOOL ret;
930
931 ret = TRUE;
932 if (! _ILIsDesktop(pidl))
933 {
934 length = pidl->mkid.cb;
935 pidlnext =
936 reinterpret_cast<LPCITEMIDLIST>(
937 reinterpret_cast<const BYTE *>(pidl) + length);
938 if (pidlnext->mkid.cb != 0)
939 ret = FALSE;
940 }
941 return ret;
942}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

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

◆ _ILIsSpecialFolder()

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 2079 of file pidl.c.

2080{
2081 TRACE("(%p)\n",pidl);
2082
2083 return (_ILGetFSType(pidl) & PT_FS_UNICODE_FLAG) != 0;
2084}

Referenced by pdump_impl().

◆ _ILIsValue()

BOOL _ILIsValue ( LPCITEMIDLIST  pidl)

Definition at line 2151 of file pidl.c.

2152{
2153 const BYTE type = _ILGetFSType(pidl);
2154 return type && !(type & PT_FS_FOLDER_FLAG);
2155}

Referenced by _ILGetExtension(), _ILHACKCompareSimpleIds(), AddFSClassKeysToArray(), ExtensionFromPidl(), CFSFolder::GetUIObjectOf(), and COpenWithMenu::Initialize().

◆ _ILSimpleGetTextW()

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

Definition at line 2198 of file pidl.c.

2199{
2200 DWORD dwReturn;
2201 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2202
2203 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2204
2205 if (pFileStructW) {
2206 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2207 dwReturn = lstrlenW(pFileStructW->wszName);
2208 } else {
2209 GUID const * riid;
2210 WCHAR szTemp[MAX_PATH];
2211 LPSTR szSrc;
2212 LPWSTR szSrcW;
2213 dwReturn=0;
2214
2215 if (!pidl)
2216 return 0;
2217
2218 if (szOut)
2219 *szOut = 0;
2220
2221 if (_ILIsDesktop(pidl))
2222 {
2223 /* desktop */
2224 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, _countof(szTemp)))
2225 {
2226 if (szOut)
2227 lstrcpynW(szOut, szTemp, uOutSize);
2228
2229 dwReturn = lstrlenW (szTemp);
2230 }
2231 }
2232 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2233 {
2234 /* unicode filesystem */
2235 if (szOut)
2236 lstrcpynW(szOut, szSrcW, uOutSize);
2237
2238 dwReturn = lstrlenW(szSrcW);
2239 }
2240 else if (( szSrc = _ILGetTextPointer(pidl) ))
2241 {
2242 /* filesystem */
2243 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, _countof(szTemp));
2244
2245 if (szOut)
2246 lstrcpynW(szOut, szTemp, uOutSize);
2247
2248 dwReturn = lstrlenW (szTemp);
2249 }
2250 else if (( riid = _ILGetGUIDPointer(pidl) ))
2251 {
2252 /* special folder */
2253 if ( HCR_GetClassNameW(riid, szTemp, _countof(szTemp)))
2254 {
2255 if (szOut)
2256 lstrcpynW(szOut, szTemp, uOutSize);
2257
2258 dwReturn = lstrlenW (szTemp);
2259 }
2260 }
2261 else
2262 {
2263 ERR("-- no text\n");
2264 }
2265 }
2266
2267 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2268 return dwReturn;
2269}
#define MultiByteToWideChar
Definition: compat.h:110
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2289
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2450
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:2086
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:422
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _ILGetDrive(), _ILGetExtension(), AddFSClassKeysToArray(), CFSFolder::GetDisplayNameOf(), GetItemDriveNumber(), GetItemFileName(), RenderHDROP(), and SHELL32_GetFSItemAttributes().

◆ ILGetDisplayNameExW()

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

Definition at line 101 of file pidl.c.

102{
103 LPSHELLFOLDER psfParent, lsf = psf;
105 LPCITEMIDLIST pidllast;
106 STRRET strret;
107 DWORD flag;
108
109 TRACE("%p %p %p %x\n", psf, pidl, path, type);
110
111 if (!pidl || !path)
112 return FALSE;
113
114 if (!lsf)
115 {
116 ret = SHGetDesktopFolder(&lsf);
117 if (FAILED(ret))
118 return FALSE;
119 }
120
121 switch (type)
122 {
123 case ILGDN_FORPARSING:
124 flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
125 break;
126 case ILGDN_NORMAL:
127 flag = SHGDN_NORMAL;
128 break;
129 case ILGDN_INFOLDER:
130 flag = SHGDN_INFOLDER;
131 break;
132 default:
133 FIXME("Unknown type parameter = %x\n", type);
134 flag = SHGDN_FORPARSING | SHGDN_FORADDRESSBAR;
135 break;
136 }
137
138 if (!*(const WORD*)pidl || type == ILGDN_FORPARSING)
139 {
140 ret = IShellFolder_GetDisplayNameOf(lsf, pidl, flag, &strret);
141 if (SUCCEEDED(ret))
142 {
143 if(!StrRetToStrNW(path, MAX_PATH, &strret, pidl))
144 ret = E_FAIL;
145 }
146 }
147 else
148 {
149 ret = SHBindToParent(pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidllast);
150 if (SUCCEEDED(ret))
151 {
152 ret = IShellFolder_GetDisplayNameOf(psfParent, pidllast, flag, &strret);
153 if (SUCCEEDED(ret))
154 {
155 if(!StrRetToStrNW(path, MAX_PATH, &strret, pidllast))
156 ret = E_FAIL;
157 }
158 IShellFolder_Release(psfParent);
159 }
160 }
161
162 TRACE("%p %p %s\n", psf, pidl, debugstr_w(path));
163
164 if (!psf)
165 IShellFolder_Release(lsf);
166 return SUCCEEDED(ret);
167}
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:1504
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:85
#define ILGDN_INFOLDER
Definition: undocshell.h:86
#define ILGDN_FORPARSING
Definition: undocshell.h:84

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

◆ pcheck()

BOOL pcheck ( LPCITEMIDLIST  pidl)

Definition at line 360 of file debughlp.cpp.

361{
362 DWORD type;
363 LPCITEMIDLIST pidltemp = pidl;
364
365 while( pidltemp && pidltemp->mkid.cb )
366 {
367 LPPIDLDATA pidlData = _dbg_ILGetDataPointer(pidltemp);
368
369 if (pidlData)
370 {
371 type = pidlData->type;
372 switch( type )
373 {
374 case PT_CPLAPPLET:
375 case PT_GUID:
376 case PT_SHELLEXT:
377 case PT_DRIVE:
378 case PT_DRIVE1:
379 case PT_DRIVE2:
380 case PT_DRIVE3:
381 case PT_FOLDER:
382 case PT_VALUE:
383 case PT_VALUEW:
384 case PT_FOLDER1:
385 case PT_WORKGRP:
386 case PT_COMP:
387 case PT_NETPROVIDER:
388 case PT_NETWORK:
389 case PT_IESPECIAL1:
390 case PT_YAGUID:
391 case PT_IESPECIAL2:
392 case PT_SHARE:
393 break;
394 default:
395 ERR("unknown IDLIST %p [%p] size=%u type=%x\n",
396 pidl, pidltemp, pidltemp->mkid.cb,type );
397 dump_pidl_hex( pidltemp );
398 return FALSE;
399 }
400 pidltemp = _dbg_ILGetNext(pidltemp);
401 }
402 else
403 {
404 return FALSE;
405 }
406 }
407 return TRUE;
408}
static LPPIDLDATA _dbg_ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:59
static LPITEMIDLIST _dbg_ILGetNext(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:37
static void dump_pidl_hex(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:336
#define PT_DRIVE1
Definition: pidl.h:92
#define PT_FOLDER1
Definition: pidl.h:93
#define PT_DRIVE3
Definition: pidl.h:90
#define PT_VALUEW
Definition: pidl.h:96
#define PT_DRIVE2
Definition: pidl.h:89
#define PT_CPLAPPLET
Definition: pidl.h:86

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

◆ pdump()

◆ SHELL32_CreateSimpleIDListFromPath()

LPITEMIDLIST SHELL32_CreateSimpleIDListFromPath ( LPCWSTR  pszPath,
DWORD  dwAttributes 
)

Definition at line 1195 of file pidl.c.

1196{
1198 LPITEMIDLIST pidl = NULL;
1199 _ILParsePathW(pszPath, &data, TRUE, &pidl, NULL);
1200 return pidl;
1201}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
Definition: pidl.c:1156
DWORD dwAttributes
Definition: vdmdbg.h:34

Referenced by CFSDropTarget::_GetEffectFromMenu(), CRecycleBin::GetFSFolderForItem(), and SHGetFileInfoW().