/* If Map is NULL, then ASSERT(). If Item is NULL, then ASSERT(). if item in not in the netmap, then ASSERT(). */
VOID* EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
/* If Map is NULL, then ASSERT(). If Item is NULL, then ASSERT(). if item in not in the netmap, then ASSERT(). */
VOID* EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
{
  ASSERT ((Map != NULL) && (Item != NULL));
  ASSERT (NetItemInMap (Map, Item));
  RemoveEntryList (&Item->Link);
  Map->Count--;
  InsertHeadList (&Map->Recycled, &Item->Link);
  if (Value != NULL) {
    *Value = Item->Value;
  }
  return Item->Key;
}