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>
This commit is contained in:
@ -215,7 +215,7 @@ ShellLibConstructorWorker (
|
|||||||
gEfiShellParametersProtocol = NULL;
|
gEfiShellParametersProtocol = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gEfiShellParametersProtocol == NULL || gEfiShellProtocol == NULL) {
|
if (gEfiShellProtocol == NULL) {
|
||||||
//
|
//
|
||||||
// Moved to seperate function due to complexity
|
// 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) ||
|
if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) ||
|
||||||
(gEfiShellProtocol != NULL && gEfiShellParametersProtocol != NULL) ) {
|
(gEfiShellProtocol != NULL)
|
||||||
|
) {
|
||||||
if (gEfiShellProtocol != NULL) {
|
if (gEfiShellProtocol != NULL) {
|
||||||
FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
|
FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
|
||||||
FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
|
FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
|
||||||
|
Reference in New Issue
Block a user