ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

BOOL WINAPI SHRemoveDataBlock ( LPDBLIST *  lppList,
DWORD  dwSignature 
)

Definition at line 355 of file clist.c.

{
  LPDATABLOCK_HEADER lpList = 0;
  LPDATABLOCK_HEADER lpItem = NULL;
  LPDATABLOCK_HEADER lpNext;
  ULONG ulNewSize;

  TRACE("(%p,%d)\n", lppList, dwSignature);

  if(lppList && (lpList = *lppList))
  {
    /* Search for item in list */
    while (lpList->cbSize)
    {
      if(lpList->dwSignature == dwSignature ||
        (lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature))
      {
        lpItem = lpList; /* Found */
        break;
      }
      lpList = NextItem(lpList);
    }
  }

  if(!lpItem)
    return FALSE;

  lpList = lpNext = NextItem(lpItem);

  /* Locate the end of the list */
  while (lpList->cbSize)
    lpList = NextItem(lpList);

  /* Resize the list */
  ulNewSize = LocalSize(*lppList) - lpItem->cbSize;

  /* Copy following elements over lpItem */
  memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));

  if(ulNewSize <= sizeof(ULONG))
  {
    LocalFree(*lppList);
    *lppList = NULL; /* Removed the last element */
  }
  else
  {
    lpList = LocalReAlloc(*lppList, ulNewSize, LMEM_ZEROINIT|LMEM_MOVEABLE);
    if(lpList)
      *lppList = lpList;
  }
  return TRUE;
}

Generated on Sat May 26 2012 05:17:39 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.