shell32: Fix the length calculation of the pidl in ILSaveToStream by using the helper function ILGetSize.

This commit is contained in:
Rob Shearman 2007-11-11 12:28:26 +00:00 committed by Alexandre Julliard
parent 57f36261fa
commit 1a67b1f53e
1 changed files with 1 additions and 7 deletions

View File

@ -341,7 +341,6 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
*/
HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl)
{
LPCITEMIDLIST pidl;
WORD wLen = 0;
HRESULT ret = E_FAIL;
@ -349,12 +348,7 @@ HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl)
IStream_AddRef (pStream);
pidl = pPidl;
while (pidl->mkid.cb)
{
wLen += sizeof(WORD) + pidl->mkid.cb;
pidl = ILGetNext(pidl);
}
wLen = ILGetSize(pPidl);
if (SUCCEEDED(IStream_Write(pStream, (LPVOID)&wLen, 2, NULL)))
{