34 OUT UINT8 *StrRef OPTIONAL
40 if ((StrTable ==
NULL) || (Str ==
NULL)) {
41 return EFI_INVALID_PARAMETER;
44 if (StrTable->StrCount >= StrTable->MaxStringElements) {
45 return EFI_BUFFER_TOO_SMALL;
50 return EFI_INVALID_PARAMETER;
54 StrElement = &StrTable->Elements[StrTable->StrCount];
59 StrTable->TotalStrLen += StrLength;
66 *StrRef = StrTable->StrCount;
85 if (StrTable ==
NULL) {
103 return (StrTable->StrCount == 0) ? 2 :
104 (StrTable->TotalStrLen + StrTable->StrCount + 1);
122 IN CHAR8 *
CONST SmbiosStringAreaStart,
129 UINTN BytesRemaining;
132 if ((StrTable ==
NULL) || (SmbiosStringAreaStart ==
NULL)) {
133 return EFI_INVALID_PARAMETER;
137 return EFI_BUFFER_TOO_SMALL;
140 SmbiosString = SmbiosStringAreaStart;
141 BytesRemaining = SmbiosStringAreaSize;
143 if (StrTable->StrCount == 0) {
149 *SmbiosString++ =
'\0';
151 for (Index = 0; Index < StrTable->StrCount; Index++) {
152 StrElement = &StrTable->Elements[Index];
159 BytesRemaining -= BytesCopied;
160 SmbiosString += BytesCopied;
166 *SmbiosString =
'\0';
189 if ((StrTable ==
NULL) || (MaxStringElements > MAX_UINT8)) {
190 return EFI_INVALID_PARAMETER;
198 if (Elements ==
NULL) {
199 return EFI_OUT_OF_RESOURCES;
202 StrTable->Elements = Elements;
203 StrTable->MaxStringElements = (UINT8)MaxStringElements;
220 if ((StrTable ==
NULL) || (StrTable->Elements ==
NULL)) {
221 return EFI_INVALID_PARAMETER;
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI StringTableGetStringSetSize(IN STRING_TABLE *CONST StrTable)
EFI_STATUS EFIAPI StringTableInitialize(IN STRING_TABLE *CONST StrTable, IN UINTN MaxStringElements)
EFI_STATUS EFIAPI StringTableFree(IN STRING_TABLE *CONST StrTable)
EFI_STATUS EFIAPI StringTablePublishStringSet(IN STRING_TABLE *CONST StrTable, IN CHAR8 *CONST SmbiosStringAreaStart, IN CONST UINTN SmbiosStringAreaSize)
EFI_STATUS EFIAPI StringTableAddString(IN STRING_TABLE *CONST StrTable, IN CONST CHAR8 *Str, OUT UINT8 *StrRef OPTIONAL)
UINTN StringLen
Length of the string (does not include the NULL termination)
CONST CHAR8 * String
Reference to the string.