diff options
-rw-r--r-- | EmulatorPkg/Include/Library/SmbiosLib.h | 7 | ||||
-rw-r--r-- | EmulatorPkg/Library/SmbiosLib/SmbiosLib.c | 15 |
2 files changed, 12 insertions, 10 deletions
diff --git a/EmulatorPkg/Include/Library/SmbiosLib.h b/EmulatorPkg/Include/Library/SmbiosLib.h index 9bfb3fa669..f0b4582cb0 100644 --- a/EmulatorPkg/Include/Library/SmbiosLib.h +++ b/EmulatorPkg/Include/Library/SmbiosLib.h @@ -149,15 +149,16 @@ SmbiosLibUpdateUnicodeString ( Allow caller to read a specific SMBIOS string @param[in] Header SMBIOS record that contains the string. - @param[in[ Intance Instance of SMBIOS string 0 - N-1. + @param[in[ StringNumber Instance of SMBIOS string 1 - N. @retval NULL Instance of Type SMBIOS string was not found. @retval Other Pointer to matching SMBIOS string. **/ CHAR8 * +EFIAPI SmbiosLibReadString ( - IN SMBIOS_STRUCTURE *Header, - IN UINTN Instance + IN SMBIOS_STRUCTURE *Header, + IN EFI_SMBIOS_STRING StringNumber ); diff --git a/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c b/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c index 15e135974f..604aa39d0c 100644 --- a/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c +++ b/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c @@ -241,28 +241,29 @@ SmbiosLibUpdateUnicodeString ( Allow caller to read a specific SMBIOS string @param[in] Header SMBIOS record that contains the string. - @param[in[ Intance Instance of SMBIOS string 0 - N-1. + @param[in[ StringNumber Instance of SMBIOS string 1 - N. @retval NULL Instance of Type SMBIOS string was not found. @retval Other Pointer to matching SMBIOS string. **/ CHAR8 * +EFIAPI SmbiosLibReadString ( - IN SMBIOS_STRUCTURE *Header, - IN UINTN Instance + IN SMBIOS_STRUCTURE *Header, + IN EFI_SMBIOS_STRING StringNumber ) { CHAR8 *Data; - UINTN NullCount; + UINTN Match; Data = (CHAR8 *)Header + Header->Length; - for (NullCount = 0;!(*Data == 0 && *(Data+1) == 0); ) { - if (Instance == NullCount) { + for (Match = 1;!(*Data == 0 && *(Data+1) == 0); ) { + if (StringNumber == Match) { return Data; } Data++; if (*(Data - 1) == '\0') { - NullCount++; + Match++; } } |