Commit 42f28a72 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

- rename PT_SPECIAL to PT_SHELLEXT

- remove unnecessarily complex _ILCreate - combine _ILCreateValue and _ILCreateFolder, since their outputs differed by only one byte.
parent a2ce4ea3
......@@ -70,7 +70,7 @@ LPSTR _dbg_ILGetTextPointer(LPCITEMIDLIST pidl)
switch (pdata->type)
{
case PT_GUID:
case PT_SPECIAL:
case PT_SHELLEXT:
return NULL;
case PT_DRIVE:
......@@ -128,7 +128,7 @@ REFIID _dbg_ILGetGUIDPointer(LPCITEMIDLIST pidl)
{
switch (pdata->type)
{
case PT_SPECIAL:
case PT_SHELLEXT:
case PT_GUID:
return (REFIID) &(pdata->u.guid.guid);
}
......@@ -231,7 +231,7 @@ BOOL pcheck (LPCITEMIDLIST pidl)
switch (type)
{ case PT_DESKTOP:
case PT_GUID:
case PT_SPECIAL:
case PT_SHELLEXT:
case PT_DRIVE:
case PT_DRIVE1:
case PT_DRIVE2:
......
......@@ -132,7 +132,7 @@ static BOOL CreateFolderEnumList(
if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue;
if ( (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && strcmp (stffile.cFileName, ".") && strcmp (stffile.cFileName, ".."))
{
pidl = _ILCreateFolder (&stffile);
pidl = _ILCreateFromFindDataA (&stffile);
if(pidl && AddToEnumList((IEnumIDList*)This, pidl))
{
continue;
......@@ -156,7 +156,7 @@ static BOOL CreateFolderEnumList(
if ( !(dwFlags & SHCONTF_INCLUDEHIDDEN) && (stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ) continue;
if (! (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{
pidl = _ILCreateValue(&stffile);
pidl = _ILCreateFromFindDataA(&stffile);
if(pidl && AddToEnumList((IEnumIDList*)This, pidl))
{
continue;
......@@ -258,7 +258,7 @@ int SHELL_RegisterCPanelFolders(IEnumIDList* list, HKEY hkey_root, LPCSTR szRepP
break;
if (*name == '{') {
LPITEMIDLIST pidl = _ILCreateSpecial(name);
LPITEMIDLIST pidl = _ILCreateGuidFromStrA(name);
if (pidl && AddToEnumList(list, pidl))
++cnt;
......@@ -363,7 +363,7 @@ static BOOL CreateDesktopEnumList(
if (ERROR_SUCCESS!=RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL, NULL))
break;
pidl = _ILCreateSpecial(iid);
pidl = _ILCreateGuidFromStrA(iid);
if(pidl)
AddToEnumList((IEnumIDList*)This, pidl);
......@@ -430,7 +430,7 @@ static BOOL CreateMyCompEnumList(
if (ERROR_SUCCESS!=RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL, NULL))
break;
pidl = _ILCreateSpecial(iid);
pidl = _ILCreateGuidFromStrA(iid);
if(pidl)
AddToEnumList((IEnumIDList*)This, pidl);
......
......@@ -90,7 +90,7 @@
#define PT_DRIVE 0x23
#define PT_DRIVE2 0x25
#define PT_DRIVE3 0x29
#define PT_SPECIAL 0x2E
#define PT_SHELLEXT 0x2E
#define PT_DRIVE1 0x2F
#define PT_FOLDER1 0x30
#define PT_FOLDER 0x31
......@@ -180,11 +180,28 @@ BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl);
/*
* simple pidls from strings
* simple pidls
*/
LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT);
/* Basic PIDL constructor. Allocates size + 2 bytes (to include space for the
* NULL PIDL terminator), and sets type to type.
*/
LPITEMIDLIST _ILCreateWithTypeAndSize(PIDLTYPE type, UINT size);
/* Creates a PIDL with guid format and type type, which must be either PT_GUID
* or PT_SHELLEXT.
*/
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid);
/* Like _ILCreateGuid, but using the string szGUID. */
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID);
/* Commonly used PIDLs representing file system objects. */
LPITEMIDLIST _ILCreateDesktop (void);
LPITEMIDLIST _ILCreateFromFindDataA(WIN32_FIND_DATAA *stffile);
LPITEMIDLIST _ILCreateFromPathA (LPCSTR szPath);
/* Other helpers */
LPITEMIDLIST _ILCreateMyComputer (void);
LPITEMIDLIST _ILCreateIExplore (void);
LPITEMIDLIST _ILCreateControl (void);
......@@ -192,10 +209,6 @@ LPITEMIDLIST _ILCreatePrinter (void);
LPITEMIDLIST _ILCreateNetwork (void);
LPITEMIDLIST _ILCreateBitBucket (void);
LPITEMIDLIST _ILCreateDrive (LPCSTR);
LPITEMIDLIST _ILCreateFolder (WIN32_FIND_DATAA * stffile);
LPITEMIDLIST _ILCreateValue (WIN32_FIND_DATAA * stffile);
LPITEMIDLIST _ILCreateSpecial (LPCSTR szGUID);
LPITEMIDLIST _ILCreateFromPathA (LPCSTR szPath);
LPITEMIDLIST _ILCreateCPanel (LPCSTR name, LPCSTR displayName, LPCSTR comment, int iconIdx);
/*
......
......@@ -216,7 +216,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface,
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreate (PT_GUID, &clsid, sizeof (clsid));
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
} else if (PathGetDriveNumberW (lpszDisplayName) >= 0) {
/* it's a filesystem path with a drive. Let MyComputer parse it */
pidlTemp = _ILCreateMyComputer ();
......
......@@ -212,7 +212,7 @@ ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
TRACE ("-- element: %s\n", debugstr_w (szElement));
SHCLSIDFromStringW (szElement + 2, &clsid);
pidlTemp = _ILCreate (PT_GUID, &clsid, sizeof (clsid));
pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
}
/* do we have an absolute path name ? */
else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment