Commit 1a67b1f5 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

shell32: Fix the length calculation of the pidl in ILSaveToStream by using the…

shell32: Fix the length calculation of the pidl in ILSaveToStream by using the helper function ILGetSize.
parent 57f36261
......@@ -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)))
{
......
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