summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-12 21:55:07 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-12 21:55:07 +0000
commit6878e7a7be6a29da75fca61ba42681fc64a3fdf3 (patch)
treeb4b4e4df7635d4c1da30ad3b6ae0cc2e4d87970a /ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
parenteaf4f336ea42dc32e1a5b31d6b7822c125a15d34 (diff)
downloadedk2-platforms-6878e7a7be6a29da75fca61ba42681fc64a3fdf3.tar.xz
update Bcfg to correctly remove by option index not variable name and add driver order items properly.
update connect and reconnect to account for ignoring the child handle in the connect operation. update disconnect to output correctly. hexedit corrected to properly display status bar and title bar and refresh when required. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11525 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c')
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
index e4e780a437..429964d8c8 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
@@ -277,7 +277,8 @@ ShellCommandRunConnect (
//
// if more than 2 'value' parameters (plus the name one) or either -r or -c with any value parameters we have too many parameters
//
- if ((ShellCommandLineGetCount(Package) > 3)
+ Count = (gInReconnect?0x4:0x3);
+ if ((ShellCommandLineGetCount(Package) > Count)
||((ShellCommandLineGetFlag(Package, L"-r") || ShellCommandLineGetFlag(Package, L"-c")) && ShellCommandLineGetCount(Package)>1)
||(ShellCommandLineGetFlag(Package, L"-r") && ShellCommandLineGetFlag(Package, L"-c") )
){
@@ -328,17 +329,26 @@ ShellCommandRunConnect (
Param2 = ShellCommandLineGetRawValue(Package, 2);
Count = ShellCommandLineGetCount(Package);
- Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
- Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
+ if (Param1 != NULL) {
+ Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
+ Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param1);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ }
+ } else {
+ Handle1 = NULL;
}
- Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE);
- Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
- ShellStatus = SHELL_INVALID_PARAMETER;
+
+ if (Param2 != NULL) {
+ Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE);
+ Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, Param2);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ }
+ } else {
+ Handle2 = NULL;
}
if (ShellStatus == SHELL_SUCCESS) {