/* Delete a group control block from the instance. If the controlled group address's reference count reaches zero, the group address is removed too. */
BOOLEAN MnpGroupOpDelCtrlBlk(IN MNP_INSTANCE_DATA *Instance, IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk)
/* Delete a group control block from the instance. If the controlled group address's reference count reaches zero, the group address is removed too. */
BOOLEAN MnpGroupOpDelCtrlBlk(IN MNP_INSTANCE_DATA *Instance, IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk)
{
  MNP_DEVICE_DATA    *MnpDeviceData;
  MNP_GROUP_ADDRESS  *GroupAddress;
  NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
  MnpDeviceData = Instance->MnpServiceData->MnpDeviceData;
  NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
  GroupAddress = CtrlBlk->GroupAddress;
  RemoveEntryList (&CtrlBlk->CtrlBlkEntry);
  FreePool (CtrlBlk);
  ASSERT (GroupAddress->RefCnt > 0);
  GroupAddress->RefCnt--;
  if (GroupAddress->RefCnt == 0) {
    MnpDeviceData->GroupAddressCount--;
    RemoveEntryList (&GroupAddress->AddrEntry);
    FreePool (GroupAddress);
    return TRUE;
  }
  return FALSE;
}