/* Callback function which provided by user to remove one node in NetDestroyLinkList process. */
EFI_STATUS EFIAPI RestExDestroyChildEntryInHandleBuffer(IN LIST_ENTRY *Entry, IN VOID *Context)
/* Callback function which provided by user to remove one node in NetDestroyLinkList process. */
EFI_STATUS EFIAPI RestExDestroyChildEntryInHandleBuffer(IN LIST_ENTRY *Entry, IN VOID *Context)
{
  RESTEX_INSTANCE               *Instance;
  EFI_SERVICE_BINDING_PROTOCOL  *ServiceBinding;
  UINTN                         NumberOfChildren;
  EFI_HANDLE                    *ChildHandleBuffer;
  if ((Entry == NULL) || (Context == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  Instance          = NET_LIST_USER_STRUCT_S (Entry, RESTEX_INSTANCE, Link, RESTEX_INSTANCE_SIGNATURE);
  ServiceBinding    = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->ServiceBinding;
  NumberOfChildren  = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->NumberOfChildren;
  ChildHandleBuffer = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->ChildHandleBuffer;
  if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren, ChildHandleBuffer)) {
    RemoveEntryList (&Instance->Link);
    return EFI_SUCCESS;
  }
  return ServiceBinding->DestroyChild (ServiceBinding, Instance->ChildHandle);
}