/* Preprocess dependency expression and update DriverEntry to reflect the state of Before and After dependencies. If DriverEntry->Before or DriverEntry->After is set it will never be cleared. */
EFI_STATUS SmmPreProcessDepex(IN EFI_SMM_DRIVER_ENTRY *DriverEntry)
/* Preprocess dependency expression and update DriverEntry to reflect the state of Before and After dependencies. If DriverEntry->Before or DriverEntry->After is set it will never be cleared. */
EFI_STATUS SmmPreProcessDepex(IN EFI_SMM_DRIVER_ENTRY *DriverEntry)
{
  UINT8  *Iterator;
  Iterator               = DriverEntry->Depex;
  DriverEntry->Dependent = TRUE;
  if (*Iterator == EFI_DEP_BEFORE) {
    DriverEntry->Before = TRUE;
  } else if (*Iterator == EFI_DEP_AFTER) {
    DriverEntry->After = TRUE;
  }
  if (DriverEntry->Before || DriverEntry->After) {
    CopyMem (&DriverEntry->BeforeAfterGuid, Iterator + 1, sizeof (EFI_GUID));
  }
  return EFI_SUCCESS;
}