/** @file
Main file for attrib shell level 2 function.
Copyright (c) 2009 - 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 "UefiShellLevel2CommandsLib.h"
// This function was from from the BdsLib implementation in
// IntelFrameworkModulePkg\Library\GenericBdsLib\BdsConnect.c
// function name: BdsLibConnectAllEfi
/**
This function will connect all current system handles recursively. The
connection will finish until every handle's child handle created if it have.
@retval EFI_SUCCESS All handles and it's child handle have been
connected
@retval EFI_STATUS Return the status of gBS->LocateHandleBuffer().
**/
)
{
NULL,
NULL,
);
return Status;
}
}
if (HandleBuffer != NULL) {
}
return EFI_SUCCESS;
}
/**
function to load a .EFI driver into memory and possible connect the driver.
if FileName is NULL then ASSERT.
@param[in] FileName FileName of the driver to load
@param[in] Connect Whether to connect or not
@retval EFI_SUCCESS the driver was loaded and if Connect was
true then connect was attempted. Connection may
have failed.
@retval EFI_OUT_OF_RESOURCES there was insufficient memory
**/
)
{
//
// Fix local copies of the protocol pointers
//
Status = CommandInit();
//
// Convert to DEVICE_PATH
//
return (EFI_INVALID_PARAMETER);
}
//
// Use LoadImage to get it into memory
//
NULL,
0,
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_NOT_IMAGE), gShellLevel2HiiHandle, FileName, Status);
} else {
//
// Make sure it is a driver image
//
Status = gBS->HandleProtocol (LoadedDriverHandle, &gEfiLoadedImageProtocolGuid, (VOID *) &LoadedDriverImage);
){
//
// Exit and unload the non-driver image
//
}
}
//
// Start the image
//
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_ERROR), gShellLevel2HiiHandle, FileName, Status);
} else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_LOADED), gShellLevel2HiiHandle, FileName, LoadedDriverImage->ImageBase, Status);
}
}
//
// Connect it...
//
Status = ConnectAllEfi();
}
//
// clean up memory...
//
}
return (Status);
}
{L"-nc", TypeFlag},
};
/**
Function for 'load' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
)
{
ProblemParam = NULL;
//
// initialize the shell lib (we must be in non-auto-init...)
//
Status = ShellInitialize();
//
// parse the command line
//
} else {
}
} else {
//
// check for "-?"
//
//
// we didnt get a single file to load parameter
//
} else {
for ( ParamCount = 1
; ParamCount++
){
Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount), EFI_FILE_MODE_READ, &ListHead);
){
//
// once we have an error preserve that value, but finish the loop.
//
} else {
}
} // for loop for multi-open
} else {
}
} else {
//
// no files found.
//
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, (CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount));
}
} // for loop for params
}
//
// free the command line package
//
}
}
return (ShellStatus);
}