/* Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources. */
EFI_STATUS Ip4Config2DestroyDhcp4(IN OUT IP4_CONFIG2_INSTANCE *Instance)
/* Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources. */
EFI_STATUS Ip4Config2DestroyDhcp4(IN OUT IP4_CONFIG2_INSTANCE *Instance)
{
  IP4_SERVICE         *IpSb;
  EFI_STATUS          Status;
  EFI_DHCP4_PROTOCOL  *Dhcp4;
  Dhcp4 = Instance->Dhcp4;
  ASSERT (Dhcp4 != NULL);
  Dhcp4->Stop (Dhcp4);
  Dhcp4->Configure (Dhcp4, NULL);
  Instance->Dhcp4 = NULL;
  IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
  Status = gBS->CloseProtocol (
                  Instance->Dhcp4Handle,
                  &gEfiDhcp4ProtocolGuid,
                  IpSb->Image,
                  IpSb->Controller
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = NetLibDestroyServiceChild (
             IpSb->Controller,
             IpSb->Image,
             &gEfiDhcp4ServiceBindingProtocolGuid,
             Instance->Dhcp4Handle
             );
  Instance->Dhcp4Handle = NULL;
  return Status;
}