Home | Info | Community | Development | myReactOS | Contact Us
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; }