diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2017-11-24 16:01:41 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2017-11-28 13:22:34 +0800 |
commit | 3d29f8c5e361525a0d2accfa7f5bb0a7210b8927 (patch) | |
tree | 0a8c015d5100516063127a4d7848b4eba8768b7f /ShellPkg/Library | |
parent | 646127c1929a606a1a5709d78f06f2dd5494b397 (diff) | |
download | edk2-3d29f8c5e361525a0d2accfa7f5bb0a7210b8927.tar.gz |
ShellPkg/ShellLib: Constructor doesn't depend on ShellParameters
When ShellLib is linked to a driver producing DynamicCommand
protocol, ShellParameters protocol is set by
DynamicCommand.Handler().
The driver image handle doesn't have ShellParameters protocol
installed.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 677791c67f..00f58ca0c1 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -215,7 +215,7 @@ ShellLibConstructorWorker ( gEfiShellParametersProtocol = NULL;
}
- if (gEfiShellParametersProtocol == NULL || gEfiShellProtocol == NULL) {
+ if (gEfiShellProtocol == NULL) {
//
// Moved to seperate function due to complexity
//
@@ -238,10 +238,14 @@ ShellLibConstructorWorker ( }
//
- // only success getting 2 of either the old or new, but no 1/2 and 1/2
+ // Getting either EDK Shell's ShellEnvironment2 and ShellInterface protocol
+ // or UEFI Shell's Shell protocol.
+ // When ShellLib is linked to a driver producing DynamicCommand protocol,
+ // ShellParameters protocol is set by DynamicCommand.Handler().
//
- if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) ||
- (gEfiShellProtocol != NULL && gEfiShellParametersProtocol != NULL) ) {
+ if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) ||
+ (gEfiShellProtocol != NULL)
+ ) {
if (gEfiShellProtocol != NULL) {
FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
|