/** @file
Main file for SetVar shell Debug1 function.
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UefiShellDebug1CommandsLib.h"
{L"-guid", TypeValue},
{L"-bs", TypeFlag},
{L"-rt", TypeFlag},
{L"-nv", TypeFlag},
};
/**
Function for 'setvar' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
)
{
Size = 0;
Attributes = 0;
//
// initialize the shell lib (we must be in non-auto-init...)
//
Status = ShellInitialize();
Status = CommandInit();
//
// parse the command line
//
} else {
}
} else {
} else {
} else {
}
}
//
// Display what's there
//
if (Status == EFI_BUFFER_TOO_SMALL) {
}
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_PRINT), gShellDebug1HiiHandle, &Guid, VariableName, Size);
}
} else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_GET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
}
//
// Delete what's there!
//
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
} else {
}
} else {
if (Data[0] == L'=') {
Data++;
}
//
// Change what's there
//
}
}
}
} else {
//
// arbitrary buffer
//
} else {
}
}
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
} else {
}
}
Size = 0;
Attributes2 = 0;
if (Status == EFI_BUFFER_TOO_SMALL) {
}
//
// ascii text
//
Data++;
} else {
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, AsciiStrSize(Buffer)-sizeof(CHAR8), Buffer);
}
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
} else {
}
//
// ucs2 text
//
Data++;
Data++;
} else {
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, StrSize(Buffer)-sizeof(CHAR16), Buffer);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
} else {
}
}
//
// device path in text format
//
Data++;
Data++;
} else {
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, GetDevicePathSize(DevPath), DevPath);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
} else {
}
}
} else {
}
}
}
}
}
}
return (ShellStatus);
}