/* Register callback function upon VariableLockProtocol to lock EFI_CAPSULE_LONG_MODE_BUFFER_NAME variable to avoid malicious code to update it. */
VOID EFIAPI VariableLockCapsuleLongModeBufferVariable(IN EFI_EVENT Event, IN VOID *Context)
/* Register callback function upon VariableLockProtocol to lock EFI_CAPSULE_LONG_MODE_BUFFER_NAME variable to avoid malicious code to update it. */
VOID EFIAPI VariableLockCapsuleLongModeBufferVariable(IN EFI_EVENT Event, IN VOID *Context)
{
  EFI_STATUS                    Status;
  EDKII_VARIABLE_LOCK_PROTOCOL  *VariableLock;
  Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **)&VariableLock);
  if (!EFI_ERROR (Status)) {
    Status = VariableLock->RequestToLock (VariableLock, EFI_CAPSULE_LONG_MODE_BUFFER_NAME, &gEfiCapsuleVendorGuid);
    ASSERT_EFI_ERROR (Status);
  }
}