Function to update the shell variable "lasterror". @param[in] ErrorCode the error code to put into lasterror. **/
| 2288 | @param[in] ErrorCode the error code to put into lasterror. |
| 2289 | **/ |
| 2290 | EFI_STATUS |
| 2291 | SetLastError( |
| 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. |
no test coverage detected