2005-07-31 12:11:56 +00:00
|
|
|
/*
|
|
|
|
* SHLWAPI DataBlock List functions
|
|
|
|
*
|
|
|
|
* Copyright 2002 Jon Griffiths
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2007-08-07 07:27:43 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-07-31 12:11:56 +00:00
|
|
|
*/
|
2018-03-04 12:17:11 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
2013-01-24 23:00:42 +00:00
|
|
|
|
2018-03-04 12:17:11 +00:00
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "objbase.h"
|
|
|
|
#include "shlobj.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
/* dwSignature for contained DATABLOCK_HEADER items */
|
2005-10-08 19:30:16 +00:00
|
|
|
#define CLIST_ID_CONTAINER (~0U)
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* NextItem
|
|
|
|
*
|
|
|
|
* Internal helper: move a DataBlock pointer to the next item.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
static inline LPDATABLOCK_HEADER NextItem(LPDBLIST lpList)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
char* address = (char*)lpList;
|
|
|
|
address += lpList->cbSize;
|
|
|
|
return (LPDATABLOCK_HEADER)address;
|
2005-07-31 12:11:56 +00:00
|
|
|
}
|
|
|
|
|
2007-11-29 11:15:59 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.20]
|
|
|
|
*
|
|
|
|
* Insert a new item into a DataBlock list.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lppList [0] Pointer to the List
|
|
|
|
* lpNewItem [I] The new item to add to the list
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK. The item is added to the list.
|
|
|
|
* Failure: An HRESULT error code.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* If the size of the element to be inserted is less than the size of a
|
|
|
|
* DATABLOCK_HEADER node, or the Id for the item is CLIST_ID_CONTAINER,
|
|
|
|
* the call returns S_OK but does not actually add the element.
|
|
|
|
* See SHWriteDataBlockList.
|
|
|
|
*/
|
2018-03-04 12:17:11 +00:00
|
|
|
BOOL WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
|
2007-11-29 11:15:59 +00:00
|
|
|
{
|
|
|
|
LPDATABLOCK_HEADER lpInsertAt = NULL;
|
|
|
|
ULONG ulSize;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", lppList, lpNewItem);
|
|
|
|
|
2018-03-04 12:17:11 +00:00
|
|
|
if(!lppList || !lpNewItem)
|
2018-01-22 19:54:31 +00:00
|
|
|
return FALSE;
|
2007-11-29 11:15:59 +00:00
|
|
|
|
|
|
|
if (lpNewItem->cbSize < sizeof(DATABLOCK_HEADER) ||
|
|
|
|
lpNewItem->dwSignature == CLIST_ID_CONTAINER)
|
2018-01-22 19:54:31 +00:00
|
|
|
return FALSE;
|
2007-11-29 11:15:59 +00:00
|
|
|
|
|
|
|
ulSize = lpNewItem->cbSize;
|
|
|
|
|
|
|
|
if(ulSize & 0x3)
|
|
|
|
{
|
|
|
|
/* Tune size to a ULONG boundary, add space for container element */
|
|
|
|
ulSize = ((ulSize + 0x3) & 0xFFFFFFFC) + sizeof(DATABLOCK_HEADER);
|
|
|
|
TRACE("Creating container item, new size = %d\n", ulSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!*lppList)
|
|
|
|
{
|
|
|
|
/* An empty list. Allocate space for terminal ulSize also */
|
2009-01-21 15:57:21 +00:00
|
|
|
*lppList = LocalAlloc(LMEM_ZEROINIT, ulSize + sizeof(ULONG));
|
2007-11-29 11:15:59 +00:00
|
|
|
lpInsertAt = *lppList;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Append to the end of the list */
|
|
|
|
ULONG ulTotalSize = 0;
|
|
|
|
LPDATABLOCK_HEADER lpIter = *lppList;
|
|
|
|
|
|
|
|
/* Iterate to the end of the list, calculating the total size */
|
|
|
|
while (lpIter->cbSize)
|
|
|
|
{
|
|
|
|
ulTotalSize += lpIter->cbSize;
|
|
|
|
lpIter = NextItem(lpIter);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Increase the size of the list */
|
2009-01-21 15:57:21 +00:00
|
|
|
lpIter = LocalReAlloc(*lppList, ulTotalSize + ulSize+sizeof(ULONG),
|
2007-11-29 11:15:59 +00:00
|
|
|
LMEM_ZEROINIT | LMEM_MOVEABLE);
|
|
|
|
if(lpIter)
|
|
|
|
{
|
|
|
|
*lppList = lpIter;
|
|
|
|
lpInsertAt = (LPDATABLOCK_HEADER)((char*)lpIter + ulTotalSize); /* At end */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(lpInsertAt)
|
|
|
|
{
|
|
|
|
/* Copy in the new item */
|
|
|
|
LPDATABLOCK_HEADER lpDest = lpInsertAt;
|
|
|
|
|
|
|
|
if(ulSize != lpNewItem->cbSize)
|
|
|
|
{
|
|
|
|
lpInsertAt->cbSize = ulSize;
|
|
|
|
lpInsertAt->dwSignature = CLIST_ID_CONTAINER;
|
|
|
|
lpDest++;
|
|
|
|
}
|
|
|
|
memcpy(lpDest, lpNewItem, lpNewItem->cbSize);
|
|
|
|
|
|
|
|
/* Terminate the list */
|
|
|
|
lpInsertAt = NextItem(lpInsertAt);
|
|
|
|
lpInsertAt->cbSize = 0;
|
|
|
|
|
2018-01-22 19:54:31 +00:00
|
|
|
return TRUE;
|
2007-11-29 11:15:59 +00:00
|
|
|
}
|
2018-01-22 19:54:31 +00:00
|
|
|
return FALSE;
|
2007-11-29 11:15:59 +00:00
|
|
|
}
|
|
|
|
|
2005-07-31 12:11:56 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.17]
|
|
|
|
*
|
|
|
|
* Write a DataBlock list to an IStream object.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpStream [I] IStream object to write the list to
|
|
|
|
* lpList [I] List of items to write
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK. The object is written to the stream.
|
|
|
|
* Failure: An HRESULT error code
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Ordinals 17,18,19,20,21 and 22 are related and together provide a compact
|
|
|
|
* list structure (a "DataBlock List"), which may be stored and retrieved from
|
|
|
|
* an IStream object.
|
|
|
|
*
|
|
|
|
* The exposed API consists of:
|
|
|
|
*
|
|
|
|
* - SHWriteDataBlockList() - Write a DataBlock list to a stream,
|
|
|
|
* - SHReadDataBlockList() - Read and create a list from a stream,
|
|
|
|
* - SHFreeDataBlockList() - Free a list,
|
|
|
|
* - SHAddDataBlock() - Insert a new item into a list,
|
|
|
|
* - SHRemoveDataBlock() - Remove an item from a list,
|
|
|
|
* - SHFindDataBlock() - Find an item in a list.
|
|
|
|
*
|
|
|
|
* The DataBlock list is stored packed into a memory array. Each element has a
|
|
|
|
* size and an associated ID. Elements must be less than 64k if the list is
|
|
|
|
* to be subsequently read from a stream.
|
|
|
|
*
|
|
|
|
* Elements are aligned on DWORD boundaries. If an elements data size is not
|
|
|
|
* a DWORD size multiple, the element is wrapped by inserting a surrounding
|
|
|
|
* element with an Id of 0xFFFFFFFF, and size sufficient to pad to a DWORD boundary.
|
|
|
|
*
|
|
|
|
* These functions are slow for large objects and long lists.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
HRESULT WINAPI SHWriteDataBlockList(IStream* lpStream, LPDBLIST lpList)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
ULONG ulSize;
|
2007-08-07 07:27:43 +00:00
|
|
|
HRESULT hRet = S_OK;
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", lpStream, lpList);
|
|
|
|
|
|
|
|
if(lpList)
|
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
while (lpList->cbSize)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
LPDATABLOCK_HEADER lpItem = lpList;
|
2005-07-31 12:11:56 +00:00
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
if(lpList->dwSignature == CLIST_ID_CONTAINER)
|
2005-07-31 12:11:56 +00:00
|
|
|
lpItem++;
|
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
hRet = IStream_Write(lpStream,lpItem,lpItem->cbSize,&ulSize);
|
2005-07-31 12:11:56 +00:00
|
|
|
if (FAILED(hRet))
|
|
|
|
return hRet;
|
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
if(lpItem->cbSize != ulSize)
|
2005-07-31 12:11:56 +00:00
|
|
|
return STG_E_MEDIUMFULL;
|
|
|
|
|
|
|
|
lpList = NextItem(lpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(SUCCEEDED(hRet))
|
|
|
|
{
|
|
|
|
ULONG ulDummy;
|
|
|
|
ulSize = 0;
|
|
|
|
|
|
|
|
/* Write a terminating list entry with zero size */
|
|
|
|
hRet = IStream_Write(lpStream, &ulSize,sizeof(ulSize),&ulDummy);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.18]
|
|
|
|
*
|
|
|
|
* Read and create a DataBlock list from an IStream object.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpStream [I] Stream to read the list from
|
|
|
|
* lppList [0] Pointer to receive the new List
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: S_OK
|
|
|
|
* Failure: An HRESULT error code
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* When read from a file, list objects are limited in size to 64k.
|
|
|
|
* See SHWriteDataBlockList.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPDBLIST* lppList)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
DATABLOCK_HEADER bBuff[128]; /* Temporary storage for new list item */
|
2005-07-31 12:11:56 +00:00
|
|
|
ULONG ulBuffSize = sizeof(bBuff);
|
2007-08-07 07:27:43 +00:00
|
|
|
LPDATABLOCK_HEADER pItem = bBuff;
|
2005-07-31 12:11:56 +00:00
|
|
|
ULONG ulRead, ulSize;
|
|
|
|
HRESULT hRet = S_OK;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", lpStream, lppList);
|
|
|
|
|
|
|
|
if(*lppList)
|
|
|
|
{
|
|
|
|
/* Free any existing list */
|
2009-01-21 15:57:21 +00:00
|
|
|
LocalFree(*lppList);
|
2005-07-31 12:11:56 +00:00
|
|
|
*lppList = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
/* Read the size of the next item */
|
|
|
|
hRet = IStream_Read(lpStream, &ulSize,sizeof(ulSize),&ulRead);
|
|
|
|
|
|
|
|
if(FAILED(hRet) || ulRead != sizeof(ulSize) || !ulSize)
|
|
|
|
break; /* Read failed or read zero size (the end of the list) */
|
|
|
|
|
|
|
|
if(ulSize > 0xFFFF)
|
|
|
|
{
|
|
|
|
LARGE_INTEGER liZero;
|
|
|
|
ULARGE_INTEGER ulPos;
|
|
|
|
|
|
|
|
liZero.QuadPart = 0;
|
|
|
|
|
|
|
|
/* Back the stream up; this object is too big for the list */
|
|
|
|
if(SUCCEEDED(IStream_Seek(lpStream, liZero, STREAM_SEEK_CUR, &ulPos)))
|
|
|
|
{
|
|
|
|
liZero.QuadPart = ulPos.QuadPart - sizeof(ULONG);
|
|
|
|
IStream_Seek(lpStream, liZero, STREAM_SEEK_SET, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2007-08-07 07:27:43 +00:00
|
|
|
else if (ulSize >= sizeof(DATABLOCK_HEADER))
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
/* Add this new item to the list */
|
|
|
|
if(ulSize > ulBuffSize)
|
|
|
|
{
|
|
|
|
/* We need more buffer space, allocate it */
|
2007-08-07 07:27:43 +00:00
|
|
|
LPDATABLOCK_HEADER lpTemp;
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
if (pItem == bBuff)
|
2009-01-21 15:57:21 +00:00
|
|
|
lpTemp = LocalAlloc(LMEM_ZEROINIT, ulSize);
|
2005-07-31 12:11:56 +00:00
|
|
|
else
|
2009-01-21 15:57:21 +00:00
|
|
|
lpTemp = LocalReAlloc(pItem, ulSize, LMEM_ZEROINIT|LMEM_MOVEABLE);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
if(!lpTemp)
|
|
|
|
{
|
|
|
|
hRet = E_OUTOFMEMORY;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ulBuffSize = ulSize;
|
|
|
|
pItem = lpTemp;
|
|
|
|
}
|
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
pItem->cbSize = ulSize;
|
|
|
|
ulSize -= sizeof(pItem->cbSize); /* already read this member */
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
/* Read the item Id and data */
|
2007-08-07 07:27:43 +00:00
|
|
|
hRet = IStream_Read(lpStream, &pItem->dwSignature, ulSize, &ulRead);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
if(FAILED(hRet) || ulRead != ulSize)
|
|
|
|
break;
|
|
|
|
|
|
|
|
SHAddDataBlock(lppList, pItem); /* Insert Item */
|
|
|
|
}
|
|
|
|
} while(1);
|
|
|
|
|
|
|
|
/* If we allocated space, free it */
|
|
|
|
if(pItem != bBuff)
|
2009-01-21 15:57:21 +00:00
|
|
|
LocalFree(pItem);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
return hRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.19]
|
|
|
|
*
|
|
|
|
* Free a DataBlock list.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* lpList [I] List to free
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Nothing.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* See SHWriteDataBlockList.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
VOID WINAPI SHFreeDataBlockList(LPDBLIST lpList)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
TRACE("(%p)\n", lpList);
|
|
|
|
|
|
|
|
if (lpList)
|
2009-01-21 15:57:21 +00:00
|
|
|
LocalFree(lpList);
|
2005-07-31 12:11:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.21]
|
|
|
|
*
|
|
|
|
* Remove an item from a DataBlock list.
|
|
|
|
*
|
|
|
|
* PARAMS
|
2007-08-07 07:27:43 +00:00
|
|
|
* lppList [O] List to remove the item from
|
|
|
|
* dwSignature [I] Id of item to remove
|
2005-07-31 12:11:56 +00:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE.
|
|
|
|
* Failure: FALSE, If any parameters are invalid, or the item was not found.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* See SHWriteDataBlockList.
|
|
|
|
*/
|
2007-08-07 07:27:43 +00:00
|
|
|
BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2018-01-22 19:54:31 +00:00
|
|
|
LPDATABLOCK_HEADER lpList = NULL;
|
2007-08-07 07:27:43 +00:00
|
|
|
LPDATABLOCK_HEADER lpItem = NULL;
|
|
|
|
LPDATABLOCK_HEADER lpNext;
|
2005-07-31 12:11:56 +00:00
|
|
|
ULONG ulNewSize;
|
|
|
|
|
2007-08-07 07:27:43 +00:00
|
|
|
TRACE("(%p,%d)\n", lppList, dwSignature);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
if(lppList && (lpList = *lppList))
|
|
|
|
{
|
|
|
|
/* Search for item in list */
|
2007-08-07 07:27:43 +00:00
|
|
|
while (lpList->cbSize)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
if(lpList->dwSignature == dwSignature ||
|
|
|
|
(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature))
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
|
|
|
lpItem = lpList; /* Found */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
lpList = NextItem(lpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!lpItem)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
lpList = lpNext = NextItem(lpItem);
|
|
|
|
|
|
|
|
/* Locate the end of the list */
|
2007-08-07 07:27:43 +00:00
|
|
|
while (lpList->cbSize)
|
2005-07-31 12:11:56 +00:00
|
|
|
lpList = NextItem(lpList);
|
|
|
|
|
|
|
|
/* Resize the list */
|
2009-01-21 15:57:21 +00:00
|
|
|
ulNewSize = LocalSize(*lppList) - lpItem->cbSize;
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
/* Copy following elements over lpItem */
|
|
|
|
memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));
|
|
|
|
|
|
|
|
if(ulNewSize <= sizeof(ULONG))
|
|
|
|
{
|
2009-01-21 15:57:21 +00:00
|
|
|
LocalFree(*lppList);
|
2005-07-31 12:11:56 +00:00
|
|
|
*lppList = NULL; /* Removed the last element */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-01-21 15:57:21 +00:00
|
|
|
lpList = LocalReAlloc(*lppList, ulNewSize, LMEM_ZEROINIT|LMEM_MOVEABLE);
|
2005-07-31 12:11:56 +00:00
|
|
|
if(lpList)
|
|
|
|
*lppList = lpList;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* @ [SHLWAPI.22]
|
|
|
|
*
|
|
|
|
* Find an item in a DataBlock list.
|
|
|
|
*
|
|
|
|
* PARAMS
|
2007-08-07 07:27:43 +00:00
|
|
|
* lpList [I] List to search
|
|
|
|
* dwSignature [I] Id of item to find
|
2005-07-31 12:11:56 +00:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: A pointer to the list item found
|
|
|
|
* Failure: NULL
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* See SHWriteDataBlockList.
|
|
|
|
*/
|
2007-11-29 11:15:59 +00:00
|
|
|
DATABLOCK_HEADER* WINAPI SHFindDataBlock(LPDBLIST lpList, DWORD dwSignature)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
TRACE("(%p,%d)\n", lpList, dwSignature);
|
2005-07-31 12:11:56 +00:00
|
|
|
|
|
|
|
if(lpList)
|
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
while(lpList->cbSize)
|
2005-07-31 12:11:56 +00:00
|
|
|
{
|
2007-08-07 07:27:43 +00:00
|
|
|
if(lpList->dwSignature == dwSignature)
|
2005-07-31 12:11:56 +00:00
|
|
|
return lpList; /* Matched */
|
2007-08-07 07:27:43 +00:00
|
|
|
else if(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature)
|
2005-07-31 12:11:56 +00:00
|
|
|
return lpList + 1; /* Contained item matches */
|
|
|
|
|
|
|
|
lpList = NextItem(lpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|