Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
7d0e3d40
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d0e3d40
编写于
5月 17, 2022
作者:
M
MikeBeaton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Various: Static string optimisations
上级
19ef39ec
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
83 addition
and
82 deletion
+83
-82
Legacy/BootPlatform/EfiLdr/EfiLoader.c
Legacy/BootPlatform/EfiLdr/EfiLoader.c
+1
-1
Library/OcBootManagementLib/VariableManagement.c
Library/OcBootManagementLib/VariableManagement.c
+2
-2
Library/OcHiiDatabaseLib/ConfigKeywordHandler.c
Library/OcHiiDatabaseLib/ConfigKeywordHandler.c
+25
-25
Library/OcHiiDatabaseLib/ConfigRouting.c
Library/OcHiiDatabaseLib/ConfigRouting.c
+51
-51
Library/OcHiiDatabaseLib/Font.c
Library/OcHiiDatabaseLib/Font.c
+1
-1
Library/OcHiiDatabaseLib/HiiDatabase.h
Library/OcHiiDatabaseLib/HiiDatabase.h
+1
-0
Library/OcMainLib/OpenCoreMisc.c
Library/OcMainLib/OpenCoreMisc.c
+1
-1
Utilities/ocvalidate/ValidateMisc.c
Utilities/ocvalidate/ValidateMisc.c
+1
-1
未找到文件。
Legacy/BootPlatform/EfiLdr/EfiLoader.c
浏览文件 @
7d0e3d40
...
...
@@ -55,7 +55,7 @@ EfiLoader (
#if 0
SerialPortInitialize ();
SerialPortWrite ((UINT8 *)"EfiLdr\r\n",
AsciiStrLen
("EfiLdr\r\n"));
SerialPortWrite ((UINT8 *)"EfiLdr\r\n",
L_STR_LEN
("EfiLdr\r\n"));
#endif
//
...
...
Library/OcBootManagementLib/VariableManagement.c
浏览文件 @
7d0e3d40
...
...
@@ -94,9 +94,9 @@ IsDeletableVariable (
//
if
(
(
StrCmp
(
Name
,
L"BootNext"
)
==
0
)
||
(
!
PreserveBoot
&&
(
StrnCmp
(
Name
,
L"Boot"
,
StrLen
(
L"Boot"
))
==
0
)
&&
(
StrnCmp
(
Name
,
L"Boot"
,
L_STR_LEN
(
L"Boot"
))
==
0
)
&&
(
StrCmp
(
Name
,
L"BootOptionSupport"
)
!=
0
))
||
(
StrnCmp
(
Name
,
L"Driver"
,
StrLen
(
L"Driver"
))
==
0
))
||
(
StrnCmp
(
Name
,
L"Driver"
,
L_STR_LEN
(
L"Driver"
))
==
0
))
{
return
TRUE
;
}
...
...
Library/OcHiiDatabaseLib/ConfigKeywordHandler.c
浏览文件 @
7d0e3d40
...
...
@@ -62,8 +62,8 @@ ExtractDevicePath (
//
// Find the 'PATH=' of <PathHdr>.
//
if
(
StrnCmp
(
String
,
L"PATH="
,
StrLen
(
L"PATH="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"KEYWORD="
,
StrLen
(
L"KEYWORD="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"PATH="
,
L_STR_LEN
(
L"PATH="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"KEYWORD="
,
L_STR_LEN
(
L"KEYWORD="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
else
{
//
...
...
@@ -78,7 +78,7 @@ ExtractDevicePath (
//
// Check whether path data does exist.
//
String
+=
StrLen
(
L"PATH="
);
String
+=
L_STR_LEN
(
L"PATH="
);
if
(
*
String
==
0
)
{
return
EFI_INVALID_PARAMETER
;
}
...
...
@@ -199,11 +199,11 @@ ExtractNameSpace (
String
++
;
}
if
(
StrnCmp
(
String
,
L"NAMESPACE="
,
StrLen
(
L"NAMESPACE="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"NAMESPACE="
,
L_STR_LEN
(
L"NAMESPACE="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
String
+=
StrLen
(
L"NAMESPACE="
);
String
+=
L_STR_LEN
(
L"NAMESPACE="
);
TmpPtr
=
StrStr
(
String
,
L"&"
);
if
(
TmpPtr
!=
NULL
)
{
...
...
@@ -275,11 +275,11 @@ ExtractKeyword (
String
++
;
}
if
(
StrnCmp
(
String
,
L"KEYWORD="
,
StrLen
(
L"KEYWORD="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"KEYWORD="
,
L_STR_LEN
(
L"KEYWORD="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
String
+=
StrLen
(
L"KEYWORD="
);
String
+=
L_STR_LEN
(
L"KEYWORD="
);
TmpPtr
=
StrStr
(
String
,
L"&"
);
if
(
TmpPtr
!=
NULL
)
{
...
...
@@ -331,11 +331,11 @@ ExtractValue (
String
++
;
}
if
(
StrnCmp
(
String
,
L"VALUE="
,
StrLen
(
L"VALUE="
))
!=
0
)
{
if
(
StrnCmp
(
String
,
L"VALUE="
,
L_STR_LEN
(
L"VALUE="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
String
+=
StrLen
(
L"VALUE="
);
String
+=
L_STR_LEN
(
L"VALUE="
);
TmpPtr
=
StrStr
(
String
,
L"&"
);
if
(
TmpPtr
!=
NULL
)
{
...
...
@@ -400,29 +400,29 @@ ExtractFilter (
String
++
;
}
if
(
StrnCmp
(
String
,
L"ReadOnly"
,
StrLen
(
L"ReadOnly"
))
==
0
)
{
if
(
StrnCmp
(
String
,
L"ReadOnly"
,
L_STR_LEN
(
L"ReadOnly"
))
==
0
)
{
//
// Find ReadOnly filter.
//
*
FilterFlags
|=
EFI_KEYWORD_FILTER_READONY
;
String
+=
StrLen
(
L"ReadOnly"
);
}
else
if
(
StrnCmp
(
String
,
L"ReadWrite"
,
StrLen
(
L"ReadWrite"
))
==
0
)
{
String
+=
L_STR_LEN
(
L"ReadOnly"
);
}
else
if
(
StrnCmp
(
String
,
L"ReadWrite"
,
L_STR_LEN
(
L"ReadWrite"
))
==
0
)
{
//
// Find ReadWrite filter.
//
*
FilterFlags
|=
EFI_KEYWORD_FILTER_REAWRITE
;
String
+=
StrLen
(
L"ReadWrite"
);
}
else
if
(
StrnCmp
(
String
,
L"Buffer"
,
StrLen
(
L"Buffer"
))
==
0
)
{
String
+=
L_STR_LEN
(
L"ReadWrite"
);
}
else
if
(
StrnCmp
(
String
,
L"Buffer"
,
L_STR_LEN
(
L"Buffer"
))
==
0
)
{
//
// Find Buffer Filter.
//
*
FilterFlags
|=
EFI_KEYWORD_FILTER_BUFFER
;
String
+=
StrLen
(
L"Buffer"
);
}
else
if
(
StrnCmp
(
String
,
L"Numeric"
,
StrLen
(
L"Numeric"
))
==
0
)
{
String
+=
L_STR_LEN
(
L"Buffer"
);
}
else
if
(
StrnCmp
(
String
,
L"Numeric"
,
L_STR_LEN
(
L"Numeric"
))
==
0
)
{
//
// Find Numeric Filter
//
String
+=
StrLen
(
L"Numeric"
);
String
+=
L_STR_LEN
(
L"Numeric"
);
if
(
*
String
!=
L':'
)
{
*
FilterFlags
|=
EFI_KEYWORD_FILTER_NUMERIC
;
}
else
{
...
...
@@ -451,8 +451,8 @@ ExtractFilter (
//
// Check whether other filter item defined by Platform.
//
if
((
StrnCmp
(
String
,
L"&PATH"
,
StrLen
(
L"&PATH"
))
==
0
)
||
(
StrnCmp
(
String
,
L"&KEYWORD"
,
StrLen
(
L"&KEYWORD"
))
==
0
))
if
((
StrnCmp
(
String
,
L"&PATH"
,
L_STR_LEN
(
L"&PATH"
))
==
0
)
||
(
StrnCmp
(
String
,
L"&KEYWORD"
,
L_STR_LEN
(
L"&KEYWORD"
))
==
0
))
{
//
// New KeywordRequest start, no platform defined filter.
...
...
@@ -1987,7 +1987,7 @@ GetNameFromId (
NULL
);
if
(
BestLanguage
==
NULL
)
{
BestLanguage
=
AllocateCopyPool
(
AsciiStrLen
(
"en-US"
),
"en-US"
);
BestLanguage
=
AllocateCopyPool
(
L_STR_LEN
(
"en-US"
),
"en-US"
);
ASSERT
(
BestLanguage
!=
NULL
);
}
...
...
@@ -2224,7 +2224,7 @@ ExtractConfigResp (
ConfigHdr
=
ConstructConfigHdr
(
Storage
,
DatabaseRecord
->
DriverHandle
);
ASSERT
(
ConfigHdr
!=
NULL
);
MaxLen
=
StrLen
(
ConfigHdr
)
+
1
+
StrLen
(
RequestElement
)
+
1
+
StrLen
(
L"VALUE="
)
+
StrLen
(
ValueElement
)
+
1
;
MaxLen
=
StrLen
(
ConfigHdr
)
+
1
+
StrLen
(
RequestElement
)
+
1
+
L_STR_LEN
(
L"VALUE="
)
+
StrLen
(
ValueElement
)
+
1
;
*
ConfigResp
=
AllocatePool
(
MaxLen
*
sizeof
(
CHAR16
));
if
(
*
ConfigResp
==
NULL
)
{
FreePool
(
ConfigHdr
);
...
...
@@ -2949,7 +2949,7 @@ EfiConfigKeywordHandlerSetData (
//
// 1.1 Check whether the input namespace is valid.
//
if
(
AsciiStrnCmp
(
NameSpace
,
UEFI_CONFIG_LANG
,
AsciiStrLen
(
UEFI_CONFIG_LANG
))
!=
0
)
{
if
(
AsciiStrnCmp
(
NameSpace
,
UEFI_CONFIG_LANG
,
L_STR_LEN
(
UEFI_CONFIG_LANG
))
!=
0
)
{
*
ProgressErr
=
KEYWORD_HANDLER_MALFORMED_STRING
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Done
;
...
...
@@ -3002,9 +3002,9 @@ EfiConfigKeywordHandlerSetData (
//
// 5. Find READONLY tag.
//
if
((
StringPtr
!=
NULL
)
&&
(
StrnCmp
(
StringPtr
,
L"&READONLY"
,
StrLen
(
L"&READONLY"
))
==
0
))
{
if
((
StringPtr
!=
NULL
)
&&
(
StrnCmp
(
StringPtr
,
L"&READONLY"
,
L_STR_LEN
(
L"&READONLY"
))
==
0
))
{
ReadOnly
=
TRUE
;
StringPtr
+=
StrLen
(
L"&READONLY"
);
StringPtr
+=
L_STR_LEN
(
L"&READONLY"
);
}
else
{
ReadOnly
=
FALSE
;
}
...
...
@@ -3262,7 +3262,7 @@ EfiConfigKeywordHandlerGetData (
// 1.1 Check whether the input namespace is valid.
//
if
(
NameSpace
!=
NULL
)
{
if
(
AsciiStrnCmp
(
NameSpace
,
UEFI_CONFIG_LANG
,
AsciiStrLen
(
UEFI_CONFIG_LANG
))
!=
0
)
{
if
(
AsciiStrnCmp
(
NameSpace
,
UEFI_CONFIG_LANG
,
L_STR_LEN
(
UEFI_CONFIG_LANG
))
!=
0
)
{
*
ProgressErr
=
KEYWORD_HANDLER_MALFORMED_STRING
;
return
EFI_INVALID_PARAMETER
;
}
...
...
Library/OcHiiDatabaseLib/ConfigRouting.c
浏览文件 @
7d0e3d40
...
...
@@ -32,7 +32,7 @@ CalculateConfigStringLen (
// "GUID=" should be the first element of incoming string.
//
ASSERT
(
String
!=
NULL
);
ASSERT
(
StrnCmp
(
String
,
L"GUID="
,
StrLen
(
L"GUID="
))
==
0
);
ASSERT
(
StrnCmp
(
String
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
==
0
);
//
// The beginning of next <ConfigRequest>/<ConfigResp> should be "&GUID=".
...
...
@@ -83,7 +83,7 @@ GetDevicePath (
//
// Find the 'PATH=' of <PathHdr> and skip it.
//
for
(
;
(
*
String
!=
0
&&
StrnCmp
(
String
,
L"PATH="
,
StrLen
(
L"PATH="
))
!=
0
);
String
++
)
{
for
(
;
(
*
String
!=
0
&&
StrnCmp
(
String
,
L"PATH="
,
L_STR_LEN
(
L"PATH="
))
!=
0
);
String
++
)
{
}
if
(
*
String
==
0
)
{
...
...
@@ -93,7 +93,7 @@ GetDevicePath (
//
// Check whether path data does exist.
//
String
+=
StrLen
(
L"PATH="
);
String
+=
L_STR_LEN
(
L"PATH="
);
if
(
*
String
==
0
)
{
return
EFI_INVALID_PARAMETER
;
}
...
...
@@ -356,7 +356,7 @@ OutputConfigBody (
//
// The setting information should start OFFSET, not ALTCFG.
//
if
(
StrnCmp
(
String
,
L"&ALTCFG="
,
StrLen
(
L"&ALTCFG="
))
==
0
)
{
if
(
StrnCmp
(
String
,
L"&ALTCFG="
,
L_STR_LEN
(
L"&ALTCFG="
))
==
0
)
{
return
EFI_INVALID_PARAMETER
;
}
...
...
@@ -644,7 +644,7 @@ CompareBlockElementDefault (
// Find the "&OFFSET=<Number>" block and get the value of the Number with AltConfigHdr in DefaultAltCfgResp.
//
BlockPtrStart
=
BlockPtr
;
BlockPtr
+=
StrLen
(
L"&OFFSET="
);
BlockPtr
+=
L_STR_LEN
(
L"&OFFSET="
);
Status
=
GetValueOfNumber
(
BlockPtr
,
&
TempBuffer
,
&
OffsetLength
);
if
(
EFI_ERROR
(
Status
))
{
Status
=
EFI_OUT_OF_RESOURCES
;
...
...
@@ -1075,15 +1075,15 @@ MergeDefaultString (
//
// Find <ConfigHdr> GUID=...&NAME=...&PATH=...
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
StrLen
(
L"&NAME="
))
!=
0
)
{
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
L_STR_LEN
(
L"&NAME="
))
!=
0
)
{
StringPtr
++
;
}
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
StrLen
(
L"&PATH="
))
!=
0
)
{
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
L_STR_LEN
(
L"&PATH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -1091,7 +1091,7 @@ MergeDefaultString (
return
EFI_INVALID_PARAMETER
;
}
StringPtr
+=
StrLen
(
L"&PATH="
);
StringPtr
+=
L_STR_LEN
(
L"&PATH="
);
while
(
*
StringPtr
!=
L'\0'
&&
*
StringPtr
!=
L'&'
)
{
StringPtr
++
;
}
...
...
@@ -3248,12 +3248,12 @@ GetBlockElement (
// <BlockName> ::= &'OFFSET='<Number>&'WIDTH='<Number>
//
StringPtr
=
ConfigRequest
;
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
StrLen
(
L"&OFFSET="
))
==
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
L_STR_LEN
(
L"&OFFSET="
))
==
0
)
{
//
// Skip the OFFSET string
//
*
Progress
=
StringPtr
;
StringPtr
+=
StrLen
(
L"&OFFSET="
);
StringPtr
+=
L_STR_LEN
(
L"&OFFSET="
);
//
// Get Offset
//
...
...
@@ -3271,11 +3271,11 @@ GetBlockElement (
FreePool
(
TmpBuffer
);
StringPtr
+=
Length
;
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
StrLen
(
L"&WIDTH="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
L_STR_LEN
(
L"&WIDTH="
))
!=
0
)
{
goto
Done
;
}
StringPtr
+=
StrLen
(
L"&WIDTH="
);
StringPtr
+=
L_STR_LEN
(
L"&WIDTH="
);
//
// Get Width
...
...
@@ -3313,8 +3313,8 @@ GetBlockElement (
//
// Skip &VALUE string if &VALUE does exists.
//
if
(
StrnCmp
(
StringPtr
,
L"&VALUE="
,
StrLen
(
L"&VALUE="
))
==
0
)
{
StringPtr
+=
StrLen
(
L"&VALUE="
);
if
(
StrnCmp
(
StringPtr
,
L"&VALUE="
,
L_STR_LEN
(
L"&VALUE="
))
==
0
)
{
StringPtr
+=
L_STR_LEN
(
L"&VALUE="
);
//
// Get Value
...
...
@@ -4216,13 +4216,13 @@ GetFullStringFromHiiFormPackages (
//
// Jump <ConfigHdr>
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
Status
=
EFI_INVALID_PARAMETER
;
goto
Done
;
}
StringPtr
+=
StrLen
(
L"GUID="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
StrLen
(
L"&NAME="
))
!=
0
)
{
StringPtr
+=
L_STR_LEN
(
L"GUID="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
L_STR_LEN
(
L"&NAME="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4231,8 +4231,8 @@ GetFullStringFromHiiFormPackages (
goto
Done
;
}
StringPtr
+=
StrLen
(
L"&NAME="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
StrLen
(
L"&PATH="
))
!=
0
)
{
StringPtr
+=
L_STR_LEN
(
L"&NAME="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
L_STR_LEN
(
L"&PATH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4241,7 +4241,7 @@ GetFullStringFromHiiFormPackages (
goto
Done
;
}
StringPtr
+=
StrLen
(
L"&PATH="
);
StringPtr
+=
L_STR_LEN
(
L"&PATH="
);
while
(
*
StringPtr
!=
L'\0'
&&
*
StringPtr
!=
L'&'
)
{
StringPtr
++
;
}
...
...
@@ -4635,11 +4635,11 @@ OffsetWidthValidate (
while
(
1
)
{
RetVal
=
StringPtr
;
if
(
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
StrLen
(
L"&OFFSET="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
L_STR_LEN
(
L"&OFFSET="
))
!=
0
)
{
return
RetVal
;
}
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
StrLen
(
L"&WIDTH="
))
!=
0
)
{
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
L_STR_LEN
(
L"&WIDTH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4647,8 +4647,8 @@ OffsetWidthValidate (
return
RetVal
;
}
StringPtr
+=
StrLen
(
L"&WIDTH="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
StrLen
(
L"&OFFSET="
))
!=
0
)
{
StringPtr
+=
L_STR_LEN
(
L"&WIDTH="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
L_STR_LEN
(
L"&OFFSET="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4717,12 +4717,12 @@ ConfigRequestValidate (
//
// Check <ConfigHdr>
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
return
ConfigRequest
;
}
StringPtr
+=
StrLen
(
L"GUID="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
StrLen
(
L"&NAME="
))
!=
0
)
{
StringPtr
+=
L_STR_LEN
(
L"GUID="
);
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&NAME="
,
L_STR_LEN
(
L"&NAME="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4730,12 +4730,12 @@ ConfigRequestValidate (
return
ConfigRequest
;
}
StringPtr
+=
StrLen
(
L"&NAME="
);
StringPtr
+=
L_STR_LEN
(
L"&NAME="
);
if
(
*
StringPtr
==
L'&'
)
{
HasNameField
=
FALSE
;
}
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
StrLen
(
L"&PATH="
))
!=
0
)
{
while
(
*
StringPtr
!=
L'\0'
&&
StrnCmp
(
StringPtr
,
L"&PATH="
,
L_STR_LEN
(
L"&PATH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -4743,7 +4743,7 @@ ConfigRequestValidate (
return
ConfigRequest
;
}
StringPtr
+=
StrLen
(
L"&PATH="
);
StringPtr
+=
L_STR_LEN
(
L"&PATH="
);
while
(
*
StringPtr
!=
L'\0'
&&
*
StringPtr
!=
L'&'
)
{
StringPtr
++
;
}
...
...
@@ -4872,7 +4872,7 @@ HiiConfigRoutingExtractConfig (
// The first element of <MultiConfigRequest> should be
// <GuidHdr>, which is in 'GUID='<Guid> syntax.
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
...
...
@@ -4887,7 +4887,7 @@ HiiConfigRoutingExtractConfig (
return
EFI_OUT_OF_RESOURCES
;
}
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
==
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
==
0
)
{
//
// If parsing error, set Progress to the beginning of the <MultiConfigRequest>
// or most recent & before the error.
...
...
@@ -5456,11 +5456,11 @@ HiiConfigRoutingRouteConfig (
// The first element of <MultiConfigResp> should be
// <GuidHdr>, which is in 'GUID='<Guid> syntax.
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
==
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
==
0
)
{
//
// If parsing error, set Progress to the beginning of the <MultiConfigResp>
// or most recent & before the error.
...
...
@@ -5698,13 +5698,13 @@ HiiBlockToConfig (
//
// Jump <ConfigHdr>
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
*
Progress
=
StringPtr
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Exit
;
}
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"PATH="
,
StrLen
(
L"PATH="
))
!=
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"PATH="
,
L_STR_LEN
(
L"PATH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -5745,13 +5745,13 @@ HiiBlockToConfig (
// Only <BlockName> format is supported by this help function.
// <BlockName> ::= 'OFFSET='<Number>&'WIDTH='<Number>
//
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"OFFSET="
,
StrLen
(
L"OFFSET="
))
==
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"OFFSET="
,
L_STR_LEN
(
L"OFFSET="
))
==
0
)
{
//
// Back up the header of one <BlockName>
//
TmpPtr
=
StringPtr
;
StringPtr
+=
StrLen
(
L"OFFSET="
);
StringPtr
+=
L_STR_LEN
(
L"OFFSET="
);
//
// Get Offset
//
...
...
@@ -5770,13 +5770,13 @@ HiiBlockToConfig (
FreePool
(
TmpBuffer
);
StringPtr
+=
Length
;
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
StrLen
(
L"&WIDTH="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
L_STR_LEN
(
L"&WIDTH="
))
!=
0
)
{
*
Progress
=
TmpPtr
-
1
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Exit
;
}
StringPtr
+=
StrLen
(
L"&WIDTH="
);
StringPtr
+=
L_STR_LEN
(
L"&WIDTH="
);
//
// Get Width
...
...
@@ -5847,7 +5847,7 @@ HiiBlockToConfig (
//
// Build a ConfigElement
//
Length
+=
StringPtr
-
TmpPtr
+
1
+
StrLen
(
L"VALUE="
);
Length
+=
StringPtr
-
TmpPtr
+
1
+
L_STR_LEN
(
L"VALUE="
);
ConfigElement
=
(
EFI_STRING
)
AllocateZeroPool
(
Length
*
sizeof
(
CHAR16
));
if
(
ConfigElement
==
NULL
)
{
Status
=
EFI_OUT_OF_RESOURCES
;
...
...
@@ -6003,13 +6003,13 @@ HiiConfigToBlock (
//
// Jump <ConfigHdr>
//
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
*
Progress
=
StringPtr
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Exit
;
}
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"PATH="
,
StrLen
(
L"PATH="
))
!=
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"PATH="
,
L_STR_LEN
(
L"PATH="
))
!=
0
)
{
StringPtr
++
;
}
...
...
@@ -6034,9 +6034,9 @@ HiiConfigToBlock (
// Only '&'<BlockConfig> format is supported by this help function.
// <BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE='<Number>
//
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
StrLen
(
L"&OFFSET="
))
==
0
)
{
while
(
*
StringPtr
!=
0
&&
StrnCmp
(
StringPtr
,
L"&OFFSET="
,
L_STR_LEN
(
L"&OFFSET="
))
==
0
)
{
TmpPtr
=
StringPtr
;
StringPtr
+=
StrLen
(
L"&OFFSET="
);
StringPtr
+=
L_STR_LEN
(
L"&OFFSET="
);
//
// Get Offset
//
...
...
@@ -6055,13 +6055,13 @@ HiiConfigToBlock (
FreePool
(
TmpBuffer
);
StringPtr
+=
Length
;
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
StrLen
(
L"&WIDTH="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"&WIDTH="
,
L_STR_LEN
(
L"&WIDTH="
))
!=
0
)
{
*
Progress
=
TmpPtr
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Exit
;
}
StringPtr
+=
StrLen
(
L"&WIDTH="
);
StringPtr
+=
L_STR_LEN
(
L"&WIDTH="
);
//
// Get Width
...
...
@@ -6081,13 +6081,13 @@ HiiConfigToBlock (
FreePool
(
TmpBuffer
);
StringPtr
+=
Length
;
if
(
StrnCmp
(
StringPtr
,
L"&VALUE="
,
StrLen
(
L"&VALUE="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"&VALUE="
,
L_STR_LEN
(
L"&VALUE="
))
!=
0
)
{
*
Progress
=
TmpPtr
;
Status
=
EFI_INVALID_PARAMETER
;
goto
Exit
;
}
StringPtr
+=
StrLen
(
L"&VALUE="
);
StringPtr
+=
L_STR_LEN
(
L"&VALUE="
);
//
// Get Value
...
...
@@ -6245,7 +6245,7 @@ HiiGetAltCfg (
}
StringPtr
=
Configuration
;
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
StrLen
(
L"GUID="
))
!=
0
)
{
if
(
StrnCmp
(
StringPtr
,
L"GUID="
,
L_STR_LEN
(
L"GUID="
))
!=
0
)
{
return
EFI_INVALID_PARAMETER
;
}
...
...
Library/OcHiiDatabaseLib/Font.c
浏览文件 @
7d0e3d40
...
...
@@ -1011,7 +1011,7 @@ GetSystemFont (
//
// The standard font always has the name "sysdefault".
//
NameSize
=
StrSize
(
L"sysdefault"
);
NameSize
=
L_STR_SIZE
(
L"sysdefault"
);
InfoSize
=
sizeof
(
EFI_FONT_DISPLAY_INFO
)
-
sizeof
(
CHAR16
)
+
NameSize
;
Info
=
(
EFI_FONT_DISPLAY_INFO
*
)
AllocateZeroPool
(
InfoSize
);
if
(
Info
==
NULL
)
{
...
...
Library/OcHiiDatabaseLib/HiiDatabase.h
浏览文件 @
7d0e3d40
...
...
@@ -40,6 +40,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/PcdLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/PrintLib.h>
#include <Library/OcStringLib.h>
#define MAX_STRING_LENGTH 1024
#define MAX_FONT_NAME_LEN 256
...
...
Library/OcMainLib/OpenCoreMisc.c
浏览文件 @
7d0e3d40
...
...
@@ -572,7 +572,7 @@ BuildLauncherPath (
// For custom paths no deduplication happens.
//
if
(
AsciiStrCmp
(
LauncherPath
,
"Default"
)
==
0
)
{
BootstrapSize
=
StrSize
(
RootPath
)
+
StrSize
(
OPEN_CORE_APP_PATH
);
BootstrapSize
=
StrSize
(
RootPath
)
+
L_STR_SIZE
(
OPEN_CORE_APP_PATH
);
BootstrapPath
=
AllocatePool
(
BootstrapSize
);
if
(
BootstrapPath
==
NULL
)
{
return
NULL
;
...
...
Utilities/ocvalidate/ValidateMisc.c
浏览文件 @
7d0e3d40
...
...
@@ -706,7 +706,7 @@ CheckMiscTools (
//
// Check the length of path relative to OC directory.
//
if
(
StrLen
(
OPEN_CORE_TOOL_PATH
)
+
AsciiStrSize
(
Path
)
>
OC_STORAGE_SAFE_PATH_MAX
)
{
if
(
L_STR_LEN
(
OPEN_CORE_TOOL_PATH
)
+
AsciiStrSize
(
Path
)
>
OC_STORAGE_SAFE_PATH_MAX
)
{
DEBUG
((
DEBUG_WARN
,
"Misc->Tools[%u]->Path is too long (should not exceed %u)!
\n
"
,
Index
,
OC_STORAGE_SAFE_PATH_MAX
));
++
ErrorCount
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录