/** Get section entry GUID value. @param[in] Context INI Config file context. @param[in] SectionName Section name. @param[in] EntryName Section entry name. @param[out] Guid Point to the got GUID value. @retval EFI_SUCCESS Section entry GUID value is got. @retval EFI_NOT_FOUND Section is not found. **/ EFI_STATUS EFIAPI GetGuidFromDataFile ( IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT EFI_GUID *Guid ) { CHAR8 *Value; EFI_STATUS Status; if (Context == NULL || SectionName == NULL || EntryName == NULL || Guid == NULL) { return EFI_INVALID_PARAMETER; } Status = GetStringFromDataFile( Context, SectionName, EntryName, &Value ); if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } ASSERT (Value != NULL); if (!IsValidGuid(Value, AsciiStrLen(Value))) { return EFI_NOT_FOUND; } Status = AsciiStrToGuid(Value, Guid); if (EFI_ERROR (Status)) { return EFI_NOT_FOUND; } return EFI_SUCCESS; }
/** Get section entry GUID value. @param[in] Context INI Config file context. @param[in] SectionName Section name. @param[in] EntryName Section entry name. @param[out] Guid Point to the got GUID value. @retval EFI_SUCCESS Section entry GUID value is got. @retval EFI_NOT_FOUND Section is not found. **/ EFI_STATUS EFIAPI GetGuidFromDataFile ( IN VOID *Context, IN CHAR8 *SectionName, IN CHAR8 *EntryName, OUT EFI_GUID *Guid ) { CHAR8 *Value; EFI_STATUS Status; RETURN_STATUS RStatus; if (Context == NULL || SectionName == NULL || EntryName == NULL || Guid == NULL) { return EFI_INVALID_PARAMETER; } Status = GetStringFromDataFile( Context, SectionName, EntryName, &Value ); if (EFI_ERROR(Status)) { return EFI_NOT_FOUND; } ASSERT (Value != NULL); RStatus = AsciiStrToGuid (Value, Guid); if (RETURN_ERROR (RStatus) || (Value[GUID_STRING_LENGTH] != '\0')) { return EFI_NOT_FOUND; } return EFI_SUCCESS; }