mirror of https://github.com/acidanthera/audk.git
Update based on review feedback.
signed-off-by:andrewfish reviewed-by:Elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12976 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
07bcff9dbf
commit
79b3ce7e99
|
@ -149,15 +149,16 @@ SmbiosLibUpdateUnicodeString (
|
||||||
Allow caller to read a specific SMBIOS string
|
Allow caller to read a specific SMBIOS string
|
||||||
|
|
||||||
@param[in] Header SMBIOS record that contains the 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 NULL Instance of Type SMBIOS string was not found.
|
||||||
@retval Other Pointer to matching SMBIOS string.
|
@retval Other Pointer to matching SMBIOS string.
|
||||||
**/
|
**/
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
|
EFIAPI
|
||||||
SmbiosLibReadString (
|
SmbiosLibReadString (
|
||||||
IN SMBIOS_STRUCTURE *Header,
|
IN SMBIOS_STRUCTURE *Header,
|
||||||
IN UINTN Instance
|
IN EFI_SMBIOS_STRING StringNumber
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -241,28 +241,29 @@ SmbiosLibUpdateUnicodeString (
|
||||||
Allow caller to read a specific SMBIOS string
|
Allow caller to read a specific SMBIOS string
|
||||||
|
|
||||||
@param[in] Header SMBIOS record that contains the 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 NULL Instance of Type SMBIOS string was not found.
|
||||||
@retval Other Pointer to matching SMBIOS string.
|
@retval Other Pointer to matching SMBIOS string.
|
||||||
**/
|
**/
|
||||||
CHAR8 *
|
CHAR8 *
|
||||||
|
EFIAPI
|
||||||
SmbiosLibReadString (
|
SmbiosLibReadString (
|
||||||
IN SMBIOS_STRUCTURE *Header,
|
IN SMBIOS_STRUCTURE *Header,
|
||||||
IN UINTN Instance
|
IN EFI_SMBIOS_STRING StringNumber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CHAR8 *Data;
|
CHAR8 *Data;
|
||||||
UINTN NullCount;
|
UINTN Match;
|
||||||
|
|
||||||
Data = (CHAR8 *)Header + Header->Length;
|
Data = (CHAR8 *)Header + Header->Length;
|
||||||
for (NullCount = 0;!(*Data == 0 && *(Data+1) == 0); ) {
|
for (Match = 1;!(*Data == 0 && *(Data+1) == 0); ) {
|
||||||
if (Instance == NullCount) {
|
if (StringNumber == Match) {
|
||||||
return Data;
|
return Data;
|
||||||
}
|
}
|
||||||
Data++;
|
Data++;
|
||||||
if (*(Data - 1) == '\0') {
|
if (*(Data - 1) == '\0') {
|
||||||
NullCount++;
|
Match++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue