Author: akhaldi
Date: Mon Nov 3 19:58:55 2014
New Revision: 65234
URL:
http://svn.reactos.org/svn/reactos?rev=65234&view=rev
Log:
[SHELL32]
* Partial sync of pidl.c and pidl.h with Wine 1.7.27.
CORE-8540
Modified:
branches/shell-experiments/dll/win32/shell32/wine/pidl.c
branches/shell-experiments/dll/win32/shell32/wine/pidl.h
Modified: branches/shell-experiments/dll/win32/shell32/wine/pidl.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/pidl.c [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/pidl.c [iso-8859-1] Mon Nov 3
19:58:55 2014
@@ -53,7 +53,7 @@
static LPWSTR _ILGetTextPointerW(LPCITEMIDLIST pidl);
/*************************************************************************
- * ILGetDisplayNameExA [SHELL32.186]
+ * ILGetDisplayNameExA
*
* Retrieves the display name of an ItemIDList
*
@@ -187,7 +187,7 @@
{
LPCITEMIDLIST pidlLast = pidl;
- TRACE("(pidl=%p)\n", pidl);
+ TRACE("(pidl=%p)\n",pidl);
if (!pidl)
return NULL;
@@ -208,7 +208,7 @@
*/
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
{
- TRACE_(shell)("pidl=%p\n", pidl);
+ TRACE_(shell)("pidl=%p\n",pidl);
if (!pidl || !pidl->mkid.cb)
return 0;
@@ -233,9 +233,9 @@
len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)SHAlloc(len);
if (newpidl)
- memcpy(newpidl, pidl, len);
-
- TRACE("pidl=%p newpidl=%p\n", pidl, newpidl);
+ memcpy(newpidl,pidl,len);
+
+ TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
pdump(pidl);
return newpidl;
@@ -261,13 +261,13 @@
pidlNew = (LPITEMIDLIST)SHAlloc(len + 2);
if (pidlNew)
{
- memcpy(pidlNew, pidl, len + 2); /* 2 -> mind a desktop pidl */
+ memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */
if (len)
ILGetNext(pidlNew)->mkid.cb = 0x00;
}
}
- TRACE("-- newpidl=%p\n", pidlNew);
+ TRACE("-- newpidl=%p\n",pidlNew);
return pidlNew;
}
@@ -462,9 +462,9 @@
len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)Alloc(len);
if (newpidl)
- memcpy(newpidl, pidl, len);
-
- TRACE("pidl=%p newpidl=%p\n", pidl, newpidl);
+ memcpy(newpidl,pidl,len);
+
+ TRACE("pidl=%p newpidl=%p\n",pidl, newpidl);
pdump(pidl);
return newpidl;
@@ -482,7 +482,7 @@
LPCITEMIDLIST pidltemp1 = pidl1;
LPCITEMIDLIST pidltemp2 = pidl2;
- TRACE("pidl1=%p pidl2=%p\n", pidl1, pidl2);
+ TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
/*
* Explorer reads from registry directly (StreamMRU),
@@ -534,6 +534,8 @@
* parent = a/b, child = a/b/c -> true, c is in folder a/b
* child = a/b/c/d -> false if bImmediate is true, d is not in folder a/b
* child = a/b/c/d -> true if bImmediate is false, d is in a subfolder of a/b
+ * child = a/b -> false if bImmediate is true
+ * child = a/b -> true if bImmediate is false
*/
BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL
bImmediate)
{
@@ -559,7 +561,7 @@
pChild = ILGetNext(pChild);
}
- /* child shorter or has equal length to parent */
+ /* child has shorter name than parent */
if (pParent->mkid.cb || !pChild->mkid.cb)
return FALSE;
@@ -596,9 +598,9 @@
LPCITEMIDLIST pidltemp1 = pidl1;
LPCITEMIDLIST pidltemp2 = pidl2;
- LPCITEMIDLIST ret = NULL;
-
- TRACE("pidl1=%p pidl2=%p\n", pidl1, pidl2);
+ LPCITEMIDLIST ret=NULL;
+
+ TRACE("pidl1=%p pidl2=%p\n",pidl1, pidl2);
/* explorer reads from registry directly (StreamMRU),
so we can only check here */
@@ -655,10 +657,10 @@
*/
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
{
- DWORD len1, len2;
+ DWORD len1,len2;
LPITEMIDLIST pidlNew;
- TRACE("pidl=%p pidl=%p\n", pidl1, pidl2);
+ TRACE("pidl=%p pidl=%p\n",pidl1,pidl2);
if (!pidl1 && !pidl2) return NULL;
@@ -677,14 +679,14 @@
return pidlNew;
}
- len1 = ILGetSize(pidl1) - 2;
+ len1 = ILGetSize(pidl1)-2;
len2 = ILGetSize(pidl2);
pidlNew = (LPITEMIDLIST)SHAlloc(len1 + len2);
if (pidlNew)
{
- memcpy(pidlNew, pidl1, len1);
- memcpy(((BYTE *)pidlNew) + len1, pidl2, len2);
+ memcpy(pidlNew,pidl1,len1);
+ memcpy(((BYTE *)pidlNew)+len1,pidl2,len2);
}
/* TRACE(pidl,"--new pidl=%p\n",pidlNew);*/
@@ -721,8 +723,8 @@
/*assert(pida->cidl==1);*/
LPIDA pida = (LPIDA)GlobalLock(medium.u.hGlobal);
- LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida +
pida->aoffset[0]);
- LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida +
pida->aoffset[1]);
+ LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST)
((LPBYTE)pida+pida->aoffset[0]);
+ LPCITEMIDLIST pidl_child = (LPCITEMIDLIST)
((LPBYTE)pida+pida->aoffset[1]);
*pidlReal = ILCombine(pidl_folder, pidl_child);
@@ -746,7 +748,7 @@
*/
EXTERN_C LPITEMIDLIST WINAPI SHLogILFromFSIL(LPITEMIDLIST pidl)
{
- FIXME("(pidl=%p)\n", pidl);
+ FIXME("(pidl=%p)\n",pidl);
pdump(pidl);
@@ -770,7 +772,7 @@
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
{
LPCSHITEMID si;
- UINT len = 0;
+ UINT len=0;
if (pidl)
{
@@ -779,11 +781,11 @@
while (si->cb)
{
len += si->cb;
- si = (LPCSHITEMID)(((const BYTE*)si) + si->cb);
+ si = (LPCSHITEMID)(((const BYTE*)si)+si->cb);
}
len += 2;
}
- TRACE("pidl=%p size=%u\n", pidl, len);
+ TRACE("pidl=%p size=%u\n",pidl, len);
return len;
}
@@ -814,7 +816,7 @@
len = pidl->mkid.cb;
if (len)
{
- pidl = (LPCITEMIDLIST) (((const BYTE*)pidl) + len);
+ pidl = (LPCITEMIDLIST) (((const BYTE*)pidl)+len);
TRACE("-- %p\n", pidl);
return (LPITEMIDLIST)pidl;
}
@@ -878,7 +880,7 @@
*/
void WINAPI ILFree(LPITEMIDLIST pidl)
{
- TRACE("(pidl=%p)\n", pidl);
+ TRACE("(pidl=%p)\n",pidl);
SHFree(pidl);
}
@@ -989,8 +991,8 @@
HRESULT ret;
TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile,
bBindCtx,
- ppidl, ppidl ? *ppidl : NULL,
- prgfInOut, prgfInOut ? *prgfInOut : 0);
+ ppidl, ppidl ? *ppidl : NULL,
+ prgfInOut, prgfInOut ? *prgfInOut : 0);
ret = SHGetDesktopFolder(&pSF);
if (FAILED(ret))
@@ -1085,7 +1087,7 @@
LPSTR filename, shortname;
WIN32_FIND_DATAA * pfd;
- TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n", psf, pidl, nFormat,
dest, len);
+ TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x
stub\n",psf,pidl,nFormat,dest,len);
pdump(pidl);
if (!psf || !dest)
@@ -1093,41 +1095,41 @@
switch (nFormat)
{
- case SHGDFIL_FINDDATA:
+ case SHGDFIL_FINDDATA:
pfd = (WIN32_FIND_DATAA *)dest;
- if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
- return E_INVALIDARG;
+ if (_ILIsDrive(pidl) || _ILIsSpecialFolder(pidl))
+ return E_INVALIDARG;
if (len < (int)sizeof(WIN32_FIND_DATAA))
- return E_INVALIDARG;
-
- ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
- _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
- pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
- pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
-
- filename = _ILGetTextPointer(pidl);
- shortname = _ILGetSTextPointer(pidl);
-
- if (filename)
- lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
- else
- pfd->cFileName[0] = '\0';
-
- if (shortname)
- lstrcpynA(pfd->cAlternateFileName, shortname,
sizeof(pfd->cAlternateFileName));
- else
- pfd->cAlternateFileName[0] = '\0';
- return S_OK;
-
- case SHGDFIL_NETRESOURCE:
- case SHGDFIL_DESCRIPTIONID:
- FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
- break;
-
- default:
- ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
+ return E_INVALIDARG;
+
+ ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
+ _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
+ pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
+ pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
+
+ filename = _ILGetTextPointer(pidl);
+ shortname = _ILGetSTextPointer(pidl);
+
+ if (filename)
+ lstrcpynA(pfd->cFileName, filename, sizeof(pfd->cFileName));
+ else
+ pfd->cFileName[0] = '\0';
+
+ if (shortname)
+ lstrcpynA(pfd->cAlternateFileName, shortname,
sizeof(pfd->cAlternateFileName));
+ else
+ pfd->cAlternateFileName[0] = '\0';
+ return S_OK;
+
+ case SHGDFIL_NETRESOURCE:
+ case SHGDFIL_DESCRIPTIONID:
+ FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
+ break;
+
+ default:
+ ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
}
return E_INVALIDARG;
@@ -1143,7 +1145,7 @@
LPSTR filename, shortname;
WIN32_FIND_DATAW * pfd = (WIN32_FIND_DATAW *)dest;
- TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n", psf, pidl, nFormat,
dest, len);
+ TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x
stub\n",psf,pidl,nFormat,dest,len);
pdump(pidl);
@@ -1152,41 +1154,41 @@
switch (nFormat)
{
- case SHGDFIL_FINDDATA:
+ case SHGDFIL_FINDDATA:
pfd = (WIN32_FIND_DATAW *)dest;
- if (_ILIsDrive(pidl))
- return E_INVALIDARG;
+ if (_ILIsDrive(pidl))
+ return E_INVALIDARG;
if (len < (int)sizeof(WIN32_FIND_DATAW))
- return E_INVALIDARG;
-
- ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
- _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
- pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
- pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
-
- filename = _ILGetTextPointer(pidl);
- shortname = _ILGetSTextPointer(pidl);
-
- if (!filename)
- pfd->cFileName[0] = '\0';
- else if (!MultiByteToWideChar(CP_ACP, 0, filename, -1, pfd->cFileName,
MAX_PATH))
- pfd->cFileName[MAX_PATH-1] = 0;
-
- if (!shortname)
- pfd->cAlternateFileName[0] = '\0';
- else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1,
pfd->cAlternateFileName, 14))
- pfd->cAlternateFileName[13] = 0;
- return S_OK;
-
- case SHGDFIL_NETRESOURCE:
- case SHGDFIL_DESCRIPTIONID:
- FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
- break;
-
- default:
- ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
+ return E_INVALIDARG;
+
+ ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
+ _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
+ pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
+ pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
+
+ filename = _ILGetTextPointer(pidl);
+ shortname = _ILGetSTextPointer(pidl);
+
+ if (!filename)
+ pfd->cFileName[0] = '\0';
+ else if (!MultiByteToWideChar(CP_ACP, 0, filename, -1, pfd->cFileName,
MAX_PATH))
+ pfd->cFileName[MAX_PATH-1] = 0;
+
+ if (!shortname)
+ pfd->cAlternateFileName[0] = '\0';
+ else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1,
pfd->cAlternateFileName, 14))
+ pfd->cAlternateFileName[13] = 0;
+ return S_OK;
+
+ case SHGDFIL_NETRESOURCE:
+ case SHGDFIL_DESCRIPTIONID:
+ FIXME_(shell)("SHGDFIL %i stub\n", nFormat);
+ break;
+
+ default:
+ ERR_(shell)("Unknown SHGDFIL %i, please report\n", nFormat);
}
return E_INVALIDARG;
@@ -1252,13 +1254,13 @@
WARN("Wrong dwAttributes or GetAttributesOf failed: %x\n", hr);
return FALSE;
}
-
+
hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING,
&strret);
if (FAILED(hr)) return FALSE;
hr = StrRetToBufW(&strret, pidlLast, pszPath, MAX_PATH);
- TRACE_(shell)("-- %s, 0x%08x\n", debugstr_w(pszPath), hr);
+ TRACE_(shell)("-- %s, 0x%08x\n",debugstr_w(pszPath), hr);
return SUCCEEDED(hr);
}
@@ -1272,10 +1274,10 @@
TRACE_(shell)("pidl=%p\n", pidl);
pdump(pidl);
-
+
if (!pidl || !ppv)
return E_INVALIDARG;
-
+
*ppv = NULL;
if (ppidlLast)
*ppidlLast = NULL;
@@ -1300,7 +1302,7 @@
if (SUCCEEDED(hr) && ppidlLast)
*ppidlLast = ILFindLastID(pidl);
- TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08x\n", *ppv, (ppidlLast) ?
*ppidlLast : NULL, hr);
+ TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08x\n", *ppv,
(ppidlLast)?*ppidlLast:NULL, hr);
return hr;
}
@@ -1480,7 +1482,7 @@
LPITEMIDLIST _ILCreateFromFindDataW( const WIN32_FIND_DATAW *wfd )
{
- char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
+ char buff[MAX_PATH + 14 +1]; /* see WIN32_FIND_DATA */
DWORD len, len1, wlen, alen, cbData;
LPITEMIDLIST pidl;
PIDLTYPE type;
@@ -1488,11 +1490,11 @@
if (!wfd)
return NULL;
- TRACE("(%s, %s)\n", debugstr_w(wfd->cAlternateFileName),
debugstr_w(wfd->cFileName));
+ TRACE("(%s, %s)\n",debugstr_w(wfd->cAlternateFileName),
debugstr_w(wfd->cFileName));
/* prepare buffer with both names */
- len = WideCharToMultiByte(CP_ACP, 0, wfd->cFileName, -1, buff, MAX_PATH, NULL,
NULL);
- len1 = WideCharToMultiByte(CP_ACP, 0, wfd->cAlternateFileName, -1, buff + len,
sizeof(buff) - len, NULL, NULL);
+ len = WideCharToMultiByte(CP_ACP,0,wfd->cFileName,-1,buff,MAX_PATH,NULL,NULL);
+ len1 = WideCharToMultiByte(CP_ACP,0,wfd->cAlternateFileName,-1, buff+len,
sizeof(buff)-len, NULL, NULL);
alen = len + len1;
type = (wfd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? PT_FOLDER :
PT_VALUE;
@@ -1522,7 +1524,7 @@
pOffsetW = (WORD*)((LPBYTE)pidl + pidl->mkid.cb - sizeof(WORD));
*pOffsetW = (LPBYTE)fsw - (LPBYTE)pidl;
- TRACE("-- Set Value: %s\n", debugstr_w(fsw->wszName));
+ TRACE("-- Set Value: %s\n",debugstr_w(fsw->wszName));
}
return pidl;
@@ -1551,7 +1553,7 @@
{
LPITEMIDLIST pidlOut;
- TRACE("(%s)\n", debugstr_w(lpszNew));
+ TRACE("(%s)\n",debugstr_w(lpszNew));
pidlOut = _ILAlloc(PT_DRIVE, sizeof(DriveStruct));
if (pidlOut)
@@ -1577,9 +1579,9 @@
* RETURNS
* strlen (lpszText)
*/
-DWORD _ILGetDrive(LPCITEMIDLIST pidl, LPSTR pOut, UINT uSize)
-{
- TRACE("(%p,%p,%u)\n", pidl, pOut, uSize);
+DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT uSize)
+{
+ TRACE("(%p,%p,%u)\n",pidl,pOut,uSize);
if(_ILIsMyComputer(pidl))
pidl = ILGetNext(pidl);
@@ -1608,14 +1610,14 @@
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return (pidl && lpPData && PT_VALUEW == lpPData->type);
}
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
{
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return pidl && pidl->mkid.cb ? 0 : 1;
}
@@ -1668,7 +1670,7 @@
{
IID *iid = _ILGetGUIDPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
if (iid)
return IsEqualIID(iid, &CLSID_MyComputer);
@@ -1713,30 +1715,30 @@
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
-
- return (pidl && ( (lpPData && (PT_GUID == lpPData->type ||
PT_SHELLEXT == lpPData->type || PT_YAGUID == lpPData->type)) ||
- (pidl && pidl->mkid.cb == 0x00)
- ));
+ TRACE("(%p)\n",pidl);
+
+ return (pidl && ( (lpPData && (PT_GUID== lpPData->type ||
PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
+ (pidl && pidl->mkid.cb == 0x00)
+ ));
}
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return (pidl && lpPData && (PT_DRIVE == lpPData->type ||
- PT_DRIVE1 == lpPData->type ||
- PT_DRIVE2 == lpPData->type ||
- PT_DRIVE3 == lpPData->type));
+ PT_DRIVE1 == lpPData->type ||
+ PT_DRIVE2 == lpPData->type ||
+ PT_DRIVE3 == lpPData->type));
}
BOOL _ILIsFolder(LPCITEMIDLIST pidl)
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return (pidl && lpPData && (PT_FOLDER == lpPData->type ||
PT_FOLDER1 == lpPData->type));
}
@@ -1745,7 +1747,7 @@
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return (pidl && lpPData && PT_VALUE == lpPData->type);
}
@@ -1754,7 +1756,7 @@
{
LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
- TRACE("(%p)\n", pidl);
+ TRACE("(%p)\n",pidl);
return (pidl && lpPData && (lpPData->type == 0));
}
@@ -1784,22 +1786,22 @@
* ### 3. section getting values from pidls ###
*/
-/**************************************************************************
-* _ILSimpleGetText
-*
-* gets the text for the first item in the pidl (eg. simple pidl)
-*
-* returns the length of the string
-*/
+ /**************************************************************************
+ * _ILSimpleGetText
+ *
+ * gets the text for the first item in the pidl (eg. simple pidl)
+ *
+ * returns the length of the string
+ */
DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
{
- DWORD dwReturn = 0;
+ DWORD dwReturn=0;
LPSTR szSrc;
LPWSTR szSrcW;
GUID const * riid;
char szTemp[MAX_PATH];
- TRACE("(%p %p %x)\n", pidl, szOut, uOutSize);
+ TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
if (!pidl)
return 0;
@@ -1829,7 +1831,7 @@
else if (( szSrcW = _ILGetTextPointerW(pidl) ))
{
/* unicode filesystem */
- WideCharToMultiByte(CP_ACP, 0, szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
+ WideCharToMultiByte(CP_ACP,0,szSrcW, -1, szTemp, MAX_PATH, NULL, NULL);
if (szOut)
lstrcpynA(szOut, szTemp, uOutSize);
@@ -1839,7 +1841,7 @@
else if (( riid = _ILGetGUIDPointer(pidl) ))
{
/* special folder */
- if (HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
+ if ( HCR_GetClassNameA(riid, szTemp, MAX_PATH) )
{
if (szOut)
lstrcpynA(szOut, szTemp, uOutSize);
@@ -1852,23 +1854,23 @@
ERR("-- no text\n");
}
- TRACE("-- (%p=%s 0x%08x)\n", szOut, debugstr_a(szOut), dwReturn);
+ TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_a(szOut),dwReturn);
return dwReturn;
}
-/**************************************************************************
-* _ILSimpleGetTextW
-*
-* gets the text for the first item in the pidl (eg. simple pidl)
-*
-* returns the length of the string
-*/
+ /**************************************************************************
+ * _ILSimpleGetTextW
+ *
+ * gets the text for the first item in the pidl (eg. simple pidl)
+ *
+ * returns the length of the string
+ */
DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize)
{
DWORD dwReturn;
FileStructW *pFileStructW = _ILGetFileStructW(pidl);
- TRACE("(%p %p %x)\n", pidl, szOut, uOutSize);
+ TRACE("(%p %p %x)\n",pidl,szOut,uOutSize);
if (pFileStructW) {
lstrcpynW(szOut, pFileStructW->wszName, uOutSize);
@@ -1878,7 +1880,7 @@
WCHAR szTemp[MAX_PATH];
LPSTR szSrc;
LPWSTR szSrcW;
- dwReturn = 0;
+ dwReturn=0;
if (!pidl)
return 0;
@@ -1932,7 +1934,7 @@
}
}
- TRACE("-- (%p=%s 0x%08x)\n", szOut, debugstr_w(szOut), dwReturn);
+ TRACE("-- (%p=%s 0x%08x)\n",szOut,debugstr_w(szOut),dwReturn);
return dwReturn;
}
@@ -1965,36 +1967,36 @@
switch (pdata->type)
{
- case PT_GUID:
- case PT_SHELLEXT:
- case PT_YAGUID:
- return NULL;
-
- case PT_DRIVE:
- case PT_DRIVE1:
- case PT_DRIVE2:
- case PT_DRIVE3:
- /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
- return NULL;
-
- case PT_FOLDER:
- case PT_FOLDER1:
- case PT_VALUE:
- case PT_IESPECIAL1:
- case PT_IESPECIAL2:
- /*return (LPSTR)&(pdata->u.file.szNames);*/
- return NULL;
-
- case PT_WORKGRP:
- case PT_COMP:
- case PT_NETWORK:
- case PT_NETPROVIDER:
- case PT_SHARE:
- /*return (LPSTR)&(pdata->u.network.szNames);*/
- return NULL;
-
- case PT_VALUEW:
- return (LPWSTR)pdata->u.file.szNames;
+ case PT_GUID:
+ case PT_SHELLEXT:
+ case PT_YAGUID:
+ return NULL;
+
+ case PT_DRIVE:
+ case PT_DRIVE1:
+ case PT_DRIVE2:
+ case PT_DRIVE3:
+ /*return (LPSTR)&(pdata->u.drive.szDriveName);*/
+ return NULL;
+
+ case PT_FOLDER:
+ case PT_FOLDER1:
+ case PT_VALUE:
+ case PT_IESPECIAL1:
+ case PT_IESPECIAL2:
+ /*return (LPSTR)&(pdata->u.file.szNames);*/
+ return NULL;
+
+ case PT_WORKGRP:
+ case PT_COMP:
+ case PT_NETWORK:
+ case PT_NETPROVIDER:
+ case PT_SHARE:
+ /*return (LPSTR)&(pdata->u.network.szNames);*/
+ return NULL;
+
+ case PT_VALUEW:
+ return (LPWSTR)pdata->u.file.szNames;
}
return NULL;
}
@@ -2015,30 +2017,30 @@
switch (pdata->type)
{
- case PT_GUID:
- case PT_SHELLEXT:
- case PT_YAGUID:
- return NULL;
-
- case PT_DRIVE:
- case PT_DRIVE1:
- case PT_DRIVE2:
- case PT_DRIVE3:
- return pdata->u.drive.szDriveName;
-
- case PT_FOLDER:
- case PT_FOLDER1:
- case PT_VALUE:
- case PT_IESPECIAL1:
- case PT_IESPECIAL2:
- return pdata->u.file.szNames;
-
- case PT_WORKGRP:
- case PT_COMP:
- case PT_NETWORK:
- case PT_NETPROVIDER:
- case PT_SHARE:
- return pdata->u.network.szNames;
+ case PT_GUID:
+ case PT_SHELLEXT:
+ case PT_YAGUID:
+ return NULL;
+
+ case PT_DRIVE:
+ case PT_DRIVE1:
+ case PT_DRIVE2:
+ case PT_DRIVE3:
+ return pdata->u.drive.szDriveName;
+
+ case PT_FOLDER:
+ case PT_FOLDER1:
+ case PT_VALUE:
+ case PT_IESPECIAL1:
+ case PT_IESPECIAL2:
+ return pdata->u.file.szNames;
+
+ case PT_WORKGRP:
+ case PT_COMP:
+ case PT_NETWORK:
+ case PT_NETPROVIDER:
+ case PT_SHARE:
+ return pdata->u.network.szNames;
case PT_CPLAPPLET:
return pdata->u.cpanel.szName;
@@ -2054,21 +2056,21 @@
{
/* TRACE(pidl,"(pidl%p)\n", pidl); */
- LPPIDLDATA pdata = _ILGetDataPointer(pidl);
+ LPPIDLDATA pdata =_ILGetDataPointer(pidl);
if (!pdata)
return NULL;
switch (pdata->type)
{
- case PT_FOLDER:
- case PT_VALUE:
- case PT_IESPECIAL1:
- case PT_IESPECIAL2:
- return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
-
- case PT_WORKGRP:
- return pdata->u.network.szNames + strlen (pdata->u.network.szNames) +
1;
+ case PT_FOLDER:
+ case PT_VALUE:
+ case PT_IESPECIAL1:
+ case PT_IESPECIAL2:
+ return pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1;
+
+ case PT_WORKGRP:
+ return pdata->u.network.szNames + strlen (pdata->u.network.szNames) + 1;
}
return NULL;
}
@@ -2080,7 +2082,7 @@
*/
IID* _ILGetGUIDPointer(LPCITEMIDLIST pidl)
{
- LPPIDLDATA pdata = _ILGetDataPointer(pidl);
+ LPPIDLDATA pdata =_ILGetDataPointer(pidl);
TRACE("%p\n", pidl);
@@ -2090,14 +2092,14 @@
TRACE("pdata->type 0x%04x\n", pdata->type);
switch (pdata->type)
{
- case PT_SHELLEXT:
- case PT_GUID:
- case PT_YAGUID:
- return &(pdata->u.guid.guid);
-
- default:
- TRACE("Unknown pidl type 0x%04x\n", pdata->type);
- break;
+ case PT_SHELLEXT:
+ case PT_GUID:
+ case PT_YAGUID:
+ return &(pdata->u.guid.guid);
+
+ default:
+ TRACE("Unknown pidl type 0x%04x\n", pdata->type);
+ break;
}
return NULL;
}
@@ -2117,7 +2119,7 @@
FileStructW* _ILGetFileStructW(LPCITEMIDLIST pidl) {
FileStructW *pFileStructW;
WORD cbOffset;
-
+
if (!(_ILIsValue(pidl) || _ILIsFolder(pidl)))
return NULL;
@@ -2128,11 +2130,11 @@
* style with a FileStructW member. If we switch all our shellfolder-implementations
to
* the new format, this won't be a problem. For now, we do as many sanity checks
as possible. */
if (cbOffset & 0x1 || /* FileStructW member is word aligned in the pidl */
- /* FileStructW is positioned after FileStruct */
- cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) +
sizeof(FileStruct) ||
- /* There has to be enough space at cbOffset in the pidl to hold FileStructW
and cbOffset */
- cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
- pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
+ /* FileStructW is positioned after FileStruct */
+ cbOffset < sizeof(pidl->mkid.cb) + sizeof(PIDLTYPE) + sizeof(FileStruct)
||
+ /* There has to be enough space at cbOffset in the pidl to hold FileStructW and
cbOffset */
+ cbOffset > pidl->mkid.cb - sizeof(cbOffset) - sizeof(FileStructW) ||
+ pidl->mkid.cb != cbOffset + pFileStructW->cbLen)
{
ERR("Invalid pidl format (cbOffset = %d)!\n", cbOffset);
return NULL;
@@ -2165,19 +2167,19 @@
switch (pdata->type)
{
- case PT_FOLDER:
- case PT_VALUE:
- DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime,
pFt);
- break;
- default:
- return FALSE;
+ case PT_FOLDER:
+ case PT_VALUE:
+ DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime,
pFt);
+ break;
+ default:
+ return FALSE;
}
return TRUE;
}
BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
{
- FILETIME ft, lft;
+ FILETIME ft,lft;
SYSTEMTIME time;
BOOL ret;
@@ -2186,8 +2188,8 @@
FileTimeToLocalFileTime(&ft, &lft);
FileTimeToSystemTime (&lft, &time);
- ret = GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &time, NULL, pOut,
uOutSize);
- if (ret)
+ ret = GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, pOut,
uOutSize);
+ if (ret)
{
/* Append space + time without seconds */
pOut[ret-1] = ' ';
@@ -2229,11 +2231,11 @@
switch (pdata->type)
{
- case PT_VALUE:
- dwSize = pdata->u.file.dwFileSize;
- if (pOut)
- StrFormatKBSizeA(dwSize, pOut, uOutSize);
- return dwSize;
+ case PT_VALUE:
+ dwSize = pdata->u.file.dwFileSize;
+ if (pOut)
+ StrFormatKBSizeA(dwSize, pOut, uOutSize);
+ return dwSize;
}
if (pOut)
*pOut = 0x00;
@@ -2244,9 +2246,9 @@
{
char szTemp[MAX_PATH];
const char * pPoint;
- LPCITEMIDLIST pidlTemp = pidl;
-
- TRACE("pidl=%p\n", pidl);
+ LPCITEMIDLIST pidlTemp=pidl;
+
+ TRACE("pidl=%p\n",pidl);
if (!pidl)
return FALSE;
@@ -2265,7 +2267,7 @@
pPoint++;
lstrcpynA(pOut, pPoint, uOutSize);
- TRACE("%s\n", pOut);
+ TRACE("%s\n",pOut);
return TRUE;
}
@@ -2354,15 +2356,15 @@
switch(pData->type)
{
- case PT_FOLDER:
- case PT_VALUE:
- wAttrib = pData->u.file.uFileAttribs;
- break;
+ case PT_FOLDER:
+ case PT_VALUE:
+ wAttrib = pData->u.file.uFileAttribs;
+ break;
}
if(uOutSize >= 6)
{
- i = 0;
+ i=0;
if(wAttrib & FILE_ATTRIBUTE_READONLY)
pOut[i++] = 'R';
if(wAttrib & FILE_ATTRIBUTE_HIDDEN)
@@ -2381,7 +2383,7 @@
/*************************************************************************
* ILFreeaPidl
*
- * free a aPidl struct
+ * frees an aPidl struct
*/
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl)
{
Modified: branches/shell-experiments/dll/win32/shell32/wine/pidl.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/pidl.h [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/pidl.h [iso-8859-1] Mon Nov 3
19:58:55 2014
@@ -20,10 +20,9 @@
*
* NOTES:
*
- * DO NOT use this definitions outside the shell32.dll !
- *
- * The contents of a pidl should never used from a application
- * directly.
+ * DO NOT use these definitions outside the shell32.dll!
+ *
+ * The contents of a pidl should never be used directly from an application.
*
* Undocumented:
* MS says: the abID of SHITEMID should be treated as binary data and not
@@ -48,73 +47,73 @@
* The structure of the pidl seems to be a union. The first byte of the
* PIDLDATA describes the type of pidl.
*
-* object ! first byte / ! format ! living space
-* ! size
-* ----------------------------------------------------------------
-* my computer 0x1F/20 guid (2) (usual)
-* network 0x1F guid
-* bitbucket 0x1F guid
-* drive 0x23/25 drive (usual)
-* drive 0x25/25 drive (lnk/persistent)
-* drive 0x29/25 drive
-* shell extension 0x2E guid
-* drive 0x2F drive (lnk/persistent)
-* folder/file 0x30 folder/file (1) (lnk/persistent)
-* folder 0x31 folder (usual)
-* valueA 0x32 file (ANSI file name)
-* valueW 0x34 file (Unicode file name)
-* workgroup 0x41 network (3)
-* computer 0x42 network (4)
-* net provider 0x46 network
-* whole network 0x47 network (5)
-* MSITStore 0x61 htmlhlp (7)
-* printers/ras connections 0x70 guid
-* history/favorites 0xb1 file
-* share 0xc3 network (6)
+* object ! first byte / ! format ! living space
+* ! size
+* ----------------------------------------------------------------
+* my computer 0x1F/20 guid (2) (usual)
+* network 0x1F guid
+* bitbucket 0x1F guid
+* drive 0x23/25 drive (usual)
+* drive 0x25/25 drive (lnk/persistent)
+* drive 0x29/25 drive
+* shell extension 0x2E guid
+* drive 0x2F drive (lnk/persistent)
+* folder/file 0x30 folder/file (1) (lnk/persistent)
+* folder 0x31 folder (usual)
+* valueA 0x32 file (ANSI file name)
+* valueW 0x34 file (Unicode file name)
+* workgroup 0x41 network (3)
+* computer 0x42 network (4)
+* net provider 0x46 network
+* whole network 0x47 network (5)
+* MSITStore 0x61 htmlhlp (7)
+* printers/ras connections 0x70 guid
+* history/favorites 0xb1 file
+* share 0xc3 network (6)
*
* guess: the persistent elements are non tracking
*
* (1) dummy byte is used, attributes are empty
* (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
-* (3) two strings "workgroup" "Microsoft Network"
-* (4) two strings "\\sirius" "Microsoft Network"
-* (5) one string "Entire Network"
-* (6) two strings "\\sirius\c" "Microsoft Network"
+* (3) two strings "workgroup" "Microsoft Network"
+* (4) two strings "\\sirius" "Microsoft Network"
+* (5) one string "Entire Network"
+* (6) two strings "\\sirius\c" "Microsoft Network"
* (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
-* GUID 871C5380-42A0-1069-A2EA-08002B30309D
+* GUID 871C5380-42A0-1069-A2EA-08002B30309D
*/
-#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_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_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_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_CPEXT 0x71
-#define PT_IESPECIAL2 0xb1
-#define PT_SHARE 0xc3
+#define PT_IESPECIAL2 0xb1
+#define PT_SHARE 0xc3
#include "pshpack1.h"
typedef BYTE PIDLTYPE;
typedef struct tagPIDLCPanelStruct
-{
- BYTE dummy; /*01 is 0x00 */
- DWORD iconIdx; /*02 negative icon ID */
- WORD offsDispName; /*06*/
- WORD offsComment; /*08*/
- CHAR szName[1]; /*10*/ /* terminated by 0x00, followed by display name and
comment string */
+{
+ BYTE dummy; /*01 is 0x00 */
+ DWORD iconIdx; /*02 negative icon ID */
+ WORD offsDispName; /*06*/
+ WORD offsComment; /*08*/
+ CHAR szName[1]; /*10*/ /* terminated by 0x00, followed by display name and comment
string */
} PIDLCPanelStruct;
typedef struct tagPIDLFontStruct
@@ -150,24 +149,24 @@
typedef struct tagDriveStruct
{
- CHAR szDriveName[20]; /*01*/
- WORD unknown; /*21*/
+ CHAR szDriveName[20]; /*01*/
+ WORD unknown; /*21*/
} DriveStruct;
typedef struct tagFileStruct
{
- BYTE dummy; /*01 is 0x00 for files or dirs */
- DWORD dwFileSize; /*02*/
- WORD uFileDate; /*06*/
- WORD uFileTime; /*08*/
- WORD uFileAttribs; /*10*/
- CHAR szNames[1]; /*12*/
+ BYTE dummy; /*01 is 0x00 for files or dirs */
+ DWORD dwFileSize; /*02*/
+ WORD uFileDate; /*06*/
+ WORD uFileTime; /*08*/
+ WORD uFileAttribs; /*10*/
+ CHAR szNames[1]; /*12*/
/* Here are coming two strings. The first is the long name.
The second the dos name when needed or just 0x00 */
} FileStruct;
-/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There
follows
- * a WORD member after the wszName string, which gives the offset from the beginning of
the PIDL
+/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There
follows
+ * a WORD member after the wszName string, which gives the offset from the beginning of
the PIDL
* to the FileStructW member. */
typedef struct tagFileStructW {
WORD cbLen;
@@ -186,27 +185,27 @@
} ValueWStruct;
typedef struct tagPIDLDATA
-{ PIDLTYPE type; /*00*/
- union
- {
- struct tagGUIDStruct guid;
- struct tagDriveStruct drive;
- struct tagFileStruct file;
- struct
- { WORD dummy; /*01*/
- CHAR szNames[1]; /*03*/
- } network;
- struct
- { WORD dummy; /*01*/
- DWORD dummy1; /*02*/
- CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
- } htmlhelp;
- struct tagPIDLCPanelStruct cpanel;
- struct tagValueW valueW;
+{ PIDLTYPE type; /*00*/
+ union
+ {
+ struct tagGUIDStruct guid;
+ struct tagDriveStruct drive;
+ struct tagFileStruct file;
+ struct
+ { WORD dummy; /*01*/
+ CHAR szNames[1]; /*03*/
+ } network;
+ struct
+ { WORD dummy; /*01*/
+ DWORD dummy1; /*02*/
+ CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
+ } htmlhelp;
+ struct tagPIDLCPanelStruct cpanel;
+ struct tagValueW valueW;
struct tagPIDLFontStruct cfont;
struct tagPIDLPrinterStruct cprinter;
struct tagPIDLRecycleStruct crecycle;
- } u;
+ }u;
} PIDLDATA, *LPPIDLDATA;
#include "poppack.h"