Commit 02b0be7c authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

New aPidl handling functions.

parent ec74593b
...@@ -732,7 +732,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path) ...@@ -732,7 +732,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
/************************************************************************* /*************************************************************************
* SHSimpleIDListFromPath [SHELL32.162] * SHSimpleIDListFromPath [SHELL32.162]
*/ */
LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath) LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath)
{ {
LPITEMIDLIST pidl=NULL; LPITEMIDLIST pidl=NULL;
HANDLE hFile; HANDLE hFile;
...@@ -758,7 +758,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath) ...@@ -758,7 +758,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath)
} }
return pidl; return pidl;
} }
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath) LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath)
{ {
char lpszTemp[MAX_PATH]; char lpszTemp[MAX_PATH];
TRACE("path=%s\n",debugstr_w(lpszPath)); TRACE("path=%s\n",debugstr_w(lpszPath));
...@@ -768,7 +768,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath) ...@@ -768,7 +768,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath)
return SHSimpleIDListFromPathA (lpszTemp); return SHSimpleIDListFromPathA (lpszTemp);
} }
LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPVOID lpszPath) LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath)
{ {
if ( VERSION_OsIsUnicode()) if ( VERSION_OsIsUnicode())
return SHSimpleIDListFromPathW (lpszPath); return SHSimpleIDListFromPathW (lpszPath);
...@@ -1724,3 +1724,56 @@ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) ...@@ -1724,3 +1724,56 @@ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
return wAttrib; return wAttrib;
} }
/*************************************************************************
* ILFreeaPidl
*
* free a aPidl struct
*/
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl)
{
int i;
if(apidl)
{
for(i = 0; i < cidl; i++) SHFree(apidl[i]);
SHFree(apidl);
}
}
/*************************************************************************
* ILCopyaPidl
*
* copys a aPidl struct
*/
LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl)
{
int i;
LPITEMIDLIST * apidldest = (LPITEMIDLIST*)SHAlloc(cidl * sizeof(LPITEMIDLIST));
if(!apidlsrc) return NULL;
for(i = 0; i < cidl; i++)
apidldest[i] = ILClone(apidlsrc[i]);
return apidldest;
}
/*************************************************************************
* _ILCopyCidaToaPidl
*
* creates aPidl from CIDA
*/
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPCIDA cida)
{
int i;
LPITEMIDLIST * dst = (LPITEMIDLIST*)SHAlloc(cida->cidl * sizeof(LPITEMIDLIST));
if(!dst) return NULL;
if (pidl)
*pidl = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[0]]));
for(i = 0; i < cida->cidl; i++)
dst[i] = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[i + 1]]));
return dst;
}
...@@ -168,4 +168,11 @@ REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl); ...@@ -168,4 +168,11 @@ REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl);
void pdump (LPCITEMIDLIST pidl); void pdump (LPCITEMIDLIST pidl);
BOOL pcheck (LPCITEMIDLIST pidl); BOOL pcheck (LPCITEMIDLIST pidl);
/*
* aPidl helper
*/
void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl);
LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl);
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPCIDA cida);
#endif #endif
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