ReactOS 0.4.15-dev-6661-gcc6e444
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 2667 of file pidl.c.

2668{
2669 UINT i;
2670 PITEMID_CHILD *apidldest;
2671
2672 if (!apidlsrc)
2673 return NULL;
2674
2675 apidldest = SHAlloc(cidl * sizeof(PITEMID_CHILD));
2676
2677 for (i = 0; i < cidl; i++)
2678 apidldest[i] = ILClone(apidlsrc[i]);
2679
2680 return apidldest;
2681}
#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 2688 of file pidl.c.

2689{
2690 UINT i;
2692
2693 dst = SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
2694 if (!dst)
2695 return NULL;
2696
2697 if (pidl)
2698 *pidl = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[0]]));
2699
2700 for (i = 0; i < cida->cidl; i++)
2701 dst[i] = ILClone((LPCITEMIDLIST)(&((const BYTE*)cida)[cida->aoffset[i + 1]]));
2702
2703 return dst;
2704}
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:503
unsigned char BYTE
Definition: xxhash.c:193

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

◆ _ILCreateBitBucket()

LPITEMIDLIST _ILCreateBitBucket ( void  )

Definition at line 1679 of file pidl.c.

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

Referenced by SHGetFolderLocation().

◆ _ILCreateControlPanel()

LPITEMIDLIST _ILCreateControlPanel ( void  )

Definition at line 1635 of file pidl.c.

1636{
1637 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1638
1639 TRACE("()\n");
1640 if (parent)
1641 {
1642 LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
1643
1644 if (cpl)
1645 {
1646 ret = ILCombine(parent, cpl);
1647 SHFree(cpl);
1648 }
1649 SHFree(parent);
1650 }
1651 return ret;
1652}
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 1606 of file pidl.c.

1607{
1609
1610 TRACE("()\n");
1611 ret = SHAlloc(2);
1612 if (ret)
1613 ret->mkid.cb = 0;
1614 return ret;
1615}

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

◆ _ILCreateDrive()

LPITEMIDLIST _ILCreateDrive ( LPCWSTR  lpszNew)

Definition at line 1812 of file pidl.c.

1813{
1814 LPITEMIDLIST pidlOut;
1815
1816 TRACE("(%s)\n",debugstr_w(lpszNew));
1817
1818 pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
1819 if (pidlOut)
1820 {
1821 LPSTR pszDest;
1822
1823 pszDest = _ILGetTextPointer(pidlOut);
1824 if (pszDest)
1825 {
1826 strcpy(pszDest, "x:\\");
1827 pszDest[0]=toupperW(lpszNew[0]);
1828 TRACE("-- create Drive: %s\n", debugstr_a(pszDest));
1829 }
1830 }
1831 return pidlOut;
1832}
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:2258
static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
Definition: pidl.c:1580
#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 1834 of file pidl.c.

1835{
1836 LPITEMIDLIST pidlOut;
1837
1838 TRACE("\n");
1839
1840 pidlOut = _ILAlloc(PT_NETWORK, FIELD_OFFSET(PIDLDATA, u.network.szNames[sizeof("Entire Network")]));
1841 if (pidlOut)
1842 {
1844
1845 pData->u.network.dummy = 0;
1846 strcpy(pData->u.network.szNames, "Entire Network");
1847 }
1848 return pidlOut;
1849}
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:2191
#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 1745 of file pidl.c.

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

1794{
1795 HANDLE hFile;
1796 WIN32_FIND_DATAW stffile;
1797
1798 if (!ppidl)
1799 return E_INVALIDARG;
1800
1801 hFile = FindFirstFileW(szPath, &stffile);
1804
1806
1807 *ppidl = _ILCreateFromFindDataW(&stffile);
1808
1809 return *ppidl ? S_OK : E_OUTOFMEMORY;
1810}
#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:1745
#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 1691 of file pidl.c.

1692{
1693 LPITEMIDLIST pidlOut;
1694
1695 if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
1696 {
1697 pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
1698 if (pidlOut)
1699 {
1701
1702 pData->u.guid.guid = *guid;
1703 TRACE("-- create GUID-pidl %s\n",
1704 debugstr_guid(&(pData->u.guid.guid)));
1705 }
1706 }
1707 else
1708 {
1709 WARN("%d: invalid type for GUID\n", type);
1710 pidlOut = NULL;
1711 }
1712 return pidlOut;
1713}
#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 1716 of file pidl.c.

1717{
1718 IID iid;
1719
1720 if (FAILED(SHCLSIDFromStringA(szGUID, &iid)))
1721 {
1722 ERR("%s is not a GUID\n", szGUID);
1723 return NULL;
1724 }
1725 return _ILCreateGuid(PT_GUID, &iid);
1726}
#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 1729 of file pidl.c.

