/* Remove a net buffer from the head in the specific queue and return it. */
NET_BUF* EFIAPI NetbufQueRemove(IN OUT NET_BUF_QUEUE *NbufQue)
/* Remove a net buffer from the head in the specific queue and return it. */
NET_BUF* EFIAPI NetbufQueRemove(IN OUT NET_BUF_QUEUE *NbufQue)
{
  NET_BUF  *First;
  NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE);
  if (NbufQue->BufNum == 0) {
    return NULL;
  }
  First = NET_LIST_USER_STRUCT (NbufQue->BufList.ForwardLink, NET_BUF, List);
  NetListRemoveHead (&NbufQue->BufList);
  NbufQue->BufSize -= First->TotalSize;
  NbufQue->BufNum--;
  return First;
}