/* Queries a handle to determine if it supports a specified protocol. */
EFI_STATUS EFIAPI SmmHandleProtocol(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
/* Queries a handle to determine if it supports a specified protocol. */
EFI_STATUS EFIAPI SmmHandleProtocol(IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
{
  EFI_STATUS          Status;
  PROTOCOL_INTERFACE  *Prot;
  if (Protocol == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (Interface == NULL) {
    return EFI_INVALID_PARAMETER;
  } else {
    *Interface = NULL;
  }
  Status = SmmValidateHandle (UserHandle);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Prot = SmmGetProtocolInterface (UserHandle, Protocol);
  if (Prot == NULL) {
    return EFI_UNSUPPORTED;
  }
  *Interface = Prot->Interface;
  return EFI_SUCCESS;
}