ReactOS 0.4.15-dev-7788-g1ad9096
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 2678 of file pidl.c.

2679{
2680 UINT i;
2681 PITEMID_CHILD *apidldest;
2682
2683 if (!apidlsrc)
2684 return NULL;
2685
2686 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2687
2688 for (i = 0; i < cidl; i++)
2689 apidldest[i] = ILClone(apidlsrc[i]);
2690
2691 return apidldest;
2692}
#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:228

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

◆ _ILCopyCidaToaPidl()

LPITEMIDLIST * _ILCopyCidaToaPidl ( LPITEMIDLIST pidl,
const CIDA cida 
)

Definition at line 2699 of file pidl.c.

2700{
2701 UINT i;
2703
2704 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2705 if (!dst)
2706 return NULL;
2707
2708 if (pidl)
2709 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2710
2711 for (i = 0; i < cida->cidl; i++)
2712 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2713
2714 return dst;
2715}
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 1690 of file pidl.c.

1691{
1692 TRACE("()\n");
1693 return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
1694}
#define PT_GUID
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid)
Definition: pidl.c:1702
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1646 of file pidl.c.

1647{
1648 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1649
1650 TRACE("()\n");
1651 if (parent)
1652 {
1653 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1654
1655 if (cpl)
1656 {
1657 ret = ILCombine(parent, cpl);
1658 SHFree(cpl);
1659 }
1660 SHFree(parent);
1661 }
1662 return ret;
1663}
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:703
int ret

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

◆ _ILCreateDesktop()

LPITEMIDLIST _ILCreateDesktop ( void  )

Definition at line 1617 of file pidl.c.

1618{
1620
1621 TRACE("()\n");
1622 ret = SHAlloc(2);
1623 if (ret)
1624 ret->mkid.cb = 0;
1625 return ret;
1626}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1823 of file pidl.c.

1824{
1825 LPITEMIDLIST pidlOut;
1826
1827 TRACE("(%s)\n",debugstr_w(lpszNew));
1828
1829 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1830 if (pidlOut)
1831 {
1832 LPSTR pszDest;
1833
1834 pszDest = _ILGetTextPointer(pidlOut);
1835 if (pszDest)
1836 {
1837 strcpy(pszDest, "x:\\");
1838 pszDest[0]=toupperW(lpszNew[0]);
1839 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1840 }
1841 }
1842 return pidlOut;
1843}
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:2269
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1591
#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 1845 of file pidl.c.

1846{
1847 LPITEMIDLIST pidlOut;
1848
1849 TRACE("\n");
1850
1851 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1852 if (pidlOut)
1853 {
1855
1856 pData->u.network.dummy = 0;
1857 strcpy(pData->u.network.szNames, "Entire Network");
1858 }
1859 return pidlOut;
1860}
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:2202
#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 1756 of file pidl.c.

1757{
1758 char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
1759 DWORD len, len1, wlen, alen;
1760 LPITEMIDLIST pidl;
1761 PIDLTYPE type;
1762
1763 if (!wfd)
1764 return NULL;
1765
1766 TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName), debugstr_w(wfd->cFileName));
1767
1768 /* prepare buffer with both names */
1769 len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
1770 len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len, sizeof(buff)-len, NULL, NULL);
1771 alen = len + len1;
1772
1773 type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER : PT_VALUE;
1774
1775 wlen = lstrlenW(wfd->cFileName) + 1;
1776 pidl = _ILAlloc(type, FIELD_OFFSET(FileStruct, szNames[alen + (alen & 1)]) +
1777 FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD));
1778 if (pidl)
1779 {
1781 FileStruct *fs = &pData->u.file;
1782 FileStructW *fsw;
1783 WORD *pOffsetW;
1784
1785 FileTimeToDosDateTime( &wfd->ftLastWriteTime, &fs->uFileDate, &fs->uFileTime);
1786 fs->dwFileSize = wfd->nFileSizeLow;
1787 fs->uFileAttribs = wfd->dwFileAttributes;
1788 memcpy(fs->szNames, buff, alen);
1789
1790 fsw = (FileStructW*)(pData->u.file.szNames + alen + (alen & 0x1));
1791 fsw->cbLen = FIELD_OFFSET(FileStructW, wszName[wlen]) + sizeof(WORD);
1792 FileTimeToDosDateTime( &wfd->ftCreationTime, &fsw->uCreationDate, &fsw->uCreationTime);
1793 FileTimeToDosDateTime( &wfd->ftLastAccessTime, &fsw->uLastAccessDate, &fsw->uLastAccessTime);
1794 memcpy(fsw->wszName, wfd->cFileName, wlen * sizeof(WCHAR));
1795
1796 pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
1797 *pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
1798 TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
1799 }
1800 return pidl;
1801
1802}
#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(), _ILCreateFromPathW(), and SHELL32_CreatePidlFromBindCtx().

