/* Read Depex and pre-process the Depex for Before and After. If Section Extraction protocol returns an error via ReadSection defer the reading of the Depex. */
EFI_STATUS MmGetDepexSectionAndPreProccess(IN EFI_MM_DRIVER_ENTRY *DriverEntry)
/* Read Depex and pre-process the Depex for Before and After. If Section Extraction protocol returns an error via ReadSection defer the reading of the Depex. */
EFI_STATUS MmGetDepexSectionAndPreProccess(IN EFI_MM_DRIVER_ENTRY *DriverEntry)
{
  EFI_STATUS  Status;
  if (DriverEntry->Depex == NULL) {
    Status = EFI_NOT_FOUND;
  } else {
    Status = EFI_SUCCESS;
  }
  if (EFI_ERROR (Status)) {
    if (Status == EFI_PROTOCOL_ERROR) {
      DriverEntry->DepexProtocolError = TRUE;
    } else {
      DriverEntry->Depex              = NULL;
      DriverEntry->Dependent          = TRUE;
      DriverEntry->DepexProtocolError = FALSE;
    }
  } else {
    MmPreProcessDepex (DriverEntry);
    DriverEntry->DepexProtocolError = FALSE;
  }
  return Status;
}