/* This is the Event call back function is triggered in SMM to notify the Library the system is entering SmmLocked phase and set InSmm flag. */
EFI_STATUS EFIAPI S3BootScriptSmmEventCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
/* This is the Event call back function is triggered in SMM to notify the Library the system is entering SmmLocked phase and set InSmm flag. */
EFI_STATUS EFIAPI S3BootScriptSmmEventCallBack(IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle)
{
  if (mS3BootScriptTablePtr == mS3BootScriptTableSmmPtr) {
    return EFI_SUCCESS;
  }
  S3BootScriptEventCallBack (NULL, NULL);
  if (mS3BootScriptTableSmmPtr->TableBase == NULL) {
    CopyMem (mS3BootScriptTableSmmPtr, mS3BootScriptTablePtr, sizeof (*mS3BootScriptTablePtr));
    mS3BootScriptTableSmmPtr->InSmm = TRUE;
  }
  mS3BootScriptTablePtr = mS3BootScriptTableSmmPtr;
  return EFI_SUCCESS;
}