1730{
1731 IID iid;
1732
1733#ifndef __REACTOS__
1734 if (FAILED(SHCLSIDFromStringW(szGUID, &iid)))
1735#else
1736 if (!GUIDFromStringW(szGUID, &iid))
1737#endif
1738 {
1739 ERR("%s is not a GUID\n", debugstr_w(szGUID));
1740 return NULL;
1741 }
1742 return _ILCreateGuid(PT_GUID, &iid);
1743}
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 1629 of file pidl.c.

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

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

◆ _ILCreateMyComputer()

LPITEMIDLIST _ILCreateMyComputer ( void  )

Definition at line 1617 of file pidl.c.

1618{
1619 TRACE("()\n");
1620 return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
1621}

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

◆ _ILCreateMyDocuments()

LPITEMIDLIST _ILCreateMyDocuments ( void  )

Definition at line 1623 of file pidl.c.

1624{
1625 TRACE("()\n");
1626 return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
1627}

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

◆ _ILCreateNetHood()

LPITEMIDLIST _ILCreateNetHood ( void  )

◆ _ILCreateNetwork()

LPITEMIDLIST _ILCreateNetwork ( void  )

Definition at line 1673 of file pidl.c.

1674{
1675 TRACE("()\n");
1676 return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
1677}

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

◆ _ILCreatePrinters()

LPITEMIDLIST _ILCreatePrinters ( void  )

Definition at line 1654 of file pidl.c.

1655{
1656 LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
1657
1658 TRACE("()\n");
1659 if (parent)
1660 {
1661 LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
1662
1663 if (printers)
1664 {
1665 ret = ILCombine(parent, printers);
1666 SHFree(printers);
1667 }
1668 SHFree(parent);
1669 }
1670 return ret;
1671}

Referenced by SHGetFolderLocation().

◆ _ILFreeaPidl()

void _ILFreeaPidl ( LPITEMIDLIST apidl,
UINT  cidl 
)

Definition at line 2650 of file pidl.c.

2651{
2652 UINT i;
2653
2654 if (apidl)
2655 {
2656 for (i = 0; i < cidl; i++)
2657 SHFree(apidl[i]);
2658 SHFree(apidl);
2659 }
2660}

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

1860{
1861 TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
1862
1863 if(_ILIsMyComputer(pidl))
1864 pidl = ILGetNext(pidl);
1865
1866 if (pidl && _ILIsDrive(pidl))
1867 return _ILSimpleGetText(pidl, pOut, uSize);
1868
1869 return 0;
1870}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
Definition: pidl.c:1935
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:855
DWORD _ILSimpleGetText(LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
Definition: pidl.c:2039
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:1968

Referenced by _ILGetDriveType(), and DrivesContextMenuCallback().

◆ _ILGetExtension()

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

Definition at line 2491 of file pidl.c.

2492{
2493 char szTemp[MAX_PATH];
2494 const char * pPoint;
2495 LPCITEMIDLIST pidlTemp=pidl;
2496
2497 TRACE("pidl=%p\n",pidl);
2498
2499 if (!pidl)
2500 return FALSE;
2501
2502 pidlTemp = ILFindLastID(pidl);
2503
2504 if (!_ILIsValue(pidlTemp))
2505 return FALSE;
2506 if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH))
2507 return FALSE;
2508
2509 pPoint = PathFindExtensionA(szTemp);
2510
2511 if (!*pPoint)
2512 return FALSE;
2513
2514 pPoint++;
2515 lstrcpynA(pOut, pPoint, uOutSize);
2516 TRACE("%s\n",pOut);
2517
2518 return TRUE;
2519}
#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:1989

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

◆ _ILGetFileAttributes()

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

Definition at line 2610 of file pidl.c.

2611{
2613 WORD wAttrib = 0;
2614 int i;
2615
2616 if (!pData)
2617 return 0;
2618
2619 switch(pData->type)
2620 {
2621 case PT_FOLDER:
2622 case PT_VALUE:
2623 wAttrib = pData->u.file.uFileAttribs;
2624 break;
2625 }
2626
2627 if(uOutSize >= 6)
2628 {
2629 i=0;
2630 if(wAttrib & FILE_ATTRIBUTE_READONLY)
2631 pOut[i++] = 'R';
2632 if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
2633 pOut[i++] = 'H';
2634 if(wAttrib & FILE_ATTRIBUTE_SYSTEM)
2635 pOut[i++] = 'S';
2636 if(wAttrib & FILE_ATTRIBUTE_ARCHIVE)
2637 pOut[i++] = 'A';
2638 if(wAttrib & FILE_ATTRIBUTE_COMPRESSED)
2639 pOut[i++] = 'C';
2640 pOut[i] = 0x00;
2641 }
2642 return wAttrib;
2643}
#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 2426 of file pidl.c.

