Clarify that the shared variables of the shell protocols are properly named.

This removes the non-shared gEfiShellProtocol and gEfiShellParametersProtocol and renames the shared version to those names.

This removes the m-versions of those protocol pointers.

signed-off-by: jcarsey
reviewed-by: darylm503

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11900 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-06-27 21:04:22 +00:00
parent 92a5447eda
commit 366f81a016
7 changed files with 66 additions and 90 deletions

View File

@ -32,8 +32,6 @@
// //
// The extern global protocol poionters. // The extern global protocol poionters.
// //
extern EFI_SHELL_PROTOCOL *gEfiShellProtocol;
extern EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation; extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;
extern EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText; extern EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText;
extern CONST CHAR16* SupportLevel[]; extern CONST CHAR16* SupportLevel[];

View File

@ -27,8 +27,8 @@
// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes) // (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)
#define MAX_FILE_NAME_LEN 512 #define MAX_FILE_NAME_LEN 512
extern EFI_SHELL_PARAMETERS_PROTOCOL *mEfiShellParametersProtocol; extern EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
extern EFI_SHELL_PROTOCOL *mEfiShellProtocol; extern EFI_SHELL_PROTOCOL *gEfiShellProtocol;
/** /**
This function will retrieve the information about the file for the handle This function will retrieve the information about the file for the handle

View File

@ -34,8 +34,6 @@ STATIC UINTN mBlkMaxCount = 0;
STATIC BUFFER_LIST mFileHandleList; STATIC BUFFER_LIST mFileHandleList;
// global variables required by library class. // global variables required by library class.
EFI_SHELL_PROTOCOL *gEfiShellProtocol = NULL;
EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol = NULL;
EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL; EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL;
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText = NULL; EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText = NULL;
SHELL_MAP_LIST gShellMapList; SHELL_MAP_LIST gShellMapList;
@ -59,24 +57,6 @@ CommandInit(
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
if (gEfiShellParametersProtocol == NULL) {
Status = gBS->OpenProtocol(gImageHandle,
&gEfiShellParametersProtocolGuid,
(VOID **)&gEfiShellParametersProtocol,
gImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR(Status)) {
return (EFI_DEVICE_ERROR);
}
}
if (gEfiShellProtocol == NULL) {
Status = gBS->LocateProtocol(&gEfiShellProtocolGuid, NULL, (VOID**)&gEfiShellProtocol);
if (EFI_ERROR(Status)) {
return (EFI_DEVICE_ERROR);
}
}
if (gUnicodeCollation == NULL) { if (gUnicodeCollation == NULL) {
Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID**)&gUnicodeCollation); Status = gBS->LocateProtocol(&gEfiUnicodeCollation2ProtocolGuid, NULL, (VOID**)&gUnicodeCollation);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
@ -207,8 +187,6 @@ ShellCommandLibDestructor (
FreePool(mProfileList); FreePool(mProfileList);
} }
gEfiShellProtocol = NULL;
gEfiShellParametersProtocol = NULL;
gUnicodeCollation = NULL; gUnicodeCollation = NULL;
gDevPathToText = NULL; gDevPathToText = NULL;
gShellCurDir = NULL; gShellCurDir = NULL;

View File

@ -287,7 +287,7 @@ BcfgAddDebug1(
// //
// get the device path // get the device path
// //
DevicePath = mEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName); DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
if (DevicePath == NULL) { if (DevicePath == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellDebug1HiiHandle, Arg->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellDebug1HiiHandle, Arg->FullName);
ShellStatus = SHELL_UNSUPPORTED; ShellStatus = SHELL_UNSUPPORTED;

View File

@ -179,16 +179,16 @@ ShellCommandRunDblk (
// //
// do the work if we have a valid block identifier // do the work if we have a valid block identifier
// //
if (mEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) { if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
DevPath = (EFI_DEVICE_PATH_PROTOCOL*)mEfiShellProtocol->GetDevicePathFromMap(BlockName); DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName);
if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) { if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, BlockName, L"BlockIo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, BlockName, L"BlockIo");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ShellStatus = DisplayTheBlocks(mEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount); ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount);
} }
} }
} }

View File

@ -287,7 +287,7 @@ BcfgAddInstall1(
// //
// get the device path // get the device path
// //
DevicePath = mEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName); DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
if (DevicePath == NULL) { if (DevicePath == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellInstall1HiiHandle, Arg->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellInstall1HiiHandle, Arg->FullName);
ShellStatus = SHELL_UNSUPPORTED; ShellStatus = SHELL_UNSUPPORTED;

View File

@ -30,8 +30,8 @@ SHELL_PARAM_ITEM SfoParamList[] = {
}; };
EFI_SHELL_ENVIRONMENT2 *mEfiShellEnvironment2; EFI_SHELL_ENVIRONMENT2 *mEfiShellEnvironment2;
EFI_SHELL_INTERFACE *mEfiShellInterface; EFI_SHELL_INTERFACE *mEfiShellInterface;
EFI_SHELL_PROTOCOL *mEfiShellProtocol; EFI_SHELL_PROTOCOL *gEfiShellProtocol;
EFI_SHELL_PARAMETERS_PROTOCOL *mEfiShellParametersProtocol; EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
EFI_HANDLE mEfiShellEnvironment2Handle; EFI_HANDLE mEfiShellEnvironment2Handle;
FILE_HANDLE_FUNCTION_MAP FileFunctionMap; FILE_HANDLE_FUNCTION_MAP FileFunctionMap;
@ -182,7 +182,7 @@ ShellLibConstructorWorker (
Status = gBS->OpenProtocol( Status = gBS->OpenProtocol(
ImageHandle, ImageHandle,
&gEfiShellProtocolGuid, &gEfiShellProtocolGuid,
(VOID **)&mEfiShellProtocol, (VOID **)&gEfiShellProtocol,
ImageHandle, ImageHandle,
NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
@ -194,25 +194,25 @@ ShellLibConstructorWorker (
Status = gBS->LocateProtocol( Status = gBS->LocateProtocol(
&gEfiShellProtocolGuid, &gEfiShellProtocolGuid,
NULL, NULL,
(VOID **)&mEfiShellProtocol (VOID **)&gEfiShellProtocol
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
mEfiShellProtocol = NULL; gEfiShellProtocol = NULL;
} }
} }
Status = gBS->OpenProtocol( Status = gBS->OpenProtocol(
ImageHandle, ImageHandle,
&gEfiShellParametersProtocolGuid, &gEfiShellParametersProtocolGuid,
(VOID **)&mEfiShellParametersProtocol, (VOID **)&gEfiShellParametersProtocol,
ImageHandle, ImageHandle,
NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
mEfiShellParametersProtocol = NULL; gEfiShellParametersProtocol = NULL;
} }
if (mEfiShellParametersProtocol == NULL || mEfiShellProtocol == NULL) { if (gEfiShellParametersProtocol == NULL || gEfiShellProtocol == NULL) {
// //
// Moved to seperate function due to complexity // Moved to seperate function due to complexity
// //
@ -238,18 +238,18 @@ ShellLibConstructorWorker (
// only success getting 2 of either the old or new, but no 1/2 and 1/2 // only success getting 2 of either the old or new, but no 1/2 and 1/2
// //
if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) || if ((mEfiShellEnvironment2 != NULL && mEfiShellInterface != NULL) ||
(mEfiShellProtocol != NULL && mEfiShellParametersProtocol != NULL) ) { (gEfiShellProtocol != NULL && gEfiShellParametersProtocol != NULL) ) {
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
FileFunctionMap.GetFileInfo = mEfiShellProtocol->GetFileInfo; FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
FileFunctionMap.SetFileInfo = mEfiShellProtocol->SetFileInfo; FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
FileFunctionMap.ReadFile = mEfiShellProtocol->ReadFile; FileFunctionMap.ReadFile = gEfiShellProtocol->ReadFile;
FileFunctionMap.WriteFile = mEfiShellProtocol->WriteFile; FileFunctionMap.WriteFile = gEfiShellProtocol->WriteFile;
FileFunctionMap.CloseFile = mEfiShellProtocol->CloseFile; FileFunctionMap.CloseFile = gEfiShellProtocol->CloseFile;
FileFunctionMap.DeleteFile = mEfiShellProtocol->DeleteFile; FileFunctionMap.DeleteFile = gEfiShellProtocol->DeleteFile;
FileFunctionMap.GetFilePosition = mEfiShellProtocol->GetFilePosition; FileFunctionMap.GetFilePosition = gEfiShellProtocol->GetFilePosition;
FileFunctionMap.SetFilePosition = mEfiShellProtocol->SetFilePosition; FileFunctionMap.SetFilePosition = gEfiShellProtocol->SetFilePosition;
FileFunctionMap.FlushFile = mEfiShellProtocol->FlushFile; FileFunctionMap.FlushFile = gEfiShellProtocol->FlushFile;
FileFunctionMap.GetFileSize = mEfiShellProtocol->GetFileSize; FileFunctionMap.GetFileSize = gEfiShellProtocol->GetFileSize;
} else { } else {
FileFunctionMap.GetFileInfo = (EFI_SHELL_GET_FILE_INFO)FileHandleGetInfo; FileFunctionMap.GetFileInfo = (EFI_SHELL_GET_FILE_INFO)FileHandleGetInfo;
FileFunctionMap.SetFileInfo = (EFI_SHELL_SET_FILE_INFO)FileHandleSetInfo; FileFunctionMap.SetFileInfo = (EFI_SHELL_SET_FILE_INFO)FileHandleSetInfo;
@ -285,8 +285,8 @@ ShellLibConstructor (
) )
{ {
mEfiShellEnvironment2 = NULL; mEfiShellEnvironment2 = NULL;
mEfiShellProtocol = NULL; gEfiShellProtocol = NULL;
mEfiShellParametersProtocol = NULL; gEfiShellParametersProtocol = NULL;
mEfiShellInterface = NULL; mEfiShellInterface = NULL;
mEfiShellEnvironment2Handle = NULL; mEfiShellEnvironment2Handle = NULL;
@ -330,19 +330,19 @@ ShellLibDestructor (
NULL); NULL);
mEfiShellInterface = NULL; mEfiShellInterface = NULL;
} }
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
gBS->CloseProtocol(ImageHandle, gBS->CloseProtocol(ImageHandle,
&gEfiShellProtocolGuid, &gEfiShellProtocolGuid,
ImageHandle, ImageHandle,
NULL); NULL);
mEfiShellProtocol = NULL; gEfiShellProtocol = NULL;
} }
if (mEfiShellParametersProtocol != NULL) { if (gEfiShellParametersProtocol != NULL) {
gBS->CloseProtocol(ImageHandle, gBS->CloseProtocol(ImageHandle,
&gEfiShellParametersProtocolGuid, &gEfiShellParametersProtocolGuid,
ImageHandle, ImageHandle,
NULL); NULL);
mEfiShellParametersProtocol = NULL; gEfiShellParametersProtocol = NULL;
} }
mEfiShellEnvironment2Handle = NULL; mEfiShellEnvironment2Handle = NULL;
@ -490,11 +490,11 @@ ShellOpenFileByDevicePath(
// //
// which shell interface should we use // which shell interface should we use
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// use UEFI Shell 2.0 method. // use UEFI Shell 2.0 method.
// //
FileName = mEfiShellProtocol->GetFilePathFromDevicePath(*FilePath); FileName = gEfiShellProtocol->GetFilePathFromDevicePath(*FilePath);
if (FileName == NULL) { if (FileName == NULL) {
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
@ -646,14 +646,14 @@ ShellOpenFileByName(
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
if ((OpenMode & EFI_FILE_MODE_CREATE) == EFI_FILE_MODE_CREATE && (Attributes & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { if ((OpenMode & EFI_FILE_MODE_CREATE) == EFI_FILE_MODE_CREATE && (Attributes & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
return ShellCreateDirectory(FileName, FileHandle); return ShellCreateDirectory(FileName, FileHandle);
} }
// //
// Use UEFI Shell 2.0 method // Use UEFI Shell 2.0 method
// //
Status = mEfiShellProtocol->OpenFileByName(FileName, Status = gEfiShellProtocol->OpenFileByName(FileName,
FileHandle, FileHandle,
OpenMode); OpenMode);
if (StrCmp(FileName, L"NUL") != 0 && !EFI_ERROR(Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)){ if (StrCmp(FileName, L"NUL") != 0 && !EFI_ERROR(Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)){
@ -716,11 +716,11 @@ ShellCreateDirectory(
OUT SHELL_FILE_HANDLE *FileHandle OUT SHELL_FILE_HANDLE *FileHandle
) )
{ {
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// Use UEFI Shell 2.0 method // Use UEFI Shell 2.0 method
// //
return (mEfiShellProtocol->CreateFile(DirectoryName, return (gEfiShellProtocol->CreateFile(DirectoryName,
EFI_FILE_DIRECTORY, EFI_FILE_DIRECTORY,
FileHandle FileHandle
)); ));
@ -1031,12 +1031,12 @@ ShellGetExecutionBreakFlag(
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// We are using UEFI Shell 2.0; see if the event has been triggered // We are using UEFI Shell 2.0; see if the event has been triggered
// //
if (gBS->CheckEvent(mEfiShellProtocol->ExecutionBreak) != EFI_SUCCESS) { if (gBS->CheckEvent(gEfiShellProtocol->ExecutionBreak) != EFI_SUCCESS) {
return (FALSE); return (FALSE);
} }
return (TRUE); return (TRUE);
@ -1071,8 +1071,8 @@ ShellGetEnvironmentVariable (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
return (mEfiShellProtocol->GetEnv(EnvKey)); return (gEfiShellProtocol->GetEnv(EnvKey));
} }
// //
@ -1115,8 +1115,8 @@ ShellSetEnvironmentVariable (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
return (mEfiShellProtocol->SetEnv(EnvKey, EnvVal, Volatile)); return (gEfiShellProtocol->SetEnv(EnvKey, EnvVal, Volatile));
} }
// //
@ -1168,11 +1168,11 @@ ShellExecute (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// Call UEFI Shell 2.0 version (not using Output parameter) // Call UEFI Shell 2.0 version (not using Output parameter)
// //
return (mEfiShellProtocol->Execute(ParentHandle, return (gEfiShellProtocol->Execute(ParentHandle,
CommandLine, CommandLine,
EnvironmentVariables, EnvironmentVariables,
Status)); Status));
@ -1214,8 +1214,8 @@ ShellGetCurrentDir (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
return (mEfiShellProtocol->GetCurDir(DeviceName)); return (gEfiShellProtocol->GetCurDir(DeviceName));
} }
// //
@ -1248,11 +1248,11 @@ ShellSetPageBreakMode (
// //
// check for UEFI Shell 2.0 // check for UEFI Shell 2.0
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// Enable with UEFI 2.0 Shell // Enable with UEFI 2.0 Shell
// //
mEfiShellProtocol->EnablePageBreak(); gEfiShellProtocol->EnablePageBreak();
return; return;
} else { } else {
// //
@ -1270,11 +1270,11 @@ ShellSetPageBreakMode (
// //
// check for UEFI Shell 2.0 // check for UEFI Shell 2.0
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
// //
// Disable with UEFI 2.0 Shell // Disable with UEFI 2.0 Shell
// //
mEfiShellProtocol->DisablePageBreak(); gEfiShellProtocol->DisablePageBreak();
return; return;
} else { } else {
// //
@ -1445,7 +1445,7 @@ ShellOpenFileMetaArg (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
if (*ListHead == NULL) { if (*ListHead == NULL) {
*ListHead = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO)); *ListHead = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
if (*ListHead == NULL) { if (*ListHead == NULL) {
@ -1453,13 +1453,13 @@ ShellOpenFileMetaArg (
} }
InitializeListHead(&((*ListHead)->Link)); InitializeListHead(&((*ListHead)->Link));
} }
Status = mEfiShellProtocol->OpenFileList(Arg, Status = gEfiShellProtocol->OpenFileList(Arg,
OpenMode, OpenMode,
ListHead); ListHead);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
mEfiShellProtocol->RemoveDupInFileList(ListHead); gEfiShellProtocol->RemoveDupInFileList(ListHead);
} else { } else {
Status = mEfiShellProtocol->RemoveDupInFileList(ListHead); Status = gEfiShellProtocol->RemoveDupInFileList(ListHead);
} }
if (*ListHead != NULL && IsListEmpty(&(*ListHead)->Link)) { if (*ListHead != NULL && IsListEmpty(&(*ListHead)->Link)) {
FreePool(*ListHead); FreePool(*ListHead);
@ -1540,8 +1540,8 @@ ShellCloseFileMetaArg (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
return (mEfiShellProtocol->FreeFileList(ListHead)); return (gEfiShellProtocol->FreeFileList(ListHead));
} else if (mEfiShellEnvironment2 != NULL) { } else if (mEfiShellEnvironment2 != NULL) {
// //
// Since this is EFI Shell version we need to free our internally made copy // Since this is EFI Shell version we need to free our internally made copy
@ -2099,13 +2099,13 @@ ShellCommandLineParseEx (
// //
// Check for UEFI Shell 2.0 protocols // Check for UEFI Shell 2.0 protocols
// //
if (mEfiShellParametersProtocol != NULL) { if (gEfiShellParametersProtocol != NULL) {
return (InternalCommandLineParse(CheckList, return (InternalCommandLineParse(CheckList,
CheckPackage, CheckPackage,
ProblemParam, ProblemParam,
AutoPageBreak, AutoPageBreak,
(CONST CHAR16**) mEfiShellParametersProtocol->Argv, (CONST CHAR16**) gEfiShellParametersProtocol->Argv,
mEfiShellParametersProtocol->Argc, gEfiShellParametersProtocol->Argc,
AlwaysAllowNumbers)); AlwaysAllowNumbers));
} }
@ -2557,8 +2557,8 @@ InternalPrintTo (
if (Size == 0) { if (Size == 0) {
return (EFI_SUCCESS); return (EFI_SUCCESS);
} }
if (mEfiShellParametersProtocol != NULL) { if (gEfiShellParametersProtocol != NULL) {
return (mEfiShellProtocol->WriteFile(mEfiShellParametersProtocol->StdOut, &Size, (VOID*)String)); return (gEfiShellProtocol->WriteFile(gEfiShellParametersProtocol->StdOut, &Size, (VOID*)String));
} }
if (mEfiShellInterface != NULL) { if (mEfiShellInterface != NULL) {
// //
@ -2859,13 +2859,13 @@ ShellIsDirectory(
// //
// try good logic first. // try good logic first.
// //
if (mEfiShellProtocol != NULL) { if (gEfiShellProtocol != NULL) {
TempLocation = StrnCatGrow(&TempLocation, NULL, DirName, 0); TempLocation = StrnCatGrow(&TempLocation, NULL, DirName, 0);
TempLocation2 = StrStr(TempLocation, L":"); TempLocation2 = StrStr(TempLocation, L":");
if (TempLocation2 != NULL && StrLen(StrStr(TempLocation, L":")) == 2) { if (TempLocation2 != NULL && StrLen(StrStr(TempLocation, L":")) == 2) {
*(TempLocation2+1) = CHAR_NULL; *(TempLocation2+1) = CHAR_NULL;
} }
if (mEfiShellProtocol->GetDevicePathFromMap(TempLocation) != NULL) { if (gEfiShellProtocol->GetDevicePathFromMap(TempLocation) != NULL) {
FreePool(TempLocation); FreePool(TempLocation);
return (EFI_SUCCESS); return (EFI_SUCCESS);
} }