MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / SetLastError

Function SetLastError

ShellPkg/Application/Shell/Shell.c:2290–2305  ·  view source on GitHub ↗

Function to update the shell variable "lasterror". @param[in] ErrorCode the error code to put into lasterror. **/

Source from the content-addressed store, hash-verified

2288 @param[in] ErrorCode the error code to put into lasterror.
2289**/
2290EFI_STATUS
2291SetLastError(
2292 IN CONST SHELL_STATUS ErrorCode
2293 )
2294{
2295 CHAR16 LeString[19];
2296 if (sizeof(EFI_STATUS) == sizeof(UINT64)) {
2297 UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", ErrorCode);
2298 } else {
2299 UnicodeSPrint(LeString, sizeof(LeString), L"0x%x", ErrorCode);
2300 }
2301 DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
2302 InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
2303
2304 return (EFI_SUCCESS);
2305}
2306
2307/**
2308 Converts the command line to it's post-processed form. this replaces variables and alias' per UEFI Shell spec.

Callers 5

IsValidSplitFunction · 0.85
RunInternalCommandFunction · 0.85
RunCommandOrFileFunction · 0.85
RunShellCommandFunction · 0.85
LoadLibraryAFunction · 0.85

Calls 2

InternalEfiShellSetEnvFunction · 0.85
UnicodeSPrintFunction · 0.50

Tested by

no test coverage detected