/* The constructor function caches the pointer of SMM Services Table. */
EFI_STATUS EFIAPI SmmServicesTableLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
/* The constructor function caches the pointer of SMM Services Table. */
EFI_STATUS EFIAPI SmmServicesTableLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
  EFI_STATUS              Status;
  EFI_SMM_BASE2_PROTOCOL  *InternalSmmBase2;
  InternalSmmBase2 = NULL;
  Status = SystemTable->BootServices->LocateProtocol (
                                        &gEfiSmmBase2ProtocolGuid,
                                        NULL,
                                        (VOID **)&InternalSmmBase2
                                        );
  ASSERT_EFI_ERROR (Status);
  ASSERT (InternalSmmBase2 != NULL);
  InternalSmmBase2->GetSmstLocation (InternalSmmBase2, &gSmst);
  ASSERT (gSmst != NULL);
  return EFI_SUCCESS;
}