/* Decrease the reference count of the net vector by one. The real resource free operation isn't performed until the reference count of the net vector is decreased to 0. */
VOID NetbufFreeVector(IN NET_VECTOR *Vector)
/* Decrease the reference count of the net vector by one. The real resource free operation isn't performed until the reference count of the net vector is decreased to 0. */
VOID NetbufFreeVector(IN NET_VECTOR *Vector)
{
  UINT32  Index;
  ASSERT (Vector != NULL);
  NET_CHECK_SIGNATURE (Vector, NET_VECTOR_SIGNATURE);
  ASSERT (Vector->RefCnt > 0);
  Vector->RefCnt--;
  if (Vector->RefCnt > 0) {
    return;
  }
  if (Vector->Free != NULL) {
    if ((Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) {
      gBS->FreePool (Vector->Block[0].Bulk);
    }
    Vector->Free (Vector->Arg);
  } else {
    for (Index = 0; Index < Vector->BlockNum; Index++) {
      gBS->FreePool (Vector->Block[Index].Bulk);
    }
  }
  FreePool (Vector);
}