◆ _ILCreateFromPathW()

HRESULT _ILCreateFromPathW ( LPCWSTR  szPath,
LPITEMIDLIST ppidl 
)

Definition at line 1804 of file pidl.c.

1805{
1806 HANDLE hFile;
1807 WIN32_FIND_DATAW stffile;
1808
1809 if (!ppidl)
1810 return E_INVALIDARG;
1811
1812 hFile = FindFirstFileW(szPath, &stffile);
1815
1817
1818 *ppidl = _ILCreateFromFindDataW(&stffile);
1819
1820 return *ppidl ? S_OK : E_OUTOFMEMORY;
1821}
#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:1756
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

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

◆ _ILCreateGuid()

LPITEMIDLIST _ILCreateGuid ( PIDLTYPE  type,
REFIID  guid 
)

Definition at line 1702 of file pidl.c.

1703{
1704 LPITEMIDLIST pidlOut;
1705
1706 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1707 {
1708 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1709 if (pidlOut)
1710 {
1712
1713 pData->u.guid.guid = *guid;
1714 TRACE("-- create GUID-pidl %s\n",
1715 debugstr_guid(&(pData->u.guid.guid)));
1716 }
1717 }
1718 else
1719 {
1720 WARN("%d: invalid type for GUID\n", type);
1721 pidlOut = NULL;
1722 }
1723 return pidlOut;
1724}
#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(), and _ILCreatePrinters().

◆ _ILCreateGuidFromStrA()

LPITEMIDLIST _ILCreateGuidFromStrA ( LPCSTR  szGUID)

Definition at line 1727 of file pidl.c.

1728{
1729 IID iid;
1730
1731 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1732 {
1733 ERR("%s is not a GUID\n", szGUID);
1734 return NULL;
1735 }
1736 return _ILCreateGuid(PT_GUID, &iid);
1737}
#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 1740 of file pidl.c.

1741{
1742 IID iid;
1743
1744#ifndef __REACTOS__
1745 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1746#else
1747 if (!GUIDFromStringW(szGUID, &iid))
1748#endif
1749 {
1750 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1751 return NULL;
1752 }
1753 return _ILCreateGuid(PT_GUID, &iid);
1754}
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:256
BOOL WINAPI GUIDFromStringW(_In_ PCWSTR psz, _Out_ LPGUID pguid)

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

◆ _ILCreateIExplore()

LPITEMIDLIST _ILCreateIExplore ( void  )

Definition at line 1640 of file pidl.c.

1641{
1642 TRACE("()\n");
1643 return _ILCreateGuid(PT_GUID, &CLSID_Internet);
1644}

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

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1628 of file pidl.c.

1629{
1630 TRACE("()\n");
1631 return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
1632}

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1634 of file pidl.c.

1635{
1636 TRACE("()\n");
1637 return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1638}

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1684 of file pidl.c.

1685{
1686 TRACE("()\n");
1687 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1688}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1665 of file pidl.c.

1666{
1667 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1668
1669 TRACE("()\n");
1670 if (parent)
1671 {
1672 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1673
1674 if (printers)
1675 {
1676 ret = ILCombine(parent, printers);
1677 SHFree(printers);
1678 }
1679 SHFree(parent);
1680 }
1681 return ret;
1682}

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2661 of file pidl.c.

2662{
2663 UINT i;
2664
2665 if (apidl)
2666 {
2667 for (i = 0; i < cidl; i++)
2668 SHFree(apidl[i]);
2669 SHFree(apidl);
2670 }
2671}

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