2427{
2428 FILETIME ft,lft;
2430 BOOL ret;
2431
2432 if (_ILGetFileDateTime( pidl, &ft ))
2433 {
2434 FileTimeToLocalFileTime(&ft, &lft);
2435 FileTimeToSystemTime (&lft, &time);
2436
2438 if (ret)
2439 {
2440 /* Append space + time without seconds */
2441 pOut[ret-1] = ' ';
2443 }
2444 }
2445 else
2446 {
2447 pOut[0] = '\0';
2448 ret = FALSE;
2449 }
2450 return ret;
2451}
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:2407
#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 2407 of file pidl.c.

2408{
2410
2411 if (!pdata)
2412 return FALSE;
2413
2414 switch (pdata->type)
2415 {
2416 case PT_FOLDER:
2417 case PT_VALUE:
2418 DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt);
2419 break;
2420 default:
2421 return FALSE;
2422 }
2423 return TRUE;
2424}
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 2470 of file pidl.c.

2471{
2473 DWORD dwSize;
2474
2475 if (!pdata)
2476 return 0;
2477
2478 switch (pdata->type)
2479 {
2480 case PT_VALUE:
2481 dwSize = pdata->u.file.dwFileSize;
2482 if (pOut)
2483 StrFormatKBSizeA(dwSize, pOut, uOutSize);
2484 return dwSize;
2485 }
2486 if (pOut)
2487 *pOut = 0x00;
2488 return 0;
2489}
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 2365 of file pidl.c.

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

2538{
2539#ifdef __REACTOS__ /* r32966 */
2540 char sType[64];
2541#endif
2542
2543 if(_ILIsValue(pidl))
2544 {
2545 char sTemp[64];
2546
2547 if(uOutSize > 0)
2548 pOut[0] = 0;
2549#ifdef __REACTOS__ /* r32966 */
2550 if (_ILGetExtension (pidl, sType, 64))
2551 {
2552 if (HCR_MapTypeToValueA(sType, sTemp, 64, TRUE))
2553 {
2554 /* retrieve description */
2555 if(HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE ))
2556 return;
2557 }
2558 /* display Ext-file as description */
2559 _strupr(sType);
2560 /* load localized file string */
2561 sTemp[0] = '\0';
2563 {
2564 sTemp[63] = '\0';
2565 StringCchPrintfA(pOut, uOutSize, sTemp, sType);
2566 }
2567 }
2568#else
2569 if (_ILGetExtension (pidl, sTemp, 64))
2570 {
2571 if (!( HCR_MapTypeToValueA(sTemp, sTemp, 64, TRUE)
2572 && HCR_MapTypeToValueA(sTemp, pOut, uOutSize, FALSE )))
2573 {
2574 lstrcpynA (pOut, sTemp, uOutSize - 6);
2575 strcat (pOut, "-file");
2576 }
2577 }
2578#endif
2579 }
2580 else
2581#ifdef __REACTOS__ /* r32966 */
2582 {
2583 pOut[0] = '\0';
2585 /* make sure its null terminated */
2586 pOut[uOutSize-1] = '\0';
2587 }
2588#else
2589 lstrcpynA(pOut, "Folder", uOutSize);
2590#endif
2591}
#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:2491
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot)
Definition: classes.c:88
#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 2329 of file pidl.c.

2330{
2332
2333 TRACE("%p\n", pidl);
2334
2335 if (!pdata)
2336 return NULL;
2337
2338 TRACE("pdata->type 0x%04x\n", pdata->type);
2339 switch (pdata->type)
2340 {
2341 case PT_SHELLEXT:
2342 case PT_GUID:
2343 case PT_YAGUID:
2344 return &(pdata->u.guid.guid);
2345
2346 default:
2347 TRACE("Unknown pidl type 0x%04x\n", pdata->type);
2348 break;
2349 }
2350 return NULL;
2351}

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

2259{
2260 /* TRACE(pidl,"(pidl%p)\n", pidl);*/
2261
2263
2264 if (!pdata)
2265 return NULL;
2266
2267 switch (pdata->type)
2268 {
2269 case PT_GUID:
2270 case PT_SHELLEXT:
2271 case PT_YAGUID:
2272 return NULL;
2273
2274 case PT_DRIVE:
2275 case PT_DRIVE1:
2276 case PT_DRIVE2:
2277 case PT_DRIVE3:
2278 return pdata->u.drive.szDriveName;
2279
2280 case PT_FOLDER:
2281 case PT_FOLDER1:
2282 case PT_VALUE:
2283 case PT_IESPECIAL1:
2284 case PT_IESPECIAL2:
2285 return pdata->u.file.szNames;
2286
2287 case PT_WORKGRP:
2288 case PT_COMP:
2289 case PT_NETWORK:
2290 case PT_NETPROVIDER:
2291 case PT_SHARE:
2292 return pdata->u.network.szNames;
2293 }
2294 return NULL;
2295}
#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 1998 of file pidl.c.

