/* Create a child for the service identified by its service binding protocol GUID and get from the child the interface of the protocol identified by its GUID. */
STATIC EFI_STATUS CreateServiceChildAndOpenProtocol(IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ProtocolGuid, OUT EFI_HANDLE *ChildHandle, OUT VOID **Interface)
/* Create a child for the service identified by its service binding protocol GUID and get from the child the interface of the protocol identified by its GUID. */
STATIC EFI_STATUS CreateServiceChildAndOpenProtocol(IN EFI_HANDLE ControllerHandle, IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ProtocolGuid, OUT EFI_HANDLE *ChildHandle, OUT VOID **Interface)
{
  EFI_STATUS  Status;
  *ChildHandle = NULL;
  Status       = NetLibCreateServiceChild (
                   ControllerHandle,
                   gImageHandle,
                   ServiceBindingProtocolGuid,
                   ChildHandle
                   );
  if (!EFI_ERROR (Status)) {
    Status = gBS->OpenProtocol (
                    *ChildHandle,
                    ProtocolGuid,
                    Interface,
                    gImageHandle,
                    ControllerHandle,
                    EFI_OPEN_PROTOCOL_GET_PROTOCOL
                    );
    if (EFI_ERROR (Status)) {
      NetLibDestroyServiceChild (
        ControllerHandle,
        gImageHandle,
        ServiceBindingProtocolGuid,
        *ChildHandle
        );
      *ChildHandle = NULL;
    }
  }
  return Status;
}