1871{
1872 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1873
1874 if(_ILIsMyComputer(pidl))
1875 pidl = ILGetNext(pidl);
1876
1877 if (pidl && _ILIsDrive(pidl))
1878 return _ILSimpleGetText(pidl, pOut, uSize);
1879
1880 return 0;
1881}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1946
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:855
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2050
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1979

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2502 of file pidl.c.

2503{
2504 char szTemp[MAX_PATH];
2505 const char * pPoint;
2506 LPCITEMIDLIST pidlTemp=pidl;
2507
2508 TRACE("pidl=%p\n",pidl);
2509
2510 if (!pidl)
2511 return FALSE;
2512
2513 pidlTemp = ILFindLastID(pidl);
2514
2515 if (!_ILIsValue(pidlTemp))
2516 return FALSE;
2517 if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2518 return FALSE;
2519
2520 pPoint = PathFindExtensionA(szTemp);
2521
2522 if (!*pPoint)
2523 return FALSE;
2524
2525 pPoint++;
2526 lstrcpynA(pOut, pPoint, uOutSize);
2527 TRACE("%s\n",pOut);
2528
2529 return TRUE;
2530}
#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:189
BOOL _ILIsValue(LPCITEMIDLIST pidl)
Definition: pidl.c:2000

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

◆ _ILGetFileAttributes()

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

Definition at line 2621 of file pidl.c.

2622{
2624 WORD wAttrib = 0;
2625 int i;
2626
2627 if (!pData)
2628 return 0;
2629
2630 switch(pData->type)
2631 {
2632 case PT_FOLDER:
2633 case PT_VALUE:
2634 wAttrib = pData->u.file.uFileAttribs;
2635 break;
2636 }
2637
2638 if(uOutSize >= 6)
2639 {
2640 i=0;
2641 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2642 pOut[i++] = 'R';
2643 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2644 pOut[i++] = 'H';
2645 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2646 pOut[i++] = 'S';
2647 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2648 pOut[i++] = 'A';
2649 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2650 pOut[i++] = 'C';
2651 pOut[i] = 0x00;
2652 }
2653 return wAttrib;
2654}
#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 2437 of file pidl.c.

2438{
2439 FILETIME ft,lft;
2441 BOOL ret;
2442
2443 if (_ILGetFileDateTime( pidl, &ft ))
2444 {
2445 FileTimeToLocalFileTime(&ft, &lft);
2446 FileTimeToSystemTime (&lft, &time);
2447
2449 if (ret)
2450 {
2451 /* Append space + time without seconds */
2452 pOut[ret-1] = ' ';
2454 }
2455 }
2456 else
2457 {
2458 pOut[0] = '\0';
2459 ret = FALSE;
2460 }
2461 return ret;
2462}
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:2418
#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 2418 of file pidl.c.

2419{
2421
2422 if (!pdata)
2423 return FALSE;
2424
2425 switch (pdata->type)
2426 {
2427 case PT_FOLDER:
2428 case PT_VALUE:
2429 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2430 break;
2431 default:
2432 return FALSE;
2433 }
2434 return TRUE;
2435}
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 2481 of file pidl.c.

2482{
2484 DWORD dwSize;
2485
2486 if (!pdata)
2487 return 0;
2488
2489 switch (pdata->type)
2490 {
2491 case PT_VALUE:
2492 dwSize = pdata->u.file.dwFileSize;
2493 if (pOut)
2494 StrFormatKBSizeA(dwSize, pOut, uOutSize);
2495 return dwSize;
2496 }
2497 if (pOut)
2498 *pOut = 0x00;
2499 return 0;
2500}
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:1727
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 2376 of file pidl.c.