1999{
2000 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
2001
2002 TRACE("(%p)\n",pidl);
2003
2004 return (pidl && lpPData && (lpPData->type == 0));
2005}

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

1936{
1937 REFIID iid = _ILGetGUIDPointer(pidl);
1938
1939 TRACE("(%p)\n",pidl);
1940
1941 if (iid)
1942 return IsEqualIID(iid, &CLSID_MyComputer);
1943 return FALSE;
1944}
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2329
#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 838 of file shellbrowser.cpp.

839{
840 LPCITEMIDLIST pidlnext;
841 WORD length;
842 BOOL ret;
843
844 ret = TRUE;
845 if (! _ILIsDesktop(pidl))
846 {
847 length = pidl->mkid.cb;
848 pidlnext =
849 reinterpret_cast<LPCITEMIDLIST>(
850 reinterpret_cast<const BYTE *>(pidl) + length);
851 if (pidlnext->mkid.cb != 0)
852 ret = FALSE;
853 }
854 return ret;
855}
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 1957 of file pidl.c.

1958{
1959 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1960
1961 TRACE("(%p)\n",pidl);
1962
1963 return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
1964 (pidl && pidl->mkid.cb == 0x00)
1965 ));
1966}

Referenced by SHGetDataFromIDListA().

◆ _ILIsUnicode()

BOOL _ILIsUnicode ( LPCITEMIDLIST  pidl)

Definition at line 1886 of file pidl.c.

1887{
1888 LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
1889
1890 TRACE("(%p)\n",pidl);
1891
1892 return (pidl && lpPData && PT_VALUEW == lpPData->type);
1893}
#define PT_VALUEW
Definition: pidl.h:96

Referenced by pdump_impl().

◆ _ILIsValue()

◆ _ILSimpleGetText()

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

Definition at line 2039 of file pidl.c.

2040{
2041 DWORD dwReturn=0;
2042 LPSTR szSrc;
2043 LPWSTR szSrcW;
2044 GUID const * riid;
2045 char szTemp[MAX_PATH];
2046
2047 TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
2048
2049 if (!pidl)
2050 return 0;
2051
2052 if (szOut)
2053 *szOut = 0;
2054
2055 if (_ILIsDesktop(pidl))
2056 {
2057 /* desktop */
2058 if (HCR_GetClassNameA(&CLSID_ShellDesktop, szTemp, MAX_PATH))
2059 {
2060 if (szOut)
2061 lstrcpynA(szOut, szTemp, uOutSize);
2062
2063 dwReturn = strlen (szTemp);
2064 }
2065 }
2066 else if (( szSrc = _ILGetTextPointer(pidl) ))
2067 {
2068 /* filesystem */
2069 if (szOut)
2070 lstrcpynA(szOut, szSrc, uOutSize);
2071
2072 dwReturn = strlen(szSrc);
2073 }
2074 else if (( szSrcW = _ILGetTextPointerW(pidl) ))
2075 {
2076 /* unicode filesystem */
2077 WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
2078
2079 if (szOut)
2080 lstrcpynA(szOut, szTemp, uOutSize);
2081
2082 dwReturn = strlen (szTemp);
2083 }
2084 else if (( riid = _ILGetGUIDPointer(pidl) ))
2085 {
2086 /* special folder */
2087 if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
2088 {
2089 if (szOut)
2090 lstrcpynA(szOut, szTemp, uOutSize);
2091
2092 dwReturn = strlen (szTemp);
2093 }
2094 }
2095 else
2096 {
2097 ERR("-- no text\n");
2098 }
2099
2100 TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
2101 return dwReturn;
2102}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
REFIID riid
Definition: atlbase.h:39
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl)
Definition: pidl.c:2202
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: pidl.c:1895
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len)
Definition: classes.c:417
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by _ILGetDrive(), and _ILGetExtension().

◆ _ILSimpleGetTextW()

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

Definition at line 2111 of file pidl.c.

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

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:1341
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
#define ILGDN_NORMAL
Definition: undocshell.h:69
#define ILGDN_INFOLDER
Definition: undocshell.h:70
#define ILGDN_FORPARSING
Definition: undocshell.h:68

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