X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FApplication%2FPing6%2FPing6.c;h=f1685f710b1d673bd08ab40c79a7e5a116d0aaa0;hp=596ee3b00744638ad9c843827d9de6843086621d;hb=be6cd654eb27370bfa127dd387846ad983f4ef72;hpb=fa848a4048943251fc057fe8d6c5a82e01d2ffb6 diff --git a/NetworkPkg/Application/Ping6/Ping6.c b/NetworkPkg/Application/Ping6/Ping6.c index 596ee3b007..f1685f710b 100644 --- a/NetworkPkg/Application/Ping6/Ping6.c +++ b/NetworkPkg/Application/Ping6/Ping6.c @@ -1,7 +1,7 @@ /** @file The implementation for Ping6 application. - Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -42,10 +43,6 @@ SHELL_PARAM_ITEM Ping6ParamList[] = { L"-s", TypeValue }, - { - L"-?", - TypeFlag - }, { NULL, TypeMax @@ -1059,11 +1056,36 @@ InitializePing6 ( CONST CHAR16 *ValueStr; CONST CHAR16 *ValueStrPtr; UINTN NonOptionCount; + EFI_HII_PACKAGE_LIST_HEADER *PackageList; // - // Register our string package with HII and return the handle to it. + // Retrieve HII package list from ImageHandle // - mHiiHandle = HiiAddPackages (&gEfiCallerIdGuid, ImageHandle, Ping6Strings, NULL); + Status = gBS->OpenProtocol ( + ImageHandle, + &gEfiHiiPackageListProtocolGuid, + (VOID **) &PackageList, + ImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Publish HII package list to HII Database. + // + Status = gHiiDatabase->NewPackageList ( + gHiiDatabase, + PackageList, + NULL, + &mHiiHandle + ); + if (EFI_ERROR (Status)) { + return Status; + } + ASSERT (mHiiHandle != NULL); Status = ShellCommandLineParseEx (Ping6ParamList, &ParamPackage, NULL, TRUE, FALSE); @@ -1072,11 +1094,6 @@ InitializePing6 ( goto ON_EXIT; } - if (ShellCommandLineGetFlag (ParamPackage, L"-?")) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_HELP), mHiiHandle); - goto ON_EXIT; - } - SendNumber = 10; BufferSize = 16;