public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly
@ 2016-09-08  9:09 Dandan Bi
  2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dandan Bi @ 2016-09-08  9:09 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Eric Dong

This patch is to fix the incorrect logic when handling the "&READONLY" tag
in <KeywordResp>.
1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lower
case in current codes by mistake.
2. The logic in checking the ReadOnly flag is not correct. Whether having
"&READONLY" tag must be consistent with the result of
"ExtractReadOnlyFromOpCode" function.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c     | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index 6682319..10a901f 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData (
       goto Done;
     }
     StringPtr = NextStringPtr;
 
     //
-    // 5. Find ReadOnly filter.
+    // 5. Find READONLY tag.
     //
-    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&ReadOnly", StrLen (L"&ReadOnly")) == 0) {
+    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&READONLY", StrLen (L"&READONLY")) == 0) {
       ReadOnly = TRUE;
-      StringPtr += StrLen (L"&ReadOnly");
+      StringPtr += StrLen (L"&READONLY");
     } else {
       ReadOnly = FALSE;
     }
 
     //
@@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData (
 
     //
     // 8. Check the readonly flag.
     //
     if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
+      //
+      // Extracting readonly flag form opcode and extracting "READONLY" tag form KeywordString should have the same results.
+      // If not, the input KeywordString must be incorrect, return the error status to caller.
+      //
+      *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
+      Status = EFI_INVALID_PARAMETER;
+      goto Done;
+    }
+    if (ReadOnly) {
       *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
       Status = EFI_ACCESS_DENIED;
-      goto Done;      
+      goto Done;
     }
     
     //
     // 9. Merge to the MultiKeywordResp string.
     //
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [patch] MdeModulePkg/UiApp: Fix incorrect question id
  2016-09-08  9:09 [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dandan Bi
@ 2016-09-08  9:09 ` Dandan Bi
  2016-09-09  2:17   ` Dong, Eric
  2016-09-12  2:35   ` Gao, Liming
  2016-09-09  2:16 ` [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dong, Eric
  2016-09-12  2:29 ` Gao, Liming
  2 siblings, 2 replies; 6+ messages in thread
From: Dandan Bi @ 2016-09-08  9:09 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Eric Dong

For a question, its question id can not be zero.
This patch is to fix the issue that using zero as question id.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
index 93f6e4e..1505ef9 100644
--- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
+++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
@@ -41,10 +41,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define UI_HII_DRIVER_LIST_SIZE               0x8
 
 #define FRONT_PAGE_KEY_CONTINUE               0x1000
 #define FRONT_PAGE_KEY_RESET                  0x1001
 #define FRONT_PAGE_KEY_LANGUAGE               0x1002
+#define FRONT_PAGE_KEY_DRIVER                 0x2000
 
 typedef struct {
   EFI_STRING_ID   PromptId;
   EFI_STRING_ID   HelpId;
   EFI_STRING_ID   DevicePathId;
@@ -654,11 +655,11 @@ UiListThirdPartyDrivers (
       StartOpCodeHandle,
       0,
       gHiiDriverList[Index].PromptId,
       gHiiDriverList[Index].HelpId,
       0,
-      0,
+      (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_DRIVER),
       0,
       &gHiiDriverList[Index].FormSetGuid,
       gHiiDriverList[Index].DevicePathId
     );
 
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly
  2016-09-08  9:09 [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dandan Bi
  2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
@ 2016-09-09  2:16 ` Dong, Eric
  2016-09-12  2:29 ` Gao, Liming
  2 siblings, 0 replies; 6+ messages in thread
From: Dong, Eric @ 2016-09-09  2:16 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Gao, Liming

Reviewed-by: Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dandan Bi
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly
> 
> This patch is to fix the incorrect logic when handling the "&READONLY" tag
> in <KeywordResp>.
> 1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lower
> case in current codes by mistake.
> 2. The logic in checking the ReadOnly flag is not correct. Whether having
> "&READONLY" tag must be consistent with the result of
> "ExtractReadOnlyFromOpCode" function.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c     | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> index 6682319..10a901f 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> @@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData (
>        goto Done;
>      }
>      StringPtr = NextStringPtr;
> 
>      //
> -    // 5. Find ReadOnly filter.
> +    // 5. Find READONLY tag.
>      //
> -    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&ReadOnly", StrLen (L"&ReadOnly")) == 0) {
> +    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&READONLY", StrLen (L"&READONLY")) == 0) {
>        ReadOnly = TRUE;
> -      StringPtr += StrLen (L"&ReadOnly");
> +      StringPtr += StrLen (L"&READONLY");
>      } else {
>        ReadOnly = FALSE;
>      }
> 
>      //
> @@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData (
> 
>      //
>      // 8. Check the readonly flag.
>      //
>      if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
> +      //
> +      // Extracting readonly flag form opcode and extracting "READONLY" tag form KeywordString should have the same results.
> +      // If not, the input KeywordString must be incorrect, return the error status to caller.
> +      //
> +      *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
> +      Status = EFI_INVALID_PARAMETER;
> +      goto Done;
> +    }
> +    if (ReadOnly) {
>        *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
>        Status = EFI_ACCESS_DENIED;
> -      goto Done;
> +      goto Done;
>      }
> 
>      //
>      // 9. Merge to the MultiKeywordResp string.
>      //
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] MdeModulePkg/UiApp: Fix incorrect question id
  2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
@ 2016-09-09  2:17   ` Dong, Eric
  2016-09-12  2:35   ` Gao, Liming
  1 sibling, 0 replies; 6+ messages in thread
From: Dong, Eric @ 2016-09-09  2:17 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Gao, Liming

Reviewed-by:  Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg/UiApp: Fix incorrect question id
> 
> For a question, its question id can not be zero.
> This patch is to fix the issue that using zero as question id.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> index 93f6e4e..1505ef9 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> @@ -41,10 +41,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
>  #define UI_HII_DRIVER_LIST_SIZE               0x8
> 
>  #define FRONT_PAGE_KEY_CONTINUE               0x1000
>  #define FRONT_PAGE_KEY_RESET                  0x1001
>  #define FRONT_PAGE_KEY_LANGUAGE               0x1002
> +#define FRONT_PAGE_KEY_DRIVER                 0x2000
> 
>  typedef struct {
>    EFI_STRING_ID   PromptId;
>    EFI_STRING_ID   HelpId;
>    EFI_STRING_ID   DevicePathId;
> @@ -654,11 +655,11 @@ UiListThirdPartyDrivers (
>        StartOpCodeHandle,
>        0,
>        gHiiDriverList[Index].PromptId,
>        gHiiDriverList[Index].HelpId,
>        0,
> -      0,
> +      (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_DRIVER),
>        0,
>        &gHiiDriverList[Index].FormSetGuid,
>        gHiiDriverList[Index].DevicePathId
>      );
> 
> --
> 1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly
  2016-09-08  9:09 [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dandan Bi
  2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
  2016-09-09  2:16 ` [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dong, Eric
@ 2016-09-12  2:29 ` Gao, Liming
  2 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2016-09-12  2:29 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Dong, Eric

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Dandan Bi
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag
> in <KeywordResp> correctly
> 
> This patch is to fix the incorrect logic when handling the "&READONLY" tag
> in <KeywordResp>.
> 1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lower
> case in current codes by mistake.
> 2. The logic in checking the ReadOnly flag is not correct. Whether having
> "&READONLY" tag must be consistent with the result of
> "ExtractReadOnlyFromOpCode" function.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c     | 17
> +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> index 6682319..10a901f 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> @@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData (
>        goto Done;
>      }
>      StringPtr = NextStringPtr;
> 
>      //
> -    // 5. Find ReadOnly filter.
> +    // 5. Find READONLY tag.
>      //
> -    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&ReadOnly", StrLen
> (L"&ReadOnly")) == 0) {
> +    if ((StringPtr != NULL) && StrnCmp (StringPtr, L"&READONLY", StrLen
> (L"&READONLY")) == 0) {
>        ReadOnly = TRUE;
> -      StringPtr += StrLen (L"&ReadOnly");
> +      StringPtr += StrLen (L"&READONLY");
>      } else {
>        ReadOnly = FALSE;
>      }
> 
>      //
> @@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData (
> 
>      //
>      // 8. Check the readonly flag.
>      //
>      if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
> +      //
> +      // Extracting readonly flag form opcode and extracting "READONLY" tag
> form KeywordString should have the same results.
> +      // If not, the input KeywordString must be incorrect, return the error
> status to caller.
> +      //
> +      *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
> +      Status = EFI_INVALID_PARAMETER;
> +      goto Done;
> +    }
> +    if (ReadOnly) {
>        *ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
>        Status = EFI_ACCESS_DENIED;
> -      goto Done;
> +      goto Done;
>      }
> 
>      //
>      // 9. Merge to the MultiKeywordResp string.
>      //
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] MdeModulePkg/UiApp: Fix incorrect question id
  2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
  2016-09-09  2:17   ` Dong, Eric
@ 2016-09-12  2:35   ` Gao, Liming
  1 sibling, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2016-09-12  2:35 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Dong, Eric

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Dong, Eric <eric.dong@intel.com>
> Subject: [patch] MdeModulePkg/UiApp: Fix incorrect question id
> 
> For a question, its question id can not be zero.
> This patch is to fix the issue that using zero as question id.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 3
> ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git
> a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> index 93f6e4e..1505ef9 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> +++
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> @@ -41,10 +41,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF
> ANY KIND, EITHER EXPRESS OR IMPLIED.
>  #define UI_HII_DRIVER_LIST_SIZE               0x8
> 
>  #define FRONT_PAGE_KEY_CONTINUE               0x1000
>  #define FRONT_PAGE_KEY_RESET                  0x1001
>  #define FRONT_PAGE_KEY_LANGUAGE               0x1002
> +#define FRONT_PAGE_KEY_DRIVER                 0x2000
> 
>  typedef struct {
>    EFI_STRING_ID   PromptId;
>    EFI_STRING_ID   HelpId;
>    EFI_STRING_ID   DevicePathId;
> @@ -654,11 +655,11 @@ UiListThirdPartyDrivers (
>        StartOpCodeHandle,
>        0,
>        gHiiDriverList[Index].PromptId,
>        gHiiDriverList[Index].HelpId,
>        0,
> -      0,
> +      (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_DRIVER),
>        0,
>        &gHiiDriverList[Index].FormSetGuid,
>        gHiiDriverList[Index].DevicePathId
>      );
> 
> --
> 1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-12  2:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-08  9:09 [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dandan Bi
2016-09-08  9:09 ` [patch] MdeModulePkg/UiApp: Fix incorrect question id Dandan Bi
2016-09-09  2:17   ` Dong, Eric
2016-09-12  2:35   ` Gao, Liming
2016-09-09  2:16 ` [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctly Dong, Eric
2016-09-12  2:29 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox