/* Removes an event from a register protocol notify list on a protocol. */
EFI_STATUS CoreUnregisterProtocolNotifyEvent(IN EFI_EVENT Event)
/* Removes an event from a register protocol notify list on a protocol. */
EFI_STATUS CoreUnregisterProtocolNotifyEvent(IN EFI_EVENT Event)
{
  LIST_ENTRY       *Link;
  PROTOCOL_ENTRY   *ProtEntry;
  LIST_ENTRY       *NotifyLink;
  PROTOCOL_NOTIFY  *ProtNotify;
  CoreAcquireProtocolLock ();
  for ( Link =  mProtocolDatabase.ForwardLink;
        Link != &mProtocolDatabase;
        Link =  Link->ForwardLink)
  {
    ProtEntry = CR (Link, PROTOCOL_ENTRY, AllEntries, PROTOCOL_ENTRY_SIGNATURE);
    for ( NotifyLink =  ProtEntry->Notify.ForwardLink;
          NotifyLink != &ProtEntry->Notify;
          NotifyLink =  NotifyLink->ForwardLink)
    {
      ProtNotify = CR (NotifyLink, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE);
      if (ProtNotify->Event == Event) {
        RemoveEntryList (&ProtNotify->Link);
        CoreFreePool (ProtNotify);
        CoreReleaseProtocolLock ();
        return EFI_SUCCESS;
      }
    }
  }
  CoreReleaseProtocolLock ();
  return EFI_NOT_FOUND;
}