From c835579240d96eb12e114592d8e945504df498a4 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Sat, 10 Apr 1999 16:41:15 +0000 Subject: [PATCH] ILLoadFromString implemented. --- dlls/shell32/pidl.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 99710ad00af..919b7b0a2ad 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -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] *