/* This is the Event call back function to notify the Library the system is entering SmmLocked phase. */
VOID EFIAPI S3BootScriptEventCallBack(IN EFI_EVENT Event, IN VOID *Context)
/* This is the Event call back function to notify the Library the system is entering SmmLocked phase. */
VOID EFIAPI S3BootScriptEventCallBack(IN EFI_EVENT Event, IN VOID *Context)
{
  EFI_STATUS  Status;
  VOID        *Interface;
  Status = gBS->LocateProtocol (
                  &gEfiDxeSmmReadyToLockProtocolGuid,
                  NULL,
                  &Interface
                  );
  if (EFI_ERROR (Status)) {
    return;
  }
  if (!mS3BootScriptTablePtr->SmmLocked) {
    S3BootScriptInternalCloseTable ();
    mS3BootScriptTablePtr->SmmLocked = TRUE;
    SaveBootScriptDataToLockBox ();
  }
}