2 boot information boot time changes.
5 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include "MiscSubclassDriver.h"
13 This function makes boot time changes to the contents of the
14 MiscOemString (Type 11).
16 @param RecordData Pointer to copy of RecordData from the Data Table.
18 @retval EFI_SUCCESS All parameters were valid.
19 @retval EFI_UNSUPPORTED Unexpected RecordType value.
20 @retval EFI_INVALID_PARAMETER Invalid parameter was found.
23 MISC_SMBIOS_TABLE_FUNCTION(OemString
)
26 CHAR8
*OptionalStrStart
;
29 STRING_REF TokenToGet
;
30 EFI_SMBIOS_HANDLE SmbiosHandle
;
31 SMBIOS_TABLE_TYPE11
*SmbiosRecord
;
34 // First check for invalid parameters.
36 if (RecordData
== NULL
) {
37 return EFI_INVALID_PARAMETER
;
40 TokenToGet
= STRING_TOKEN (STR_MISC_OEM_STRING
);
41 OemStr
= HiiGetPackageString(&gEfiCallerIdGuid
, TokenToGet
, NULL
);
42 OemStrLen
= StrLen(OemStr
);
43 if (OemStrLen
> SMBIOS_STRING_MAX_LENGTH
) {
44 return EFI_UNSUPPORTED
;
48 // Two zeros following the last string.
50 SmbiosRecord
= AllocatePool(sizeof (SMBIOS_TABLE_TYPE11
) + OemStrLen
+ 1 + 1);
51 ZeroMem(SmbiosRecord
, sizeof (SMBIOS_TABLE_TYPE11
) + OemStrLen
+ 1 + 1);
53 SmbiosRecord
->Hdr
.Type
= EFI_SMBIOS_TYPE_OEM_STRINGS
;
54 SmbiosRecord
->Hdr
.Length
= sizeof (SMBIOS_TABLE_TYPE11
);
56 // Make handle chosen by smbios protocol.add automatically.
58 SmbiosRecord
->Hdr
.Handle
= 0;
59 SmbiosRecord
->StringCount
= 1;
60 OptionalStrStart
= (CHAR8
*)(SmbiosRecord
+ 1);
61 UnicodeStrToAsciiStr(OemStr
, OptionalStrStart
);
64 // Now we have got the full smbios record, call smbios protocol to add this record.
66 Status
= AddSmbiosRecord (Smbios
, &SmbiosHandle
, (EFI_SMBIOS_TABLE_HEADER
*) SmbiosRecord
);
68 FreePool(SmbiosRecord
);