2376 {
2377 FileStructW *pFileStructW;
2378 WORD cbOffset;
2379
2380 if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
2381 return NULL;
2382
2383 cbOffset = *(const WORD *)((const BYTE *)pidl + pidl->mkid.cb - sizeof(WORD));
2384 pFileStructW = (FileStructW*)((LPBYTE)pidl + cbOffset);
2385
2386 /* Currently I don't see a fool prove way to figure out if a pidl is for sure of WinXP
2387 * style with a FileStructW member. If we switch all our shellfolder-implementations to
2388 * the new format, this won't be a problem. For now, we do as many sanity checks as possible. */
2389 if ((cbOffset & 0x1) || /* FileStructW member is word aligned in the pidl */
2390 /* FileStructW is positioned after FileStruct */
2391 cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct) ||
2392 /* There has to be enough space at cbOffset in the pidl to hold FileStructW and cbOffset */
2393 cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
2394 pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
2395 {
2396 WARN("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
2397 return NULL;
2398 }
2399
2400 return pFileStructW;
2401}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
Definition: pidl.c:1991
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 2548 of file pidl.c.

2549{
2550#ifdef __REACTOS__ /* r32966 */
2551 char sType[64];
2552#endif
2553
2554 if(_ILIsValue(pidl))
2555 {
2556 char sTemp[64];
2557
2558 if(uOutSize > 0)
2559 pOut[0] = 0;
2560#ifdef __REACTOS__ /* r32966 */
2561 if (_ILGetExtension (pidl, sType, 64))
2562 {
2563 if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
2564 {
2565 /* retrieve description */
2566 if(HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE ))
2567 return;
2568 }
2569 /* display Ext-file as description */
2570 _strupr(sType);
2571 /* load localized file string */
2572 sTemp[0] = '\0';
2574 {
2575 sTemp[63] = '\0';
2576 StringCchPrintfA(pOut, uOutSize, sTemp, sType);
2577 }
2578 }
2579#else
2580 if (_ILGetExtension (pidl, sTemp, 64))
2581 {
2582 if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
2583 && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
2584 {
2585 lstrcpynA (pOut, sTemp, uOutSize - 6);
2586 strcat (pOut, "-file");
2587 }
2588 }
2589#endif
2590 }
2591 else
2592#ifdef __REACTOS__ /* r32966 */
2593 {
2594 pOut[0] = '\0';
2596 /* make sure its null terminated */
2597 pOut[uOutSize-1] = '\0';
2598 }
2599#else
2600 lstrcpynA(pOut, "Folder", uOutSize);
2601#endif
2602}
#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:2502
_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 2340 of file pidl.c.

2341{
2343
2344 TRACE("%p\n", pidl);
2345
2346 if (!pdata)
2347 return NULL;
2348
2349 TRACE("pdata->type 0x%04x\n", pdata->type);
2350 switch (pdata->type)
2351 {
2352 case PT_SHELLEXT:
2353 case PT_GUID:
2354 case PT_YAGUID:
2355 return &(pdata->u.guid.guid);
2356
2357 default:
2358 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2359 break;
2360 }
2361 return NULL;
2362}

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

◆ _ILGetTextPointer()

LPSTR _ILGetTextPointer ( LPCITEMIDLIST  pidl)

Definition at line 2269 of file pidl.c.

2270{
2271 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2272
2274
2275 if (!pdata)
2276 return NULL;
2277
2278 switch (pdata->type)
2279 {
2280 case PT_GUID:
2281 case PT_SHELLEXT:
2282 case PT_YAGUID:
2283 return NULL;
2284
2285 case PT_DRIVE:
2286 case PT_DRIVE1:
2287 case PT_DRIVE2:
2288 case PT_DRIVE3:
2289 return pdata->u.drive.szDriveName;
2290
2291 case PT_FOLDER:
2292 case PT_FOLDER1:
2293 case PT_VALUE:
2294 case PT_IESPECIAL1:
2295 case PT_IESPECIAL2:
2296 return pdata->u.file.szNames;
2297
2298 case PT_WORKGRP:
2299 case PT_COMP:
2300 case PT_NETWORK:
2301 case PT_NETPROVIDER:
2302 case PT_SHARE:
2303 return pdata->u.network.szNames;
2304 }
2305 return NULL;
2306}
#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 2009 of file pidl.c.

2010{
2011 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2012
2013 TRACE("(%p)\n",pidl);
2014
2015 return (pidl && lpPData && (lpPData->type == 0));
2016}

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

1947{
1948 REFIID iid = _ILGetGUIDPointer(pidl);
1949
1950 TRACE("(%p)\n",pidl);
1951
1952 if (iid)
1953 return IsEqualIID(iid, &CLSID_MyComputer);
1954 return FALSE;
1955}
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2340
#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 1968 of file pidl.c.

1969{
1970 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1971
1972 TRACE("(%p)\n",pidl);
1973
1974 return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
1975 (pidl && pidl->mkid.cb == 0x00)
1976 ));
1977}

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1897 of file pidl.c.

1898{
1899 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1900
1901 TRACE("(%p)\n",pidl);
1902
1903 return (pidl && lpPData && PT_VALUEW == lpPData->type);
1904}
#define PT_VALUEW
Definition: pidl.h:96

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILSimpleGetText()

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

Definition at line 2050 of file pidl.c.

2051{
2052 DWORD dwReturn=0;
2053 LPSTR szSrc;
2054 LPWSTR szSrcW;
2055 GUID const * riid;
2056 char szTemp[MAX_PATH];
2057
2058 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2059
2060 if (!pidl)
2061 return 0;
2062
2063 if (szOut)
2064 *szOut = 0;
2065
2066 if (_ILIsDesktop(pidl))
2067 {
2068 /* desktop */
2069 if (HCR_GetClassNameA(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2070 {
2071 if (szOut)
2072 lstrcpynA(szOut, szTemp, uOutSize);
2073
2074 dwReturn = strlen (szTemp);
2075 }
2076 }
2077 else if (( szSrc = _ILGetTextPointer(pidl) ))
2078 {
2079 /* filesystem */
2080 if (szOut)
2081 lstrcpynA(szOut, szSrc, uOutSize);
2082
2083 dwReturn = strlen(szSrc);
2084 }
2085 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2086 {
2087 /* unicode filesystem */
2088 WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
2089
2090 if (szOut)
2091 lstrcpynA(szOut, szTemp, uOutSize);
2092
2093 dwReturn = strlen (szTemp);
2094 }
2095 else if (( riid = _ILGetGUIDPointer(pidl) ))
2096 {
2097 /* special folder */
2098 if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
2099 {
2100 if (szOut)
2101 lstrcpynA(szOut, szTemp, uOutSize);
2102
2103 dwReturn = strlen (szTemp);
2104 }
2105 }
2106 else
2107 {
2108 ERR("-- no text\n");
2109 }
2110
2111 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
2112 return dwReturn;
2113}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2213
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1906
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 2122 of file pidl.c.

2123{
2124 DWORD dwReturn;
2125 FileStructW *pFileStructW = _ILGetFileStructW(pidl);
2126
2127 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2128
2129 if (pFileStructW) {
2130 lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
2131 dwReturn = lstrlenW(pFileStructW->wszName);
2132 } else {
2133 GUID const * riid;
2134 WCHAR szTemp[MAX_PATH];
2135 LPSTR szSrc;
2136 LPWSTR szSrcW;
2137 dwReturn=0;
2138
2139 if (!pidl)
2140 return 0;
2141
2142 if (szOut)
2143 *szOut = 0;
2144
2145 if (_ILIsDesktop(pidl))
2146 {
2147 /* desktop */
2148 if (HCR_GetClassNameW(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2149 {
2150 if (szOut)
2151 lstrcpynW(szOut, szTemp, uOutSize);
2152
2153 dwReturn = lstrlenW (szTemp);
2154 }
2155 }
2156 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2157 {
2158 /* unicode filesystem */
2159 if (szOut)
2160 lstrcpynW(szOut, szSrcW, uOutSize);
2161
2162 dwReturn = lstrlenW(szSrcW);
2163 }
2164 else if (( szSrc = _ILGetTextPointer(pidl) ))
2165 {
2166 /* filesystem */
2167 MultiByteToWideChar(CP_ACP, 0, szSrc, -1, szTemp, MAX_PATH);
2168
2169 if (szOut)
2170 lstrcpynW(szOut, szTemp, uOutSize);
2171
2172 dwReturn = lstrlenW (szTemp);
2173 }
2174 else if (( riid = _ILGetGUIDPointer(pidl) ))
2175 {
2176 /* special folder */
2177 if ( HCR_GetClassNameW(riid, szTemp, MAX_PATH) )
2178 {
2179 if (szOut)
2180 lstrcpynW(szOut, szTemp, uOutSize);
2181
2182 dwReturn = lstrlenW (szTemp);
2183 }
2184 }
2185 else
2186 {
2187 ERR("-- no text\n");
2188 }
2189 }
2190
2191 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
2192 return dwReturn;
2193}
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl)
Definition: pidl.c:2376
BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len)
Definition: classes.c:399

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

◆ ILGetDisplayNameExW()

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

Definition at line 91 of file pidl.c.

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

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()