summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/VfrCompile
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-18 05:04:32 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-18 05:04:32 +0000
commit40d841f6a8f84e75409178e19e69b95e01bada0f (patch)
tree75b50fad9fc4190bf505ac99c283064ec8c79f2b /BaseTools/Source/C/VfrCompile
parent3dc8585e0a9fd4b2cb383f3ceb4961c7a88a8e71 (diff)
downloadedk2-platforms-40d841f6a8f84e75409178e19e69b95e01bada0f.tar.xz
Sync EDKII BaseTools to BaseTools project r1971
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10502 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C/VfrCompile')
-rw-r--r--BaseTools/Source/C/VfrCompile/EfiVfr.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/GNUmakefile4
-rw-r--r--BaseTools/Source/C/VfrCompile/Makefile4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.cpp4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrError.cpp4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrError.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g73
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrUtilityLib.h4
12 files changed, 86 insertions, 31 deletions
diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/VfrCompile/EfiVfr.h
index 809ca9e4ad..406a12491d 100644
--- a/BaseTools/Source/C/VfrCompile/EfiVfr.h
+++ b/BaseTools/Source/C/VfrCompile/EfiVfr.h
@@ -1,7 +1,7 @@
/** @file
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile
index 7be5758ffb..af04ab104c 100644
--- a/BaseTools/Source/C/VfrCompile/GNUmakefile
+++ b/BaseTools/Source/C/VfrCompile/GNUmakefile
@@ -1,8 +1,8 @@
## @file
# Windows makefile for 'VfrCompile' module build.
#
-# Copyright (c) 2008 - 2010, Intel Corporation<BR>
-# All rights reserved. This program and the accompanying materials
+# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/Makefile b/BaseTools/Source/C/VfrCompile/Makefile
index bdafbf69de..caadc40c4b 100644
--- a/BaseTools/Source/C/VfrCompile/Makefile
+++ b/BaseTools/Source/C/VfrCompile/Makefile
@@ -1,8 +1,8 @@
## @file
# Windows makefile for 'VfrCompile' module build.
#
-# Copyright (c) 2008 - 2010, Intel Corporation<BR>
-# All rights reserved. This program and the accompanying materials
+# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
index 508b68371e..24ac977892 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
@@ -2,8 +2,8 @@
VfrCompiler main class and main function.
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source/C/VfrCompile/VfrCompiler.h
index fcd2b24146..c32325f0b7 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h
@@ -2,8 +2,8 @@
VfrCompiler internal defintions.
-Copyright (c) 2004 - 2008, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrError.cpp b/BaseTools/Source/C/VfrCompile/VfrError.cpp
index 3289101710..3bfe5d576a 100644
--- a/BaseTools/Source/C/VfrCompile/VfrError.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrError.cpp
@@ -2,8 +2,8 @@
VfrCompiler error handler.
-Copyright (c) 2004 - 2008, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrError.h b/BaseTools/Source/C/VfrCompile/VfrError.h
index 916e0702eb..29cccabd29 100644
--- a/BaseTools/Source/C/VfrCompile/VfrError.h
+++ b/BaseTools/Source/C/VfrCompile/VfrError.h
@@ -2,8 +2,8 @@
VfrCompiler Error definition
-Copyright (c) 2004 - 2008, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
index ccbc04455a..571af91b0a 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
@@ -2,8 +2,8 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
index 38422e1332..88d3422162 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.h
@@ -2,8 +2,8 @@
The definition of CFormPkg's member function
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 2a4f7b6488..fc0215134d 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
@@ -1900,6 +1900,9 @@ vfrStatementStringType :
vfrStatementString :
<<
CIfrString SObj;
+ UINT32 VarArraySize;
+ UINT8 StringMinSize;
+ UINT8 StringMaxSize;
>>
L:String << SObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[SObj] ","
@@ -1907,8 +1910,27 @@ vfrStatementString :
{
Key "=" KN:Number "," << AssignQuestionKey (SObj, KN); >>
}
- MinSize "=" MIN:Number "," << SObj.SetMinSize (_STOU8(MIN->getText())); >>
- MaxSize "=" MAX:Number "," << SObj.SetMaxSize (_STOU8(MAX->getText())); >>
+ MinSize "=" MIN:Number "," <<
+ VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
+ StringMinSize = _STOU8(MIN->getText());
+ if (_STOU64(MIN->getText()) > StringMinSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "String MinSize takes only one byte, which can't be larger than 0xFF.");
+ } else if (VarArraySize != 0 && StringMinSize > VarArraySize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "String MinSize can't be larger than the max number of elements in string array.");
+ }
+ SObj.SetMinSize (StringMinSize);
+ >>
+ MaxSize "=" MAX:Number "," <<
+ StringMaxSize = _STOU8(MAX->getText());
+ if (_STOU64(MAX->getText()) > StringMaxSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize takes only one byte, which can't be larger than 0xFF.");
+ } else if (VarArraySize != 0 && StringMaxSize > VarArraySize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize can't be larger than the max number of elements in string array.");
+ } else if (StringMaxSize < StringMinSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "String MaxSize can't be less than String MinSize.");
+ }
+ SObj.SetMaxSize (StringMaxSize);
+ >>
vfrStatementQuestionOptionList
E:EndString << CRT_END_OP (E); >>
";"
@@ -1932,6 +1954,9 @@ stringFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
vfrStatementPassword :
<<
CIfrPassword PObj;
+ UINT32 VarArraySize;
+ UINT16 PasswordMinSize;
+ UINT16 PasswordMaxSize;
>>
L:Password << PObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[PObj] ","
@@ -1939,8 +1964,27 @@ vfrStatementPassword :
{
Key "=" KN:Number "," << AssignQuestionKey (PObj, KN); >>
}
- MinSize "=" MIN:Number "," << PObj.SetMinSize (_STOU16(MIN->getText())); >>
- MaxSize "=" MAX:Number "," << PObj.SetMaxSize (_STOU16(MAX->getText())); >>
+ MinSize "=" MIN:Number "," <<
+ VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
+ PasswordMinSize = _STOU16(MIN->getText());
+ if (_STOU64(MIN->getText()) > PasswordMinSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "Password MinSize takes only two byte, which can't be larger than 0xFFFF.");
+ } else if (VarArraySize != 0 && PasswordMinSize > VarArraySize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MIN->getLine(), "Password MinSize can't be larger than the max number of elements in password array.");
+ }
+ PObj.SetMinSize (PasswordMinSize);
+ >>
+ MaxSize "=" MAX:Number "," <<
+ PasswordMaxSize = _STOU16(MAX->getText());
+ if (_STOU64(MAX->getText()) > PasswordMaxSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize takes only two byte, which can't be larger than 0xFFFF.");
+ } else if (VarArraySize != 0 && PasswordMaxSize > VarArraySize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize can't be larger than the max number of elements in password array.");
+ } else if (PasswordMaxSize < PasswordMinSize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, MAX->getLine(), "Password MaxSize can't be less than Password MinSize.");
+ }
+ PObj.SetMaxSize (PasswordMaxSize);
+ >>
{ Encoding "=" Number "," }
vfrStatementQuestionOptionList
E:EndPassword << CRT_END_OP (E); >>
@@ -1961,12 +2005,23 @@ passwordFlagsField [UINT8 & HFlags] :
vfrStatementOrderedList :
<<
CIfrOrderedList OLObj;
+ UINT32 VarArraySize;
>>
L:OrderedList << OLObj.SetLineNo(L->getLine()); >>
vfrQuestionHeader[OLObj] ","
- << OLObj.SetMaxContainers ((UINT8) _GET_CURRQEST_ARRAY_SIZE()); >>
+ <<
+ VarArraySize = _GET_CURRQEST_ARRAY_SIZE();
+ OLObj.SetMaxContainers ((UINT8) (VarArraySize > 0xFF ? 0xFF : VarArraySize));
+ >>
{
- MaxContainers "=" M:Number "," << OLObj.SetMaxContainers (_STOU8(M->getText())); >>
+ MaxContainers "=" M:Number "," <<
+ if (_STOU64(M->getText()) > _STOU8(M->getText())) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, M->getLine(), "OrderedList MaxContainers takes only one byte, which can't be larger than 0xFF.");
+ } else if (VarArraySize != 0 && _STOU8(M->getText()) > VarArraySize) {
+ _PCATCH (VFR_RETURN_INVALID_PARAMETER, M->getLine(), "OrderedList MaxContainers can't be larger than the max number of elements in array.");
+ }
+ OLObj.SetMaxContainers (_STOU8(M->getText()));
+ >>
}
{ F:FLAGS "=" vfrOrderedListFlags[OLObj, F->getLine()] }
vfrStatementQuestionOptionList
@@ -2002,7 +2057,7 @@ vfrStatementTime :
(
vfrQuestionHeader[TObj, QUESTION_TIME] ","
{ F:FLAGS "=" vfrTimeFlags[TObj, F->getLine()] "," }
- vfrStatementDefault
+ vfrStatementQuestionOptionList
)
|
(
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
index cae0479ad3..3797cd8228 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
@@ -2,8 +2,8 @@
Vfr common library functions.
-Copyright (c) 2004 - 2008, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
index 27ec3d900f..bec5d67b94 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
@@ -2,8 +2,8 @@
Vfr common library functions.
-Copyright (c) 2004 - 2010, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php