您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ HiiAllocateOpCodeHandle函数代码示例

51自学网 2021-06-01 21:26:11
  C++
这篇教程C++ HiiAllocateOpCodeHandle函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中HiiAllocateOpCodeHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ HiiAllocateOpCodeHandle函数的具体用法?C++ HiiAllocateOpCodeHandle怎么用?C++ HiiAllocateOpCodeHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了HiiAllocateOpCodeHandle函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CreateUpdateData

/** Create the global UpdateData structure.**/VOIDCreateUpdateData (  VOID  ){  //  // Init OpCode Handle and Allocate space for creation of Buffer  //  mStartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (mStartOpCodeHandle != NULL);    mEndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (mEndOpCodeHandle != NULL);    //  // Create Hii Extend Label OpCode as the start opcode  //  mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mStartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;    //  // Create Hii Extend Label OpCode as the end opcode  //  mEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mEndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mEndLabel->Number       = LABEL_END;}
开发者ID:wensunshine,项目名称:VisualUefi,代码行数:31,


示例2: UpdateFrontPageForm

/**  Update the menus in the front page.**/VOIDUpdateFrontPageForm (  VOID  ){  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  EFI_IFR_GUID_LABEL          *StartGuidLabel;  EFI_IFR_GUID_LABEL          *EndGuidLabel;  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartGuidLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartGuidLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartGuidLabel->Number       = LABEL_FRANTPAGE_INFORMATION;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndGuidLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndGuidLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndGuidLabel->Number       = LABEL_END;  //  //Updata Front Page form  //  UiCustomizeFrontPage (    gFrontPagePrivate.HiiHandle,    StartOpCodeHandle    );  HiiUpdateForm (    gFrontPagePrivate.HiiHandle,    &mFrontPageGuid,    FRONT_PAGE_FORM_ID,    StartOpCodeHandle,    EndOpCodeHandle    );  HiiFreeOpCodeHandle (StartOpCodeHandle);  HiiFreeOpCodeHandle (EndOpCodeHandle);}
开发者ID:pmj,项目名称:edk2,代码行数:55,


示例3: CustomizeMenus

/**  Update the menus in the BMM page.**/VOIDCustomizeMenus (  VOID  ){  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  EFI_IFR_GUID_LABEL          *StartGuidLabel;  EFI_IFR_GUID_LABEL          *EndGuidLabel;  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartGuidLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartGuidLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartGuidLabel->Number       = LABEL_FORM_MAIN_START;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndGuidLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndGuidLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndGuidLabel->Number       = LABEL_FORM_MAIN_END;  //  //Updata Front Page form  //  UiCustomizeBMMPage (    mBmmCallbackInfo->BmmHiiHandle,    StartOpCodeHandle    );  HiiUpdateForm (    mBmmCallbackInfo->BmmHiiHandle,    &mBootMaintGuid,    FORM_MAIN_ID,    StartOpCodeHandle,    EndOpCodeHandle    );  HiiFreeOpCodeHandle (StartOpCodeHandle);  HiiFreeOpCodeHandle (EndOpCodeHandle);}
开发者ID:agileinsider,项目名称:edk2,代码行数:55,


示例4: RefreshLegacyUpdateData

/**  Refresh the global UpdateData structure.**/VOIDRefreshLegacyUpdateData (  VOID  ){  //  // Free current updated date  //  if (mLegacyStartOpCodeHandle != NULL) {    HiiFreeOpCodeHandle (mLegacyStartOpCodeHandle);  }  if (mLegacyEndOpCodeHandle != NULL) {    HiiFreeOpCodeHandle (mLegacyEndOpCodeHandle);  }  //  // Create new OpCode Handle  //  mLegacyStartOpCodeHandle = HiiAllocateOpCodeHandle ();  mLegacyEndOpCodeHandle = HiiAllocateOpCodeHandle ();  //  // Create Hii Extend Label OpCode as the start opcode  //  mLegacyStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                         mLegacyStartOpCodeHandle,                                         &gEfiIfrTianoGuid,                                         NULL,                                         sizeof (EFI_IFR_GUID_LABEL)                                         );  mLegacyStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mLegacyStartLabel->Number = FORM_BOOT_LEGACY_DEVICE_ID;  //  // Create Hii Extend Label OpCode as the start opcode  //  mLegacyEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                         mLegacyEndOpCodeHandle,                                         &gEfiIfrTianoGuid,                                         NULL,                                         sizeof (EFI_IFR_GUID_LABEL)                                         );  mLegacyEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mLegacyEndLabel->Number = FORM_BOOT_LEGACY_LABEL_END;}
开发者ID:FrozenXZeus,项目名称:edk2,代码行数:52,


示例5: RefreshUpdateData

/**  Refresh the global UpdateData structure.**/VOIDRefreshUpdateData (  VOID  ){  //  // Free current updated date  //  if (mStartOpCodeHandle != NULL) {    HiiFreeOpCodeHandle (mStartOpCodeHandle);  }  //  // Create new OpCode Handle  //  mStartOpCodeHandle = HiiAllocateOpCodeHandle ();  //  // Create Hii Extend Label OpCode as the start opcode  //  mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                         mStartOpCodeHandle,                                         &gEfiIfrTianoGuid,                                         NULL,                                         sizeof (EFI_IFR_GUID_LABEL)                                         );  mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;}
开发者ID:RafaelRMachado,项目名称:edk2,代码行数:32,


示例6: UpdateTimeOutPage

/**  Create the dynamic page to allow user to set the "TimeOut" value.  @param CallbackData    The BMM context data.**/VOIDUpdateTimeOutPage (  IN BMM_CALLBACK_DATA                *CallbackData  ){  VOID    *DefaultOpCodeHandle;  CallbackData->BmmAskSaveOrNot = TRUE;  UpdatePageStart (CallbackData);  DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (DefaultOpCodeHandle != NULL);  HiiCreateDefaultOpCode (DefaultOpCodeHandle, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_TYPE_NUM_SIZE_16, CallbackData->BmmFakeNvData.BootTimeOut);  HiiCreateNumericOpCode (    mStartOpCodeHandle,    (EFI_QUESTION_ID) BOOT_TIME_OUT_QUESTION_ID,    VARSTORE_ID_BOOT_MAINT,    BOOT_TIME_OUT_VAR_OFFSET,    STRING_TOKEN (STR_NUM_AUTO_BOOT),    STRING_TOKEN (STR_HLP_AUTO_BOOT),    0,    EFI_IFR_NUMERIC_SIZE_2 | EFI_IFR_DISPLAY_UINT_DEC,    0,    65535,    0,    DefaultOpCodeHandle    );    HiiFreeOpCodeHandle (DefaultOpCodeHandle);  UpdatePageEnd (CallbackData);}
开发者ID:wensunshine,项目名称:VisualUefi,代码行数:40,


示例7: LibRefreshUpdateData

/**  Refresh the global UpdateData structure.**/VOIDLibRefreshUpdateData (  VOID  ){  //  // Free current updated date  //  if (mLibStartOpCodeHandle != NULL) {    HiiFreeOpCodeHandle (mLibStartOpCodeHandle);  }  if (mLibEndOpCodeHandle != NULL) {    HiiFreeOpCodeHandle (mLibEndOpCodeHandle);  }  //  // Create new OpCode Handle  //  mLibStartOpCodeHandle = HiiAllocateOpCodeHandle ();  mLibEndOpCodeHandle = HiiAllocateOpCodeHandle ();  //  // Create Hii Extend Label OpCode as the start opcode  //  mLibStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                         mLibStartOpCodeHandle,                                         &gEfiIfrTianoGuid,                                         NULL,                                         sizeof (EFI_IFR_GUID_LABEL)                                         );  mLibStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mLibStartLabel->Number = FORM_FILE_EXPLORER_ID;  //  // Create Hii Extend Label OpCode as the start opcode  //  mLibEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                         mLibEndOpCodeHandle,                                         &gEfiIfrTianoGuid,                                         NULL,                                         sizeof (EFI_IFR_GUID_LABEL)                                         );  mLibEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mLibEndLabel->Number = LABEL_END;}
开发者ID:kraxel,项目名称:edk2,代码行数:51,


示例8: HiiFreeOpCodeHandle

/**  Create a set of "one-of-many" (ie. "drop down list") option IFR opcodes,  based on available GOP resolutions, to be placed under a "one-of-many" (ie.  "drop down list") opcode.  @param[in]  PackageList   The package list with the formset and form for                            which the drop down options are produced. Option                            names are added as new strings to PackageList.  @param[out] OpCodeBuffer  On output, a dynamically allocated opcode buffer                            with drop down list options corresponding to GOP                            resolutions. The caller is responsible for freeing                            OpCodeBuffer with HiiFreeOpCodeHandle() after use.  @param[in]  NumGopModes   Number of entries in GopModes.  @param[in]  GopModes      Array of resolutions retrieved from the GOP.  @retval EFI_SUCESS  Opcodes have been successfully produced.  @return             Status codes from underlying functions. PackageList may                      have been extended with new strings. OpCodeBuffer is                      unchanged.**/STATICEFI_STATUSEFIAPICreateResolutionOptions (  IN  EFI_HII_HANDLE  *PackageList,  OUT VOID            **OpCodeBuffer,  IN  UINTN           NumGopModes,  IN  GOP_MODE        *GopModes  ){  EFI_STATUS Status;  VOID       *OutputBuffer;  UINTN      ModeNumber;  OutputBuffer = HiiAllocateOpCodeHandle ();  if (OutputBuffer == NULL) {    return EFI_OUT_OF_RESOURCES;  }  for (ModeNumber = 0; ModeNumber < NumGopModes; ++ModeNumber) {    CHAR16        Desc[MAXSIZE_RES_CUR];    EFI_STRING_ID NewString;    VOID          *OpCode;    UnicodeSPrintAsciiFormat (Desc, sizeof Desc, "%Ldx%Ld",      (INT64) GopModes[ModeNumber].X, (INT64) GopModes[ModeNumber].Y);    NewString = HiiSetString (PackageList, 0 /* new string */, Desc,                  NULL /* for all languages */);    if (NewString == 0) {      Status = EFI_OUT_OF_RESOURCES;      goto FreeOutputBuffer;    }    OpCode = HiiCreateOneOfOptionOpCode (OutputBuffer, NewString,               0 /* Flags */, EFI_IFR_NUMERIC_SIZE_4, ModeNumber);    if (OpCode == NULL) {      Status = EFI_OUT_OF_RESOURCES;      goto FreeOutputBuffer;    }  }  *OpCodeBuffer = OutputBuffer;  return EFI_SUCCESS;FreeOutputBuffer:  HiiFreeOpCodeHandle (OutputBuffer);  return Status;}
开发者ID:hsienchieh,项目名称:uefilab,代码行数:72,


示例9: UpdateLegacyDeviceOrderPage

//.........这里部分代码省略.........    BbsType     = BBS_CDROM;    Default     = mLegacyBootOptionPrivate->MaintainMapData->CurrentNvData.LegacyCD;    break;  case FORM_NET_BOOT_ID:    OptionMenu  = (LEGACY_MENU_OPTION *) &LegacyNETMenu;    Key         = (UINT16) LEGACY_NET_QUESTION_ID;    TypeStr     = STR_NET;    TypeStrHelp = STR_NET_HELP;    FormTitle   = STR_NET_TITLE;    BbsType     = BBS_EMBED_NETWORK;    Default     = mLegacyBootOptionPrivate->MaintainMapData->CurrentNvData.LegacyNET;    break;  case FORM_BEV_BOOT_ID:    OptionMenu  = (LEGACY_MENU_OPTION *) &LegacyBEVMenu;    Key         = (UINT16) LEGACY_BEV_QUESTION_ID;    TypeStr     = STR_BEV;    TypeStrHelp = STR_BEV_HELP;    FormTitle   = STR_BEV_TITLE;    BbsType     = BBS_BEV_DEVICE;    Default     = mLegacyBootOptionPrivate->MaintainMapData->CurrentNvData.LegacyBEV;    break;  default:    DEBUG ((EFI_D_ERROR, "Invalid command ID for updating page!/n"));    return;  }    HiiSetString (mLegacyBootOptionPrivate->HiiHandle, STRING_TOKEN(STR_ORDER_CHANGE_PROMPT), FormTitle, NULL);  CreateLegacyMenuStringToken (mLegacyBootOptionPrivate->HiiHandle, OptionMenu);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {    NewMenuEntry = GetMenuEntry (OptionMenu, Index);    //    // Create OneOf for each legacy device    //    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      NewMenuEntry->DisplayStringToken,      0,      EFI_IFR_TYPE_NUM_SIZE_16,      ((LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->BbsIndex      );  }  //  // Create OneOf for item "Disabled"  //  HiiCreateOneOfOptionOpCode (    OptionsOpCodeHandle,    STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE),    0,    EFI_IFR_TYPE_NUM_SIZE_16,    0xFF    );  //  // Create oneof tag here for FD/HD/CD #1 #2  //  for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
开发者ID:FrozenXZeus,项目名称:edk2,代码行数:67,


示例10: InitializeDrivers

/**  Create dynamic code for BMM.  @param  BmmCallbackInfo        The BMM context data.**/VOIDInitializeDrivers(  IN BMM_CALLBACK_DATA        *BmmCallbackInfo  ){  EFI_HII_HANDLE              HiiHandle;  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  EFI_IFR_GUID_LABEL          *StartLabel;  EFI_IFR_GUID_LABEL          *EndLabel;  UINTN                       Index;    EFI_STRING_ID               FormSetTitle;  EFI_STRING_ID               FormSetHelp;    EFI_STRING                  String;  EFI_STRING_ID               Token;  EFI_STRING_ID               TokenHelp;    EFI_HII_HANDLE              *HiiHandles;  UINTN                       SkipCount;  EFI_GUID                    FormSetGuid;  CHAR16                      *DevicePathStr;  EFI_STRING_ID               DevicePathId;  HiiHandle = BmmCallbackInfo->BmmHiiHandle;  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number       = LABEL_BMM_PLATFORM_INFORMATION;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number       = LABEL_END;  //  // Get all the Hii handles  //  HiiHandles = HiiGetHiiHandles (NULL);  ASSERT (HiiHandles != NULL);  //  // Search for formset of each class type  //  SkipCount = 0;  for (Index = 0; HiiHandles[Index] != NULL; Index++) {    if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles[Index], &gEfiIfrBootMaintenanceGuid, SkipCount, &FormSetTitle, &FormSetHelp, &FormSetGuid)) {      SkipCount = 0;      continue;    }    String = HiiGetString (HiiHandles[Index], FormSetTitle, NULL);    if (String == NULL) {      String = HiiGetString (HiiHandle, STR_MISSING_STRING, NULL);      ASSERT (String != NULL);    }    Token = HiiSetString (HiiHandle, 0, String, NULL);    FreePool (String);    String = HiiGetString (HiiHandles[Index], FormSetHelp, NULL);    if (String == NULL) {      String = HiiGetString (HiiHandle, STR_MISSING_STRING, NULL);      ASSERT (String != NULL);    }    TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);    FreePool (String);    DevicePathStr = ExtractDevicePathFromHiiHandle(HiiHandles[Index]);    DevicePathId  = 0;    if (DevicePathStr != NULL){      DevicePathId = HiiSetString (HiiHandle, 0, DevicePathStr, NULL);      FreePool (DevicePathStr);    }    HiiCreateGotoExOpCode (      StartOpCodeHandle,      0,      Token,      TokenHelp,      0,      (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_OFFSET),      0,      &FormSetGuid,      DevicePathId//.........这里部分代码省略.........
开发者ID:FrozenXZeus,项目名称:edk2,代码行数:101,


示例11: CallBootManager

/**  This function invokes Boot Manager. If all devices have not a chance to be connected,  the connect all will be triggered. It then enumerate all boot options. If  a boot option from the Boot Manager page is selected, Boot Manager will boot  from this boot option.**/VOIDCallBootManager (    VOID){    EFI_STATUS                  Status;    BDS_COMMON_OPTION           *Option;    LIST_ENTRY                  *Link;    CHAR16                      *ExitData;    UINTN                       ExitDataSize;    EFI_STRING_ID               Token;    EFI_INPUT_KEY               Key;    CHAR16                      *HelpString;    UINTN                       HelpSize;    EFI_STRING_ID               HelpToken;    UINT16                      *TempStr;    EFI_HII_HANDLE              HiiHandle;    EFI_BROWSER_ACTION_REQUEST  ActionRequest;    VOID                        *StartOpCodeHandle;    VOID                        *EndOpCodeHandle;    EFI_IFR_GUID_LABEL          *StartLabel;    EFI_IFR_GUID_LABEL          *EndLabel;    UINT16                      DeviceType;    BOOLEAN                     IsLegacyOption;    BOOLEAN                     NeedEndOp;    DeviceType = (UINT16) -1;    gOption    = NULL;    InitializeListHead (&mBootOptionsList);    //    // Connect all prior to entering the platform setup menu.    //    if (!gConnectAllHappened) {        BdsLibConnectAllDriversToAllControllers ();        gConnectAllHappened = TRUE;    }    BdsLibEnumerateAllBootOption (&mBootOptionsList);    //    // Group the legacy boot options for the same device type    //    GroupMultipleLegacyBootOption4SameType ();    InitializeListHead (&mBootOptionsList);    BdsLibBuildOptionFromVar (&mBootOptionsList, L"BootOrder");    HiiHandle = gBootManagerPrivate.HiiHandle;    //    // Allocate space for creation of UpdateData Buffer    //    StartOpCodeHandle = HiiAllocateOpCodeHandle ();    ASSERT (StartOpCodeHandle != NULL);    EndOpCodeHandle = HiiAllocateOpCodeHandle ();    ASSERT (EndOpCodeHandle != NULL);    //    // Create Hii Extend Label OpCode as the start opcode    //    StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));    StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;    StartLabel->Number       = LABEL_BOOT_OPTION;    //    // Create Hii Extend Label OpCode as the end opcode    //    EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));    EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;    EndLabel->Number       = LABEL_BOOT_OPTION_END;    mKeyInput = 0;    NeedEndOp = FALSE;    for (Link = GetFirstNode (&mBootOptionsList); !IsNull (&mBootOptionsList, Link); Link = GetNextNode (&mBootOptionsList, Link)) {        Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);        //        // At this stage we are creating a menu entry, thus the Keys are reproduceable        //        mKeyInput++;        //        // Don't display the hidden/inactive boot option        //        if (((Option->Attribute & LOAD_OPTION_HIDDEN) != 0) || ((Option->Attribute & LOAD_OPTION_ACTIVE) == 0)) {            continue;        }        //        // Group the legacy boot option in the sub title created dynamically        ////.........这里部分代码省略.........
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:101,


示例12: InitializeFrontPage

/**  Initialize HII information for the FrontPage  @param InitializeHiiData    TRUE if HII elements need to be initialized.  @retval  EFI_SUCCESS        The operation is successful.  @retval  EFI_DEVICE_ERROR   If the dynamic opcode creation failed.**/EFI_STATUSInitializeFrontPage (  IN BOOLEAN                         InitializeHiiData  ){  EFI_STATUS                  Status;  CHAR8                       *LangCode;  CHAR8                       *Lang;  CHAR8                       *CurrentLang;  UINTN                       OptionCount;  CHAR16                      *StringBuffer;  EFI_HII_HANDLE              HiiHandle;  VOID                        *OptionsOpCodeHandle;  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  EFI_IFR_GUID_LABEL          *StartLabel;  EFI_IFR_GUID_LABEL          *EndLabel;  EFI_HII_STRING_PROTOCOL     *HiiString;  UINTN                       StringSize;  Lang         = NULL;  StringBuffer = NULL;  if (InitializeHiiData) {    //    // Initialize the Device Manager    //    InitializeDeviceManager ();    //    // Initialize the Device Manager    //    InitializeBootManager ();    gCallbackKey  = 0;    //    // Locate Hii relative protocols    //    Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &gFormBrowser2);    if (EFI_ERROR (Status)) {      return Status;    }    //    // Install Device Path Protocol and Config Access protocol to driver handle    //    Status = gBS->InstallMultipleProtocolInterfaces (                    &gFrontPagePrivate.DriverHandle,                    &gEfiDevicePathProtocolGuid,                    &mFrontPageHiiVendorDevicePath,                    &gEfiHiiConfigAccessProtocolGuid,                    &gFrontPagePrivate.ConfigAccess,                    NULL                    );    ASSERT_EFI_ERROR (Status);    //    // Publish our HII data    //    gFrontPagePrivate.HiiHandle = HiiAddPackages (                                    &gFrontPageFormSetGuid,                                    gFrontPagePrivate.DriverHandle,                                    FrontPageVfrBin,                                    BdsDxeStrings,                                    NULL                                    );    if (gFrontPagePrivate.HiiHandle == NULL) {      return EFI_OUT_OF_RESOURCES;    }  }  //  // Init OpCode Handle and Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number       = LABEL_SELECT_LANGUAGE;//.........这里部分代码省略.........
开发者ID:OznOg,项目名称:edk2,代码行数:101,


示例13: DriverHealthManagerUpdateForm

/**  Update the form to include the driver health instances.  @param ConfigureOnly  Only include the configure required driver health instances                        when TRUE, include all the driver health instances otherwise.**/VOIDDriverHealthManagerUpdateForm (  BOOLEAN                     ConfigureOnly  ){  EFI_STATUS                  Status;  EFI_IFR_GUID_LABEL          *StartLabel;  EFI_IFR_GUID_LABEL          *EndLabel;  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  UINTN                       Index;  EFI_STRING_ID               Prompt;  EFI_STRING_ID               Help;  CHAR16                      String[512];  UINTN                       StringCount;  EFI_STRING                  TmpString;  EFI_STRING                  DriverName;  EFI_STRING                  ControllerName;  UINTN                       MessageIndex;  EFI_HANDLE                  DriverHandle;  EFI_STRING_ID               DevicePath;  EFI_GUID                    FormsetGuid;  EfiBootManagerFreeDriverHealthInfo (mDriverHealthManagerHealthInfo, mDriverHealthManagerHealthInfoCount);  mDriverHealthManagerHealthInfo = EfiBootManagerGetDriverHealthInfo (&mDriverHealthManagerHealthInfoCount);  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number       = LABEL_BEGIN;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number       = LABEL_END;  for (Index = 0; Index < mDriverHealthManagerHealthInfoCount; Index++) {    if (ConfigureOnly && mDriverHealthManagerHealthInfo[Index].HealthStatus != EfiDriverHealthStatusConfigurationRequired) {      continue;    }    DriverName = DriverHealthManagerGetDriverName (mDriverHealthManagerHealthInfo[Index].DriverHealthHandle);    ASSERT (DriverName != NULL);    if (mDriverHealthManagerHealthInfo[Index].ControllerHandle == NULL) {      //      // The ControllerHandle is set to NULL and the HealthStatus is set to EfiDriverHealthStatusHealthy      // if all the controllers managed by the driver are in healthy state.      //      ASSERT (mDriverHealthManagerHealthInfo[Index].HealthStatus == EfiDriverHealthStatusHealthy);      UnicodeSPrint (String, sizeof (String), L"%s", DriverName);    } else {      ControllerName = DriverHealthManagerGetControllerName (                         mDriverHealthManagerHealthInfo[Index].DriverHealthHandle,                         mDriverHealthManagerHealthInfo[Index].ControllerHandle,                         mDriverHealthManagerHealthInfo[Index].ChildHandle                         );      ASSERT (ControllerName != NULL);      UnicodeSPrint (String, sizeof (String), L"%s    %s", DriverName, ControllerName);      FreePool (ControllerName);    }    FreePool (DriverName);    Prompt = HiiSetString (mDriverHealthManagerHiiHandle, 0, String, NULL);    switch(mDriverHealthManagerHealthInfo[Index].HealthStatus) {    case EfiDriverHealthStatusRepairRequired:      TmpString = HiiGetString (mDriverHealthManagerHiiHandle, STRING_TOKEN (STR_REPAIR_REQUIRED), NULL);      break;    case EfiDriverHealthStatusConfigurationRequired:      TmpString = HiiGetString (mDriverHealthManagerHiiHandle, STRING_TOKEN (STR_CONFIGURATION_REQUIRED), NULL);      break;    case EfiDriverHealthStatusFailed:      TmpString = HiiGetString (mDriverHealthManagerHiiHandle, STRING_TOKEN (STR_FAILED), NULL);      break;    case EfiDriverHealthStatusReconnectRequired:      TmpString = HiiGetString (mDriverHealthManagerHiiHandle, STRING_TOKEN (STR_RECONNECT_REQUIRED), NULL);      break;    case EfiDriverHealthStatusRebootRequired:      TmpString = HiiGetString (mDriverHealthManagerHiiHandle, STRING_TOKEN (STR_REBOOT_REQUIRED), NULL);      break;    default://.........这里部分代码省略.........
开发者ID:M1cha,项目名称:edk2,代码行数:101,


示例14: InitializeBM

//.........这里部分代码省略.........                  NULL                  );  if (EFI_ERROR (Status)) {    goto Exit;  }  //  // Post our Boot Maint VFR binary to the HII database.  //  BmmCallbackInfo->BmmHiiHandle = HiiAddPackages (                                    &gBootMaintFormSetGuid,                                    BmmCallbackInfo->BmmDriverHandle,                                    BmBin,                                    BdsDxeStrings,                                    NULL                                    );  ASSERT (BmmCallbackInfo->BmmHiiHandle != NULL);  //  // Post our File Explorer VFR binary to the HII database.  //  BmmCallbackInfo->FeHiiHandle = HiiAddPackages (                                   &gFileExploreFormSetGuid,                                   BmmCallbackInfo->FeDriverHandle,                                   FEBin,                                   BdsDxeStrings,                                   NULL                                   );  ASSERT (BmmCallbackInfo->FeHiiHandle != NULL);  //  // Init OpCode Handle and Allocate space for creation of Buffer  //  mStartOpCodeHandle = HiiAllocateOpCodeHandle ();  if (mStartOpCodeHandle == NULL) {    Status = EFI_OUT_OF_RESOURCES;    goto Exit;  }  mEndOpCodeHandle = HiiAllocateOpCodeHandle ();  if (mEndOpCodeHandle == NULL) {    Status = EFI_OUT_OF_RESOURCES;    goto Exit;  }  //  // Create Hii Extend Label OpCode as the start opcode  //  mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mStartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  //  // Create Hii Extend Label OpCode as the end opcode  //  mEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mEndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mEndLabel->Number       = LABEL_END;  InitializeStringDepository ();  InitAllMenu (BmmCallbackInfo);  CreateMenuStringToken (BmmCallbackInfo, BmmCallbackInfo->BmmHiiHandle, &ConsoleInpMenu);  CreateMenuStringToken (BmmCallbackInfo, BmmCallbackInfo->BmmHiiHandle, &ConsoleOutMenu);  CreateMenuStringToken (BmmCallbackInfo, BmmCallbackInfo->BmmHiiHandle, &ConsoleErrMenu);  CreateMenuStringToken (BmmCallbackInfo, BmmCallbackInfo->BmmHiiHandle, &BootOptionMenu);
开发者ID:Cutty,项目名称:edk2,代码行数:67,


示例15: SelectUserToDelete

/**  Display user select form, cab select a user to delete.**/VOIDSelectUserToDelete (  VOID  ){  EFI_STATUS              Status;  UINT8                   Index;  EFI_USER_PROFILE_HANDLE User;  EFI_USER_PROFILE_HANDLE CurrentUser;  VOID                    *StartOpCodeHandle;  VOID                    *EndOpCodeHandle;  EFI_IFR_GUID_LABEL      *StartLabel;  EFI_IFR_GUID_LABEL      *EndLabel;  //  // Initialize the container for dynamic opcodes.  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode.  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                        StartOpCodeHandle,                                        &gEfiIfrTianoGuid,                                        NULL,                                        sizeof (EFI_IFR_GUID_LABEL)                                        );  StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number        = LABEL_USER_DEL_FUNC;  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                      EndOpCodeHandle,                                      &gEfiIfrTianoGuid,                                      NULL,                                      sizeof (EFI_IFR_GUID_LABEL)                                      );  EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number        = LABEL_END;  //  // Add each user can be deleted.  //  User  = NULL;  Index = 1;  mUserManager->Current (mUserManager, &CurrentUser);  while (TRUE) {    Status = mUserManager->GetNext (mUserManager, &User);    if (EFI_ERROR (Status)) {      break;    }    if (User != CurrentUser) {      AddUserToForm (        User,        (UINT16)(KEY_DEL_USER | KEY_SELECT_USER | Index),        StartOpCodeHandle        );    }    Index++;  }  HiiUpdateForm (    mCallbackInfo->HiiHandle, // HII handle    &gUserProfileManagerGuid, // Formset GUID    FORMID_DEL_USER,          // Form ID    StartOpCodeHandle,        // Label for where to insert opcodes    EndOpCodeHandle           // Replace data    );  HiiFreeOpCodeHandle (StartOpCodeHandle);  HiiFreeOpCodeHandle (EndOpCodeHandle);}
开发者ID:jeppeter,项目名称:vbox,代码行数:81,


示例16: DisplayLoadPermit

/**  Display the permit load device path in the loadable device path list.**/VOIDDisplayLoadPermit(  VOID  ){  EFI_STATUS          Status;  CHAR16              *Order;  UINTN               OrderSize;  UINTN               ListCount;  UINTN               Index;  UINT8               *Var;  UINT8               *VarPtr;  CHAR16              VarName[12];  VOID                *StartOpCodeHandle;  VOID                *EndOpCodeHandle;  EFI_IFR_GUID_LABEL  *StartLabel;  EFI_IFR_GUID_LABEL  *EndLabel;  //  // Get DriverOrder.  //  OrderSize = 0;  Status    = gRT->GetVariable (                     L"DriverOrder",                      &gEfiGlobalVariableGuid,                      NULL,                      &OrderSize,                      NULL                     );  if (Status != EFI_BUFFER_TOO_SMALL) {    return ;  }  Order = AllocateZeroPool (OrderSize);  if (Order == NULL) {    return ;  }  Status = gRT->GetVariable (                  L"DriverOrder",                   &gEfiGlobalVariableGuid,                   NULL,                   &OrderSize,                   Order                  );  if (EFI_ERROR (Status)) {    return ;  }    //  // Initialize the container for dynamic opcodes.  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode.  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                        StartOpCodeHandle,                                        &gEfiIfrTianoGuid,                                        NULL,                                        sizeof (EFI_IFR_GUID_LABEL)                                        );  StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number        = LABEL_PERMIT_LOAD_FUNC;  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                      EndOpCodeHandle,                                      &gEfiIfrTianoGuid,                                      NULL,                                      sizeof (EFI_IFR_GUID_LABEL)                                      );  EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number        = LABEL_END;  //  // Add each driver option.  //  Var       = NULL;  ListCount = OrderSize / sizeof (UINT16);  for (Index = 0; Index < ListCount; Index++) {    //    // Get driver device path.    //    UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);    Var = GetEfiGlobalVariable (VarName);    if (Var == NULL) {      continue;    }        //    // Check whether the driver is already forbidden.//.........这里部分代码省略.........
开发者ID:etiago,项目名称:vbox,代码行数:101,


示例17: UpdateBootManager

/**  This function invokes Boot Manager. If all devices have not a chance to be connected,  the connect all will be triggered. It then enumerate all boot options. If   a boot option from the Boot Manager page is selected, Boot Manager will boot  from this boot option.  **/VOIDUpdateBootManager (  VOID  ){  UINTN                         Index;  EFI_BOOT_MANAGER_LOAD_OPTION  *BootOption;  UINTN                         BootOptionCount;  EFI_STRING_ID                 Token;  CHAR16                        *HelpString;  EFI_STRING_ID                 HelpToken;  UINT16                        *TempStr;  EFI_HII_HANDLE                HiiHandle;  UINTN                         TempSize;  VOID                          *StartOpCodeHandle;  VOID                          *EndOpCodeHandle;  EFI_IFR_GUID_LABEL            *StartLabel;  EFI_IFR_GUID_LABEL            *EndLabel;  UINT16                        DeviceType;  BOOLEAN                       IsLegacyOption;  BOOLEAN                       NeedEndOp;  UINTN                         MaxLen;  DeviceType = (UINT16) -1;  EfiBootManagerConnectAll ();  //  // for better user experience  // 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option  // 2. User enables/disables UEFI PXE, here we have a chance to add/remove EFI Network boot option  //  EfiBootManagerRefreshAllBootOption ();  //  // BdsDxe doesn't group the legacy boot options for the same device type  // It's UI's choice.  //  GroupMultipleLegacyBootOption4SameType ();  BootOption = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);  HiiHandle = gBootManagerPrivate.HiiHandle;  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number       = LABEL_BOOT_OPTION;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number       = LABEL_BOOT_OPTION_END;  mKeyInput = 0;  NeedEndOp = FALSE;  for (Index = 0; Index < BootOptionCount; Index++) {    //    // At this stage we are creating a menu entry, thus the Keys are reproduceable    //    mKeyInput++;    //    // Don't display the hidden/inactive boot option    //    if (((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || ((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) {      continue;    }    //    // Group the legacy boot option in the sub title created dynamically    //    IsLegacyOption = (BOOLEAN) (                       (DevicePathType (BootOption[Index].FilePath) == BBS_DEVICE_PATH) &&                       (DevicePathSubType (BootOption[Index].FilePath) == BBS_BBS_DP)                       );    if (!IsLegacyOption && NeedEndOp) {      NeedEndOp = FALSE;      HiiCreateEndOpCode (StartOpCodeHandle);    }//.........这里部分代码省略.........
开发者ID:wensunshine,项目名称:VisualUefi,代码行数:101,


示例18: UpdateOrderPage

/**  Update the page's NV Map if user has changed the order  a list. This list can be Boot Order or Driver Order.  @param UpdatePageId    The form ID to be updated.  @param OptionMenu      The new list.  @param CallbackData    The BMM context data.**/VOIDUpdateOrderPage (  IN UINT16                           UpdatePageId,  IN BM_MENU_OPTION                   *OptionMenu,  IN BMM_CALLBACK_DATA                *CallbackData  ){  BM_MENU_ENTRY   *NewMenuEntry;  UINT16          Index;  UINT16          OptionOrderIndex;  VOID            *OptionsOpCodeHandle;  UINTN           DeviceType;  BM_LOAD_CONTEXT *NewLoadContext;  DeviceType                    = (UINTN) -1;  CallbackData->BmmAskSaveOrNot = TRUE;  UpdatePageStart (CallbackData);  CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);  ZeroMem (CallbackData->BmmFakeNvData.OptionOrder, sizeof (CallbackData->BmmFakeNvData.OptionOrder));  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);    for (        Index = 0, OptionOrderIndex = 0;        (          (Index < OptionMenu->MenuNumber) &&          (OptionOrderIndex <            (              sizeof (CallbackData->BmmFakeNvData.OptionOrder) /              sizeof (CallbackData->BmmFakeNvData.OptionOrder[0])            )          )        );        Index++      ) {    NewMenuEntry   = BOpt_GetMenuEntry (OptionMenu, Index);    NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;    if (NewLoadContext->IsLegacy) {      if (((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType != DeviceType) {        DeviceType = ((BBS_BBS_DEVICE_PATH *) NewLoadContext->FilePathList)->DeviceType;      } else {        //        // Only show one legacy boot option for the same device type        // assuming the boot options are grouped by the device type        //        continue;      }    }    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      NewMenuEntry->DisplayStringToken,      0,      EFI_IFR_TYPE_NUM_SIZE_32,      (UINT32) (NewMenuEntry->OptionNumber + 1)      );    CallbackData->BmmFakeNvData.OptionOrder[OptionOrderIndex++] = (UINT32) (NewMenuEntry->OptionNumber + 1);  }  if (OptionMenu->MenuNumber > 0) {    HiiCreateOrderedListOpCode (                         mStartOpCodeHandle,                          // Container for dynamic created opcodes           (EFI_QUESTION_ID) OPTION_ORDER_QUESTION_ID,  // Question ID                                     VARSTORE_ID_BOOT_MAINT,                      // VarStore ID                                     OPTION_ORDER_VAR_OFFSET,                     // Offset in Buffer Storage                        STRING_TOKEN (STR_CHANGE_ORDER),             // Question prompt text                            STRING_TOKEN (STR_CHANGE_ORDER),             // Question help text                              0,                                           // Question flag                                   0,                                           // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET      EFI_IFR_TYPE_NUM_SIZE_32,                    // Data type of Question value                     100,                                         // Maximum container                               OptionsOpCodeHandle,                         // Option Opcode list                              NULL                                         // Default Opcode is NULL                          );  }  HiiFreeOpCodeHandle (OptionsOpCodeHandle);  UpdatePageEnd (CallbackData);  CopyMem (    CallbackData->BmmOldFakeNVData.OptionOrder,    CallbackData->BmmFakeNvData.OptionOrder,    sizeof (CallbackData->BmmOldFakeNVData.OptionOrder)    );}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:99,


示例19: UpdateSetLegacyDeviceOrderPage

//.........这里部分代码省略.........    TypeStrHelp = STR_CDROM_HELP;    BbsType     = BBS_CDROM;    LegacyOrder = CallbackData->BmmFakeNvData.LegacyCD;    OldData     = CallbackData->BmmOldFakeNVData.LegacyCD;    break;  case FORM_SET_NET_ORDER_ID:    OptionMenu  = (BM_MENU_OPTION *) &LegacyNETMenu;    Key         = (UINT16) LEGACY_NET_QUESTION_ID;    TypeStr     = STR_NET;    TypeStrHelp = STR_NET_HELP;    BbsType     = BBS_EMBED_NETWORK;    LegacyOrder = CallbackData->BmmFakeNvData.LegacyNET;    OldData     = CallbackData->BmmOldFakeNVData.LegacyNET;    break;  case FORM_SET_BEV_ORDER_ID:    OptionMenu  = (BM_MENU_OPTION *) &LegacyBEVMenu;    Key         = (UINT16) LEGACY_BEV_QUESTION_ID;    TypeStr     = STR_BEV;    TypeStrHelp = STR_BEV_HELP;    BbsType     = BBS_BEV_DEVICE;    LegacyOrder = CallbackData->BmmFakeNvData.LegacyBEV;    OldData     = CallbackData->BmmOldFakeNVData.LegacyBEV;    break;  default:    DEBUG ((EFI_D_ERROR, "Invalid command ID for updating page!/n"));    return;  }  CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {    NewMenuEntry                = BOpt_GetMenuEntry (OptionMenu, Index);    //    // Create OneOf for each legacy device    //    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      NewMenuEntry->DisplayStringToken,      0,      EFI_IFR_TYPE_NUM_SIZE_8,      (UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->BbsIndex      );  }  //  // Create OneOf for item "Disabled"  //  HiiCreateOneOfOptionOpCode (    OptionsOpCodeHandle,    STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE),    0,    EFI_IFR_TYPE_NUM_SIZE_8,    0xFF    );  //  // Get Device Order from variable  //  VarData = BdsLibGetVariableAndSize (              VAR_LEGACY_DEV_ORDER,
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:67,


示例20: UpdateTerminalPage

/**  Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,  Parity, Stop Bits, Terminal Type.  @param CallbackData    The BMM context data.**/VOIDUpdateTerminalPage (  IN BMM_CALLBACK_DATA                *CallbackData  ){  UINT8               Index;  UINT8               CheckFlags;  BM_MENU_ENTRY       *NewMenuEntry;  BM_TERMINAL_CONTEXT *NewTerminalContext;  VOID                *OptionsOpCodeHandle;  UINTN               CurrentTerminal;  UpdatePageStart (CallbackData);  CurrentTerminal = CallbackData->CurrentTerminal;  NewMenuEntry = BOpt_GetMenuEntry (                  &TerminalMenu,                  CurrentTerminal                  );  if (NewMenuEntry == NULL) {    return ;  }  NewTerminalContext  = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {    CheckFlags = 0;    if (BaudRateList[Index].Value == 115200) {      CheckFlags |= EFI_IFR_OPTION_DEFAULT;    }    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      BaudRateList[Index].StringToken,      CheckFlags,      EFI_IFR_TYPE_NUM_SIZE_8,      Index      );  }  HiiCreateOneOfOpCode (    mStartOpCodeHandle,    (EFI_QUESTION_ID) (COM_BAUD_RATE_QUESTION_ID + CurrentTerminal),    VARSTORE_ID_BOOT_MAINT,    (UINT16) (COM_BAUD_RATE_VAR_OFFSET + CurrentTerminal),    STRING_TOKEN (STR_COM_BAUD_RATE),    STRING_TOKEN (STR_COM_BAUD_RATE),    0,    EFI_IFR_NUMERIC_SIZE_1,    OptionsOpCodeHandle,    NULL    );    HiiFreeOpCodeHandle (OptionsOpCodeHandle);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {    CheckFlags = 0;    if (DataBitsList[Index].Value == 8) {      CheckFlags |= EFI_IFR_OPTION_DEFAULT;    }    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      DataBitsList[Index].StringToken,      CheckFlags,      EFI_IFR_TYPE_NUM_SIZE_8,      Index      );  }  HiiCreateOneOfOpCode (    mStartOpCodeHandle,    (EFI_QUESTION_ID) (COM_DATA_RATE_QUESTION_ID + CurrentTerminal),    VARSTORE_ID_BOOT_MAINT,    (UINT16) (COM_DATA_RATE_VAR_OFFSET + CurrentTerminal),    STRING_TOKEN (STR_COM_DATA_BITS),    STRING_TOKEN (STR_COM_DATA_BITS),    0,    EFI_IFR_NUMERIC_SIZE_1,    OptionsOpCodeHandle,    NULL    );  HiiFreeOpCodeHandle (OptionsOpCodeHandle);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);//.........这里部分代码省略.........
开发者ID:jeyaramvrp,项目名称:edk2,代码行数:101,


示例21: UpdateOrderPage

/**  Update the page's NV Map if user has changed the order  a list. This list can be Boot Order or Driver Order.  @param UpdatePageId    The form ID to be updated.  @param OptionMenu      The new list.  @param CallbackData    The BMM context data.**/VOIDUpdateOrderPage (  IN UINT16                           UpdatePageId,  IN BM_MENU_OPTION                   *OptionMenu,  IN BMM_CALLBACK_DATA                *CallbackData  ){  BM_MENU_ENTRY     *NewMenuEntry;  UINT16            Index;  UINT16            OptionIndex;  VOID              *OptionsOpCodeHandle;  BM_LOAD_CONTEXT   *NewLoadContext;  BOOLEAN           BootOptionFound;  UINT32            *OptionOrder;  EFI_QUESTION_ID   QuestionId;  UINT16            VarOffset;  UpdatePageStart (CallbackData);  CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);    OptionOrder = NULL;  QuestionId = 0;  VarOffset = 0;  switch (UpdatePageId) {   case FORM_BOOT_CHG_ID:    //GetBootOrder (CallbackData);    OptionOrder = CallbackData->BmmFakeNvData.BootOptionOrder;    QuestionId = BOOT_OPTION_ORDER_QUESTION_ID;    VarOffset = BOOT_OPTION_ORDER_VAR_OFFSET;    break;  case FORM_DRV_CHG_ID:    //GetDriverOrder (CallbackData);    OptionOrder = CallbackData->BmmFakeNvData.DriverOptionOrder;    QuestionId = DRIVER_OPTION_ORDER_QUESTION_ID;    VarOffset = DRIVER_OPTION_ORDER_VAR_OFFSET;    break;  }    ASSERT (OptionOrder != NULL);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);    NewMenuEntry = NULL;  for (OptionIndex = 0; (OptionOrder[OptionIndex] != 0 && OptionIndex < MAX_MENU_NUMBER); OptionIndex++) {    BootOptionFound = FALSE;    for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {      NewMenuEntry   = BOpt_GetMenuEntry (OptionMenu, Index);      NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;      if ((UINT32) (NewMenuEntry->OptionNumber + 1) == OptionOrder[OptionIndex]) {        BootOptionFound = TRUE;        break;      }    }    if (BootOptionFound) {      HiiCreateOneOfOptionOpCode (        OptionsOpCodeHandle,        NewMenuEntry->DisplayStringToken,        0,        EFI_IFR_TYPE_NUM_SIZE_32,        OptionOrder[OptionIndex]        );    }  }    if (OptionMenu->MenuNumber > 0) {    HiiCreateOrderedListOpCode (                         mStartOpCodeHandle,                          // Container for dynamic created opcodes           QuestionId,                                  // Question ID                                     VARSTORE_ID_BOOT_MAINT,                      // VarStore ID                                     VarOffset,                                   // Offset in Buffer Storage                        STRING_TOKEN (STR_CHANGE_ORDER),             // Question prompt text                            STRING_TOKEN (STR_CHANGE_ORDER),             // Question help text                              0,                                           // Question flag                                   0,                                           // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET      EFI_IFR_TYPE_NUM_SIZE_32,                    // Data type of Question value                     100,                                         // Maximum container                               OptionsOpCodeHandle,                         // Option Opcode list                              NULL                                         // Default Opcode is NULL                          );  }  HiiFreeOpCodeHandle (OptionsOpCodeHandle);  UpdatePageEnd (CallbackData);}
开发者ID:jeyaramvrp,项目名称:edk2,代码行数:98,


示例22: InitBootMaintenance

//.........这里部分代码省略.........  BmmCallbackInfo->LoadContext = (BM_LOAD_CONTEXT *) Ptr;  Ptr += sizeof (BM_LOAD_CONTEXT);  BmmCallbackInfo->FileContext = (BM_FILE_CONTEXT *) Ptr;  Ptr += sizeof (BM_FILE_CONTEXT);  BmmCallbackInfo->HandleContext = (BM_HANDLE_CONTEXT *) Ptr;  Ptr += sizeof (BM_HANDLE_CONTEXT);  BmmCallbackInfo->MenuEntry     = (BM_MENU_ENTRY *) Ptr;  BmmCallbackInfo->Signature                     = BMM_CALLBACK_DATA_SIGNATURE;  BmmCallbackInfo->BmmConfigAccess.ExtractConfig = BootMaintExtractConfig;  BmmCallbackInfo->BmmConfigAccess.RouteConfig   = BootMaintRouteConfig;  BmmCallbackInfo->BmmConfigAccess.Callback      = BootMaintCallback;  BmmCallbackInfo->BmmPreviousPageId             = FORM_MAIN_ID;  BmmCallbackInfo->BmmCurrentPageId              = FORM_MAIN_ID;  BmmCallbackInfo->FeConfigAccess.ExtractConfig  = FakeExtractConfig;  BmmCallbackInfo->FeConfigAccess.RouteConfig    = FakeRouteConfig;  BmmCallbackInfo->FeConfigAccess.Callback       = FileExplorerCallback;  BmmCallbackInfo->FeCurrentState                = FileExplorerStateInActive;  BmmCallbackInfo->FeDisplayContext              = FileExplorerDisplayUnknown;  //  // Install Device Path Protocol and Config Access protocol to driver handle  //  Status = gBS->InstallMultipleProtocolInterfaces (                  &BmmCallbackInfo->BmmDriverHandle,                  &gEfiDevicePathProtocolGuid,                  &mBmmHiiVendorDevicePath,                  &gEfiHiiConfigAccessProtocolGuid,                  &BmmCallbackInfo->BmmConfigAccess,                  NULL                  );  ASSERT_EFI_ERROR (Status);  //  // Install Device Path Protocol and Config Access protocol to driver handle  //  Status = gBS->InstallMultipleProtocolInterfaces (                  &BmmCallbackInfo->FeDriverHandle,                  &gEfiDevicePathProtocolGuid,                  &mFeHiiVendorDevicePath,                  &gEfiHiiConfigAccessProtocolGuid,                  &BmmCallbackInfo->FeConfigAccess,                  NULL                  );  ASSERT_EFI_ERROR (Status);  //  // Post our Boot Maint VFR binary to the HII database.  //  BmmCallbackInfo->BmmHiiHandle = HiiAddPackages (                                    &mBootMaintGuid,                                    BmmCallbackInfo->BmmDriverHandle,                                    BmBin,                                    UiAppStrings,                                    NULL                                    );  ASSERT (BmmCallbackInfo->BmmHiiHandle != NULL);  //  // Post our File Explorer VFR binary to the HII database.  //  BmmCallbackInfo->FeHiiHandle = HiiAddPackages (                                   &mFileExplorerGuid,                                   BmmCallbackInfo->FeDriverHandle,                                   FEBin,                                   UiAppStrings,                                   NULL                                   );  ASSERT (BmmCallbackInfo->FeHiiHandle != NULL);  //  // Init OpCode Handle and Allocate space for creation of Buffer  //  mStartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (mStartOpCodeHandle != NULL);  mEndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (mEndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mStartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  //  // Create Hii Extend Label OpCode as the end opcode  //  mEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mEndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  mEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  mEndLabel->Number       = LABEL_END;  mBmmCallbackInfo = BmmCallbackInfo;  InitializeStringDepository ();}
开发者ID:FrozenXZeus,项目名称:edk2,代码行数:101,


示例23: CreateDeviceManagerForm

/**  Dynamic create Hii information for Device Manager.  @param   NextShowFormId     The FormId which need to be show.**/VOIDCreateDeviceManagerForm(  IN EFI_FORM_ID      NextShowFormId){  UINTN                       Index;  EFI_STRING                  String;  EFI_STRING_ID               Token;  EFI_STRING_ID               TokenHelp;  EFI_HII_HANDLE              *HiiHandles;  EFI_HII_HANDLE              HiiHandle;  EFI_GUID                    FormSetGuid;  VOID                        *StartOpCodeHandle;  VOID                        *EndOpCodeHandle;  EFI_IFR_GUID_LABEL          *StartLabel;  EFI_IFR_GUID_LABEL          *EndLabel;  BOOLEAN                     AddNetworkMenu;  UINTN                       AddItemCount;  UINTN                       NewStringLen;  EFI_STRING                  NewStringTitle;  CHAR16                      *DevicePathStr;  EFI_STRING_ID               DevicePathId;  EFI_IFR_FORM_SET            *Buffer;        UINTN                       BufferSize;     UINT8                       ClassGuidNum;   EFI_GUID                    *ClassGuid;     UINTN                       TempSize;  UINT8                       *Ptr;  EFI_STATUS                  Status;  TempSize =0;  BufferSize = 0;  Buffer = NULL;  HiiHandle = gDeviceManagerPrivate.HiiHandle;  AddNetworkMenu = FALSE;  AddItemCount = 0;  //  // If need show the Network device list form, clear the old save list first.  //  if ((NextShowFormId == NETWORK_DEVICE_LIST_FORM_ID) && (mMacDeviceList.CurListLen > 0)) {    mMacDeviceList.CurListLen = 0;  }  //  // Update the network device form titile.  //  if (NextShowFormId == NETWORK_DEVICE_FORM_ID) {    String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL);    NewStringLen = StrLen(mSelectedMacAddrString) * 2;    NewStringLen += (StrLen(String) + 2) * 2;    NewStringTitle = AllocatePool (NewStringLen);    UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString);    HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL);        FreePool (String);    FreePool (NewStringTitle);  }  //  // Allocate space for creation of UpdateData Buffer  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  //  // According to the next show Form id(mNextShowFormId) to decide which form need to update.  //  StartLabel->Number       = (UINT16) (LABEL_FORM_ID_OFFSET + NextShowFormId);  //  // Create Hii Extend Label OpCode as the end opcode  //  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number       = LABEL_END;  //  // Get all the Hii handles  //  HiiHandles = HiiGetHiiHandles (NULL);  ASSERT (HiiHandles != NULL);  //  // Search for formset of each class type  //  for (Index = 0; HiiHandles[Index] != NULL; Index++) {//.........这里部分代码省略.........
开发者ID:wensunshine,项目名称:VisualUefi,代码行数:101,


示例24: UiCreateLanguageMenu

/**  Create Select language menu in the front page with oneof opcode.  @param[in]    HiiHandle           The hii handle for the Uiapp driver.  @param[in]    StartOpCodeHandle   The opcode handle to save the new opcode.**/VOIDUiCreateLanguageMenu (  IN EFI_HII_HANDLE              HiiHandle,  IN VOID                        *StartOpCodeHandle  ){  CHAR8                       *LangCode;  CHAR8                       *Lang;  UINTN                       LangSize;  CHAR8                       *CurrentLang;  UINTN                       OptionCount;  CHAR16                      *StringBuffer;  VOID                        *OptionsOpCodeHandle;  UINTN                       StringSize;  EFI_STATUS                  Status;  EFI_HII_STRING_PROTOCOL     *HiiString;  Lang         = NULL;  StringBuffer = NULL;  //  // Init OpCode Handle and Allocate space for creation of UpdateData Buffer  //  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&CurrentLang, NULL);  //  // Get Support language list from variable.  //  GetEfiGlobalVariable2 (L"PlatformLangCodes", (VOID**)&gLanguageString, NULL);  if (gLanguageString == NULL) {    gLanguageString = AllocateCopyPool (                               AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),                               (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)                               );    ASSERT (gLanguageString != NULL);  }  if (gLanguageToken == NULL) {    //    // Count the language list number.    //    LangCode = gLanguageString;    Lang = AllocatePool (AsciiStrSize (gLanguageString));    ASSERT (Lang != NULL);    OptionCount = 0;    while (*LangCode != 0) {      GetNextLanguage (&LangCode, Lang);      OptionCount ++;    }    //    // Allocate extra 1 as the end tag.    //    gLanguageToken = AllocateZeroPool ((OptionCount + 1) * sizeof (EFI_STRING_ID));    ASSERT (gLanguageToken != NULL);    Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString);    ASSERT_EFI_ERROR (Status);    LangCode     = gLanguageString;    OptionCount  = 0;    while (*LangCode != 0) {      GetNextLanguage (&LangCode, Lang);      StringSize = 0;      Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);      if (Status == EFI_BUFFER_TOO_SMALL) {        StringBuffer = AllocateZeroPool (StringSize);        ASSERT (StringBuffer != NULL);        Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);        ASSERT_EFI_ERROR (Status);      }      if (EFI_ERROR (Status)) {        LangSize = AsciiStrSize (Lang);        StringBuffer = AllocatePool (LangSize * sizeof (CHAR16));        ASSERT (StringBuffer != NULL);        AsciiStrToUnicodeStrS (Lang, StringBuffer, LangSize);      }      ASSERT (StringBuffer != NULL);      gLanguageToken[OptionCount] = HiiSetString (HiiHandle, 0, StringBuffer, NULL);      FreePool (StringBuffer);      OptionCount++;    }  }  ASSERT (gLanguageToken != NULL);//.........这里部分代码省略.........
开发者ID:MattDevo,项目名称:edk2,代码行数:101,


示例25: UpdateBootNextPage

/**  Create the dynamic page to allow user to set  the "BootNext" value.  @param CallbackData    The BMM context data.**/VOIDUpdateBootNextPage (  IN BMM_CALLBACK_DATA                *CallbackData  ){  BM_MENU_ENTRY   *NewMenuEntry;  BM_LOAD_CONTEXT *NewLoadContext;  UINTN           NumberOfOptions;  UINT16          Index;  VOID            *OptionsOpCodeHandle;  NumberOfOptions               = BootOptionMenu.MenuNumber;  CallbackData->BmmAskSaveOrNot = TRUE;  UpdatePageStart (CallbackData);  CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);  if (NumberOfOptions > 0) {    OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();    ASSERT (OptionsOpCodeHandle != NULL);    CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);    for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {      NewMenuEntry    = BOpt_GetMenuEntry (&BootOptionMenu, Index);      NewLoadContext  = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;      if (NewLoadContext->IsBootNext) {        HiiCreateOneOfOptionOpCode (          OptionsOpCodeHandle,          NewMenuEntry->DisplayStringToken,          EFI_IFR_OPTION_DEFAULT,          EFI_IFR_TYPE_NUM_SIZE_16,          Index          );        CallbackData->BmmFakeNvData.BootNext = Index;      } else {        HiiCreateOneOfOptionOpCode (          OptionsOpCodeHandle,          NewMenuEntry->DisplayStringToken,          0,          EFI_IFR_TYPE_NUM_SIZE_16,          Index          );      }    }    if (CallbackData->BmmFakeNvData.BootNext == Index) {      HiiCreateOneOfOptionOpCode (        OptionsOpCodeHandle,        STRING_TOKEN (STR_NONE),        EFI_IFR_OPTION_DEFAULT,        EFI_IFR_TYPE_NUM_SIZE_16,        Index        );    } else {      HiiCreateOneOfOptionOpCode (        OptionsOpCodeHandle,        STRING_TOKEN (STR_NONE),        0,        EFI_IFR_TYPE_NUM_SIZE_16,        Index        );    }          HiiCreateOneOfOpCode (      mStartOpCodeHandle,      (EFI_QUESTION_ID) BOOT_NEXT_QUESTION_ID,      VARSTORE_ID_BOOT_MAINT,      BOOT_NEXT_VAR_OFFSET,      STRING_TOKEN (STR_BOOT_NEXT),      STRING_TOKEN (STR_BOOT_NEXT_HELP),      0,      EFI_IFR_NUMERIC_SIZE_2,      OptionsOpCodeHandle,      NULL      );    HiiFreeOpCodeHandle (OptionsOpCodeHandle);  }  UpdatePageEnd (CallbackData);}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:90,


示例26: the

/**  Populate the form identified by the (PackageList, FormSetGuid, FormId)  triplet.  The drop down list of video resolutions is generated from (NumGopModes,  GopModes).  @retval EFI_SUCESS  Form successfully updated.  @return             Status codes from underlying functions.**/STATICEFI_STATUSEFIAPIPopulateForm (  IN  EFI_HII_HANDLE  *PackageList,  IN  EFI_GUID        *FormSetGuid,  IN  EFI_FORM_ID     FormId,  IN  UINTN           NumGopModes,  IN  GOP_MODE        *GopModes  ){  EFI_STATUS         Status;  VOID               *OpCodeBuffer;  VOID               *OpCode;  EFI_IFR_GUID_LABEL *Anchor;  VOID               *OpCodeBuffer2;  OpCodeBuffer2 = NULL;  //  // 1. Allocate an empty opcode buffer.  //  OpCodeBuffer = HiiAllocateOpCodeHandle ();  if (OpCodeBuffer == NULL) {    return EFI_OUT_OF_RESOURCES;  }  //  // 2. Create a label opcode (which is a Tiano extension) inside the buffer.  // The label's number must match the "anchor" label in the form.  //  OpCode = HiiCreateGuidOpCode (OpCodeBuffer, &gEfiIfrTianoGuid,             NULL /* optional copy origin */, sizeof *Anchor);  if (OpCode == NULL) {    Status = EFI_OUT_OF_RESOURCES;    goto FreeOpCodeBuffer;  }  Anchor               = OpCode;  Anchor->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  Anchor->Number       = LABEL_RES_NEXT;  //  // 3. Create the opcodes inside the buffer that are to be inserted into the  // form.  //  // 3.1. Get a list of resolutions.  //  Status = CreateResolutionOptions (PackageList, &OpCodeBuffer2,             NumGopModes, GopModes);  if (EFI_ERROR (Status)) {    goto FreeOpCodeBuffer;  }  //  // 3.2. Create a one-of-many question with the above options.  //  OpCode = HiiCreateOneOfOpCode (             OpCodeBuffer,                        // create opcode inside this                                                  //   opcode buffer,             QUESTION_RES_NEXT,                   // ID of question,             FORMSTATEID_MAIN_FORM,               // identifies form state                                                  //   storage,             (UINT16) OFFSET_OF (MAIN_FORM_STATE, // value of question stored                        NextPreferredResolution), //   at this offset,             STRING_TOKEN (STR_RES_NEXT),         // Prompt,             STRING_TOKEN (STR_RES_NEXT_HELP),    // Help,             0,                                   // QuestionFlags,             EFI_IFR_NUMERIC_SIZE_4,              // see sizeof                                                  //   NextPreferredResolution,             OpCodeBuffer2,                       // buffer with possible                                                  //   choices,             NULL                                 // DEFAULT opcodes             );  if (OpCode == NULL) {    Status = EFI_OUT_OF_RESOURCES;    goto FreeOpCodeBuffer2;  }  //  // 4. Update the form with the opcode buffer.  //  Status = HiiUpdateForm (PackageList, FormSetGuid, FormId,             OpCodeBuffer, // buffer with head anchor, and new contents to be                           // inserted at it             NULL          // buffer with tail anchor, for deleting old                           // contents up to it             );FreeOpCodeBuffer2://.........这里部分代码省略.........
开发者ID:hsienchieh,项目名称:uefilab,代码行数:101,


示例27: VlanUpdateForm

/**  This function update VLAN list in the VLAN configuration Form.  @param[in, out]  PrivateData   Points to VLAN configuration private data.**/VOIDVlanUpdateForm (  IN OUT VLAN_CONFIG_PRIVATE_DATA    *PrivateData  ){  EFI_VLAN_CONFIG_PROTOCOL  *VlanConfig;  UINT16                    NumberOfVlan;  UINTN                     Index;  EFI_VLAN_FIND_DATA        *VlanData;  VOID                      *StartOpCodeHandle;  EFI_IFR_GUID_LABEL        *StartLabel;  VOID                      *EndOpCodeHandle;  EFI_IFR_GUID_LABEL        *EndLabel;  CHAR16                    *String;  CHAR16                    VlanStr[30];  CHAR16                    VlanIdStr[6];  UINTN                     DigitalCount;  EFI_STRING_ID             StringId;  //  // Find current VLAN configuration  //  VlanData = NULL;  NumberOfVlan = 0;  VlanConfig = PrivateData->VlanConfig;  VlanConfig->Find (VlanConfig, NULL, &NumberOfVlan, &VlanData);  //  // Update VLAN configuration in PrivateData  //  if (NumberOfVlan > MAX_VLAN_NUMBER) {    NumberOfVlan = MAX_VLAN_NUMBER;  }  PrivateData->NumberOfVlan = NumberOfVlan;  //  // Init OpCode Handle  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode as the start opcode  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                        StartOpCodeHandle,                                        &gEfiIfrTianoGuid,                                        NULL,                                        sizeof (EFI_IFR_GUID_LABEL)                                        );  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number       = LABEL_VLAN_LIST;  //  // Create Hii Extend Label OpCode as the end opcode  //  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                      EndOpCodeHandle,                                      &gEfiIfrTianoGuid,                                      NULL,                                      sizeof (EFI_IFR_GUID_LABEL)                                      );  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number       = LABEL_END;  ZeroMem (PrivateData->VlanId, MAX_VLAN_NUMBER);  for (Index = 0; Index < NumberOfVlan; Index++) {    String = VlanStr;    StrCpy (String, L"  VLAN ID:");    String += 10;    //    // Pad VlanId string up to 4 characters with space    //    DigitalCount = UnicodeValueToString (VlanIdStr, 0, VlanData[Index].VlanId, 5);    SetMem16 (String, (4 - DigitalCount) * sizeof (CHAR16), L' ');    StrCpy (String + 4 - DigitalCount, VlanIdStr);    String += 4;    StrCpy (String, L", Priority:");    String += 11;    String += UnicodeValueToString (String, 0, VlanData[Index].Priority, 4);    *String = 0;    StringId = HiiSetString (PrivateData->HiiHandle, 0, VlanStr, NULL);    ASSERT (StringId != 0);    HiiCreateCheckBoxOpCode (      StartOpCodeHandle,      (EFI_QUESTION_ID) (VLAN_LIST_VAR_OFFSET + Index),      VLAN_CONFIGURATION_VARSTORE_ID,//.........这里部分代码省略.........
开发者ID:ChenFanFnst,项目名称:edk2,代码行数:101,


示例28: UpdateConModePage

/**  Refresh the text mode page.  @param CallbackData    The BMM context data.**/VOIDUpdateConModePage (  IN BMM_CALLBACK_DATA                *CallbackData  ){  UINTN                         Mode;  UINTN                         Index;  UINTN                         Col;  UINTN                         Row;  CHAR16                        ModeString[50];  CHAR16                        *PStr;  UINTN                         MaxMode;  UINTN                         ValidMode;  EFI_STRING_ID                 *ModeToken;  EFI_STATUS                    Status;  VOID                          *OptionsOpCodeHandle;  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *ConOut;  ConOut    = gST->ConOut;  Index     = 0;  ValidMode = 0;  MaxMode   = (UINTN) (ConOut->Mode->MaxMode);  CallbackData->BmmAskSaveOrNot = TRUE;  UpdatePageStart (CallbackData);  //  // Check valid mode  //  for (Mode = 0; Mode < MaxMode; Mode++) {    Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);    if (EFI_ERROR (Status)) {      continue;    }    ValidMode++;  }  if (ValidMode == 0) {    return;  }  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  ModeToken           = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);  ASSERT(ModeToken != NULL);  //  // Determin which mode should be the first entry in menu  //  GetConsoleOutMode (CallbackData);  //  // Build text mode options  //  for (Mode = 0; Mode < MaxMode; Mode++) {    Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);    if (EFI_ERROR (Status)) {      continue;    }        //    // Build mode string Column x Row    //    UnicodeValueToString (ModeString, 0, Col, 0);    PStr = &ModeString[0];    StrnCat (PStr, L" x ", StrLen(L" x ") + 1);    PStr = PStr + StrLen (PStr);    UnicodeValueToString (PStr , 0, Row, 0);    ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);    if (Mode == CallbackData->BmmFakeNvData.ConsoleOutMode) {      HiiCreateOneOfOptionOpCode (        OptionsOpCodeHandle,        ModeToken[Index],        EFI_IFR_OPTION_DEFAULT,        EFI_IFR_TYPE_NUM_SIZE_16,        (UINT16) Mode        );    } else {      HiiCreateOneOfOptionOpCode (        OptionsOpCodeHandle,        ModeToken[Index],        0,        EFI_IFR_TYPE_NUM_SIZE_16,        (UINT16) Mode        );    }    Index++;  }  HiiCreateOneOfOpCode (//.........这里部分代码省略.........
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:101,


示例29: list

/**  Display the forbid load device path list (mAccessInfo.LoadForbid).**/VOIDDisplayLoadForbid (  VOID  ){  UINTN                     Offset;  UINTN                     DPSize;  UINTN                     Index;  EFI_DEVICE_PATH_PROTOCOL  *Dp;  VOID                      *StartOpCodeHandle;  VOID                      *EndOpCodeHandle;  EFI_IFR_GUID_LABEL        *StartLabel;  EFI_IFR_GUID_LABEL        *EndLabel;  //  // Initialize the container for dynamic opcodes.  //  StartOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (StartOpCodeHandle != NULL);  EndOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (EndOpCodeHandle != NULL);  //  // Create Hii Extend Label OpCode.  //  StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                        StartOpCodeHandle,                                        &gEfiIfrTianoGuid,                                        NULL,                                        sizeof (EFI_IFR_GUID_LABEL)                                        );  StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  StartLabel->Number        = LABLE_FORBID_LOAD_FUNC;  EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (                                      EndOpCodeHandle,                                      &gEfiIfrTianoGuid,                                      NULL,                                      sizeof (EFI_IFR_GUID_LABEL)                                      );  EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;  EndLabel->Number        = LABEL_END;  //  // Add each forbid load drivers.  //  Offset  = 0;  Index   = 0;  while (Offset < mAccessInfo.LoadForbidLen) {    Dp      = (EFI_DEVICE_PATH_PROTOCOL *) (mAccessInfo.LoadForbid + Offset);    DPSize  = GetDevicePathSize (Dp);    AddDevicePath (      KEY_MODIFY_USER | KEY_MODIFY_AP_DP | KEY_LOAD_FORBID_MODIFY | Index,      Dp,      StartOpCodeHandle      );    Index++;    Offset += DPSize;  }  HiiUpdateForm (    mCallbackInfo->HiiHandle, // HII handle    &gUserProfileManagerGuid, // Formset GUID    FORMID_FORBID_LOAD_DP,    // Form ID    StartOpCodeHandle,        // Label for where to insert opcodes    EndOpCodeHandle           // Replace data    );  HiiFreeOpCodeHandle (StartOpCodeHandle);  HiiFreeOpCodeHandle (EndOpCodeHandle);}
开发者ID:etiago,项目名称:vbox,代码行数:76,


示例30: UpdateTerminalPage

/**  Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,  Parity, Stop Bits, Terminal Type.  @param CallbackData    The BMM context data.**/VOIDUpdateTerminalPage (  IN BMM_CALLBACK_DATA                *CallbackData  ){  UINT8               Index;  UINT8               CheckFlags;  BM_MENU_ENTRY       *NewMenuEntry;  BM_TERMINAL_CONTEXT *NewTerminalContext;  VOID                *OptionsOpCodeHandle;  CallbackData->BmmAskSaveOrNot = TRUE;  UpdatePageStart (CallbackData);  NewMenuEntry = BOpt_GetMenuEntry (                  &TerminalMenu,                  CallbackData->CurrentTerminal                  );  if (NewMenuEntry == NULL) {    return ;  }  NewTerminalContext  = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {    CheckFlags = 0;    if (NewTerminalContext->BaudRate == (UINT64) (BaudRateList[Index].Value)) {      CheckFlags |= EFI_IFR_OPTION_DEFAULT;      NewTerminalContext->BaudRateIndex         = Index;      CallbackData->BmmFakeNvData.COMBaudRate  = NewTerminalContext->BaudRateIndex;    }    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      BaudRateList[Index].StringToken,      CheckFlags,      EFI_IFR_TYPE_NUM_SIZE_8,      Index      );  }  HiiCreateOneOfOpCode (    mStartOpCodeHandle,    (EFI_QUESTION_ID) COM_BAUD_RATE_QUESTION_ID,    VARSTORE_ID_BOOT_MAINT,    COM_BAUD_RATE_VAR_OFFSET,    STRING_TOKEN (STR_COM_BAUD_RATE),    STRING_TOKEN (STR_COM_BAUD_RATE),    0,    EFI_IFR_NUMERIC_SIZE_1,    OptionsOpCodeHandle,    NULL    );    HiiFreeOpCodeHandle (OptionsOpCodeHandle);  OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();  ASSERT (OptionsOpCodeHandle != NULL);  for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {    CheckFlags = 0;    if (NewTerminalContext->DataBits == DataBitsList[Index].Value) {      NewTerminalContext->DataBitsIndex         = Index;      CallbackData->BmmFakeNvData.COMDataRate  = NewTerminalContext->DataBitsIndex;      CheckFlags |= EFI_IFR_OPTION_DEFAULT;    }    HiiCreateOneOfOptionOpCode (      OptionsOpCodeHandle,      DataBitsList[Index].StringToken,      CheckFlags,      EFI_IFR_TYPE_NUM_SIZE_8,      Index      );  }  HiiCreateOneOfOpCode (    mStartOpCodeHandle,    (EFI_QUESTION_ID) COM_DATA_RATE_QUESTION_ID,    VARSTORE_ID_BOOT_MAINT,    COM_DATA_RATE_VAR_OFFSET,    STRING_TOKEN (STR_COM_DATA_BITS),    STRING_TOKEN (STR_COM_DATA_BITS),    0,    EFI_IFR_NUMERIC_SIZE_1,    OptionsOpCodeHandle,    NULL    );//.........这里部分代码省略.........
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:101,



注:本文中的HiiAllocateOpCodeHandle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ HiiSetString函数代码示例
C++ HiiAddPackages函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。