Skip to content

Commit

Permalink
Display the Type 1 serial number instead of the Type 3 serial number (#…
Browse files Browse the repository at this point in the history
…104)

## Description

The sample Front Page is displaying the Type 3 serial number and should
display the Type 1 serial number.

This one fixes #102 

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Tested in QemuQ35Pkg

## Integration Instructions

N/A
  • Loading branch information
mikeytdisco authored Jun 23, 2023
1 parent e916e31 commit 1ddac51
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions OemPkg/FrontPage/FrontPage.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ UpdateDisplayStrings (
Status = SmbiosProtocol->GetNext (SmbiosProtocol, &SmbiosHandle, &Type, &Record, NULL);
if (!EFI_ERROR (Status)) {
Type1Record = (SMBIOS_TABLE_TYPE1 *)Record;

Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type1Record + Type1Record->Hdr.Length), Type1Record->SerialNumber, &NewString);
if (!EFI_ERROR (Status)) {
HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_PC_SERIALNUM_VALUE), NewString, NULL);
FreePool (NewString);
}

Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type1Record + Type1Record->Hdr.Length), Type1Record->ProductName, &NewString);
if (!EFI_ERROR (Status)) {
HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_PC_MODEL_VALUE), NewString, NULL);
Expand Down Expand Up @@ -300,12 +307,6 @@ UpdateDisplayStrings (
HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_PC_ASSET_TAG_VALUE), NewString, NULL);
FreePool (NewString);
}

Status = GetOptionalStringByIndex ((CHAR8 *)((UINT8 *)Type3Record + Type3Record->Hdr.Length), Type3Record->SerialNumber, &NewString);
if (!EFI_ERROR (Status)) {
HiiSetString (HiiHandle, STRING_TOKEN (STR_INF_VIEW_PC_SERIALNUM_VALUE), NewString, NULL);
FreePool (NewString);
}
}

return Status;
Expand Down

0 comments on commit 1ddac51

Please sign in to comment.