[if gte mso 9]>

Re: [edk2] Vfr.vfr Question with Regard to "text"

Subject: Re: [edk2] Vfr.vfr Question with Regard to "text"

From: "Dong, Eric" <eric.dong@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2014-07-07 13:17:41



I agree for the action opcode, vfrcompiler not use the 2nd text statement. I will update the vfrcompiler to report a warning info for the 2nd text statement for a action opcode, it will give user a warning info instead of brake current build.




From: Tim Lewis [mailto:tim.lewis@insyde.com]
Sent: Saturday, July 05, 2014 3:47 PM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] Vfr.vfr Question with Regard to "text"


In DriverSampleDxe’s vfr.vfr, there is the following text statement:



      help   = STRING_TOKEN(0x0053),

      text   = STRING_TOKEN(0x0053),

        text   = STRING_TOKEN(0x0053),

      flags  = INTERACTIVE,  

      key    = 0x1237;


Notice that (a) this has the INTERACTIVE flag set (making it an ACTION opcode) but (b) it also has a 2nd “text” statement.


As far as I can tell, this should be illegal. Here is the corresponding statement in VfrSyntax.g:


                                                            CIfrAction AObj;

                                                            mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId);

                                                            AObj.SetLineNo (F->getLine());

                                                            AObj.SetQuestionId (QId);

                                                            AObj.SetPrompt (_STOSID(S2->getText()));

                                                            AObj.SetHelp (_STOSID(S1->getText()));

                                                            _PCATCH(AObj.SetFlags (Flags), F->getLine());

                                                            AssignQuestionKey (AObj, KN);

                                                            CRT_END_OP (KN);


You can see the basic question header being created but there is no reference to the 2nd text. Here, on the other hand, is the code for the EFI_IFR_TEXT, which does use the 2nd text item.


                                                            CIfrText TObj;

                                                            TObj.SetLineNo (T->getLine());

                                                            TObj.SetHelp (_STOSID(S1->getText()));

                                                            TObj.SetPrompt (_STOSID(S2->getText()));

                                                            TObj.SetTextTwo (TxtTwo);


In my opinion, the 2nd text item should generate an error with VfrCompile, because it will not and cannot ever be used for a “text” statement that has the INTERACTIVE flag set.