ILLoadFromString implemented.

This commit is contained in:
Juergen Schmied 1999-04-10 16:41:15 +00:00 committed by Alexandre Julliard
parent bce5f88f3d
commit c835579240
1 changed files with 36 additions and 0 deletions

View File

@ -135,6 +135,42 @@ LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
return newpidl;
}
/*************************************************************************
* ILLoadFromStream
*
* NOTES
* the first two bytes are the len, the pidl is following then
*/
HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
{ WORD wLen = 0;
DWORD dwBytesRead;
HRESULT ret = E_FAIL;
TRACE(shell,"%p %p\n", pStream , ppPidl);
if (*ppPidl)
{ SHFree(*ppPidl);
*ppPidl = NULL;
}
IStream_AddRef (pStream);
if (SUCCEEDED(IStream_Read(pStream, (LPVOID)&wLen, 2, &dwBytesRead)))
{ *ppPidl = SHAlloc (wLen);
if (SUCCEEDED(IStream_Read(pStream, *ppPidl , wLen, &dwBytesRead)))
{ ret = S_OK;
}
else
{ SHFree(*ppPidl);
*ppPidl = NULL;
}
}
IStream_Release (pStream);
return ret;
}
/*************************************************************************
* SHILCreateFromPath [SHELL32.28]
*