Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103777
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ConsoleWrappers.c
r58459 r58466 116 116 117 117 /** 118 Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 118 Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 119 119 SHELL_FILE_HANDLE to support redirecting input from a file. 120 120 … … 156 156 ProtocolToReturn->SimpleTextIn.Reset = FileBasedSimpleTextInReset; 157 157 ProtocolToReturn->SimpleTextIn.ReadKeyStroke = FileBasedSimpleTextInReadKeyStroke; 158 158 159 159 Status = gBS->CreateEvent ( 160 160 EVT_NOTIFY_WAIT, … … 171 171 ///@todo possibly also install SimpleTextInputEx on the handle at this point. 172 172 Status = gBS->InstallProtocolInterface( 173 &(ProtocolToReturn->TheHandle), 174 &gEfiSimpleTextInProtocolGuid, 175 EFI_NATIVE_INTERFACE, 173 &(ProtocolToReturn->TheHandle), 174 &gEfiSimpleTextInProtocolGuid, 175 EFI_NATIVE_INTERFACE, 176 176 &(ProtocolToReturn->SimpleTextIn)); 177 177 if (!EFI_ERROR(Status)) { … … 185 185 186 186 /** 187 Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 187 Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 188 188 SHELL_FILE_HANDLE to support redirecting input from a file. 189 189 … … 208 208 209 209 Status1 = gBS->UninstallProtocolInterface( 210 ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle, 211 &gEfiSimpleTextInProtocolGuid, 210 ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle, 211 &gEfiSimpleTextInProtocolGuid, 212 212 &(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->SimpleTextIn)); 213 213 … … 278 278 { 279 279 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol; 280 280 281 281 PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut; 282 282 283 283 // Pass the QueryMode call thru to the original SimpleTextOutProtocol 284 284 return (PassThruProtocol->QueryMode( … … 416 416 417 417 /** 418 Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 418 Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 419 419 SHELL_FILE_HANDLE to support redirecting output from a file. 420 420 … … 469 469 470 470 Status = gBS->InstallProtocolInterface( 471 &(ProtocolToReturn->TheHandle), 472 &gEfiSimpleTextOutProtocolGuid, 473 EFI_NATIVE_INTERFACE, 471 &(ProtocolToReturn->TheHandle), 472 &gEfiSimpleTextOutProtocolGuid, 473 EFI_NATIVE_INTERFACE, 474 474 &(ProtocolToReturn->SimpleTextOut)); 475 475 if (!EFI_ERROR(Status)) { … … 483 483 484 484 /** 485 Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 485 Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 486 486 SHELL_FILE_HANDLE to support redirecting output from a file. 487 487 … … 501 501 } 502 502 Status = gBS->UninstallProtocolInterface( 503 ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, 504 &gEfiSimpleTextOutProtocolGuid, 503 ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, 504 &gEfiSimpleTextOutProtocolGuid, 505 505 &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut)); 506 506 FreePool(SimpleTextOut); -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ConsoleWrappers.h
r58459 r58466 18 18 19 19 /** 20 Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 20 Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 21 21 SHELL_FILE_HANDLE to support redirecting input from a file. 22 22 … … 35 35 36 36 /** 37 Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 37 Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a 38 38 SHELL_FILE_HANDLE to support redirecting input from a file. 39 39 … … 49 49 50 50 /** 51 Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 51 Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 52 52 SHELL_FILE_HANDLE to support redirecting output from a file. 53 53 … … 68 68 69 69 /** 70 Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 70 Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a 71 71 SHELL_FILE_HANDLE to support redirecting output from a file. 72 72 -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/FileHandleWrappers.c
r58459 r58466 19 19 20 20 /** 21 File style interface for console (Open). 22 21 File style interface for console (Open). 22 23 23 @param[in] This Ignored. 24 24 @param[out] NewHandle Ignored. … … 26 26 @param[in] OpenMode Ignored. 27 27 @param[in] Attributes Ignored. 28 28 29 29 @retval EFI_NOT_FOUND 30 30 **/ … … 44 44 /** 45 45 File style interface for console (Close, Delete, & Flush) 46 46 47 47 @param[in] This Ignored. 48 48 49 49 @retval EFI_SUCCESS 50 50 **/ … … 63 63 @param[in] This Ignored. 64 64 @param[out] Position Ignored. 65 65 66 66 @retval EFI_UNSUPPORTED 67 67 **/ … … 78 78 /** 79 79 File style interface for console (SetPosition). 80 80 81 81 @param[in] This Ignored. 82 82 @param[in] Position Ignored. 83 83 84 84 @retval EFI_UNSUPPORTED 85 85 **/ … … 96 96 /** 97 97 File style interface for console (GetInfo). 98 98 99 99 @param[in] This Ignored. 100 100 @param[in] InformationType Ignored. 101 101 @param[in, out] BufferSize Ignored. 102 102 @param[out] Buffer Ignored. 103 103 104 104 @retval EFI_UNSUPPORTED 105 105 **/ … … 118 118 /** 119 119 File style interface for console (SetInfo). 120 120 121 121 @param[in] This Ignored. 122 122 @param[in] InformationType Ignored. 123 123 @param[in] BufferSize Ignored. 124 124 @param[in] Buffer Ignored. 125 125 126 126 @retval EFI_UNSUPPORTED 127 127 **/ … … 142 142 143 143 Writes data to the screen. 144 144 145 145 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 146 146 @param[in, out] BufferSize Size in bytes of Buffer. 147 147 @param[in] Buffer The pointer to the buffer to write. 148 148 149 149 @retval EFI_UNSUPPORTED No output console is supported. 150 150 @return A return value from gST->ConOut->OutputString. … … 167 167 /** 168 168 File style interface for StdIn (Write). 169 169 170 170 @param[in] This Ignored. 171 171 @param[in, out] BufferSize Ignored. 172 172 @param[in] Buffer Ignored. 173 173 174 174 @retval EFI_UNSUPPORTED 175 175 **/ … … 189 189 190 190 Writes error to the error output. 191 191 192 192 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 193 193 @param[in, out] BufferSize Size in bytes of Buffer. 194 194 @param[in] Buffer The pointer to the buffer to write. 195 195 196 196 @return A return value from gST->StdErr->OutputString. 197 197 **/ … … 209 209 /** 210 210 File style interface for console StdOut (Read). 211 211 212 212 @param[in] This Ignored. 213 213 @param[in, out] BufferSize Ignored. 214 214 @param[out] Buffer Ignored. 215 215 216 216 @retval EFI_UNSUPPORTED 217 217 **/ … … 229 229 /** 230 230 File style interface for console StdErr (Read). 231 231 232 232 @param[in] This Ignored. 233 233 @param[in, out] BufferSize Ignored. 234 234 @param[out] Buffer Ignored. 235 235 236 236 @retval EFI_UNSUPPORTED Always. 237 237 **/ … … 249 249 /** 250 250 File style interface for NUL file (Read). 251 251 252 252 @param[in] This Ignored. 253 253 @param[in, out] BufferSize Poiner to 0 upon return. 254 254 @param[out] Buffer Ignored. 255 255 256 256 @retval EFI_SUCCESS Always. 257 257 **/ … … 270 270 /** 271 271 File style interface for NUL file (Write). 272 272 273 273 @param[in] This Ignored. 274 274 @param[in, out] BufferSize Ignored. 275 275 @param[in] Buffer Ignored. 276 276 277 277 @retval EFI_SUCCESS 278 278 **/ … … 940 940 941 941 Frees the memory for this object. 942 942 943 943 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 944 944 945 945 @retval EFI_SUCCESS 946 946 **/ … … 956 956 957 957 // 958 // Most if not all UEFI commands will have an '\r\n' at the end of any output. 959 // Since the output was redirected to a variable, it does not make sense to 958 // Most if not all UEFI commands will have an '\r\n' at the end of any output. 959 // Since the output was redirected to a variable, it does not make sense to 960 960 // keep this. So, before closing, strip the trailing '\r\n' from the variable 961 961 // if it exists. … … 969 969 if (NewBuffer == NULL) { 970 970 return EFI_OUT_OF_RESOURCES; 971 } 971 } 972 972 Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer); 973 973 } 974 974 975 975 if (!EFI_ERROR(Status) && NewBuffer != NULL) { 976 976 977 977 if (StrSize(NewBuffer) > 6) 978 978 { 979 if ((((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 2] == CHAR_LINEFEED) 979 if ((((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 2] == CHAR_LINEFEED) 980 980 && (((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 3] == CHAR_CARRIAGE_RETURN)) { 981 ((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 3] = CHAR_NULL; 981 ((CHAR16*)NewBuffer)[(StrSize(NewBuffer)/2) - 3] = CHAR_NULL; 982 982 } 983 983 984 984 if (IsVolatileEnv(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name)) { 985 985 Status = SHELL_SET_ENVIRONMENT_VARIABLE_V(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, StrSize(NewBuffer), NewBuffer); … … 988 988 } 989 989 } 990 } 991 990 } 991 992 992 SHELL_FREE_NON_NULL(NewBuffer); 993 993 FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This); … … 997 997 /** 998 998 File style interface for Environment Variable (Delete). 999 999 1000 1000 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1001 1001 1002 1002 @retval The return value from FileInterfaceEnvClose(). 1003 1003 **/ … … 1014 1014 /** 1015 1015 File style interface for Environment Variable (Read). 1016 1016 1017 1017 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1018 1018 @param[in, out] BufferSize Size in bytes of Buffer. 1019 1019 @param[out] Buffer The pointer to the buffer to fill. 1020 1020 1021 1021 @retval EFI_SUCCESS The data was read. 1022 1022 **/ … … 1037 1037 /** 1038 1038 File style interface for Volatile Environment Variable (Write). 1039 1039 1040 1040 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1041 1041 @param[in, out] BufferSize Size in bytes of Buffer. 1042 1042 @param[in] Buffer The pointer to the buffer to write. 1043 1043 1044 1044 @retval EFI_SUCCESS The data was read. 1045 1045 **/ … … 1084 1084 /** 1085 1085 File style interface for Non Volatile Environment Variable (Write). 1086 1086 1087 1087 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1088 1088 @param[in, out] BufferSize Size in bytes of Buffer. 1089 1089 @param[in] Buffer The pointer to the buffer to write. 1090 1090 1091 1091 @retval EFI_SUCCESS The data was read. 1092 1092 **/ … … 1169 1169 EnvFileInterface->Delete = FileInterfaceEnvDelete; 1170 1170 EnvFileInterface->Read = FileInterfaceEnvRead; 1171 1171 1172 1172 CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize); 1173 1173 … … 1322 1322 /** 1323 1323 File style interface for Mem (SetPosition). 1324 1324 1325 1325 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1326 1326 @param[out] Position The position to set. 1327 1327 1328 1328 @retval EFI_SUCCESS The position was successfully changed. 1329 1329 @retval EFI_INVALID_PARAMETER The Position was invalid. … … 1346 1346 /** 1347 1347 File style interface for Mem (GetPosition). 1348 1348 1349 1349 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1350 1350 @param[out] Position The pointer to the position. 1351 1351 1352 1352 @retval EFI_SUCCESS The position was retrieved. 1353 **/ 1353 **/ 1354 1354 EFI_STATUS 1355 1355 EFIAPI … … 1365 1365 /** 1366 1366 File style interface for Mem (Write). 1367 1367 1368 1368 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1369 1369 @param[in, out] BufferSize Size in bytes of Buffer. 1370 1370 @param[in] Buffer The pointer to the buffer to write. 1371 1371 1372 1372 @retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources. 1373 1373 @retval EFI_SUCCESS The data was written. … … 1415 1415 /** 1416 1416 File style interface for Mem (Read). 1417 1417 1418 1418 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1419 1419 @param[in, out] BufferSize Size in bytes of Buffer. 1420 1420 @param[in] Buffer The pointer to the buffer to fill. 1421 1421 1422 1422 @retval EFI_SUCCESS The data was read. 1423 1423 **/ … … 1442 1442 1443 1443 Frees all memory associated with this object. 1444 1444 1445 1445 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1446 1446 1447 1447 @retval EFI_SUCCESS The 'file' was closed. 1448 **/ 1448 **/ 1449 1449 EFI_STATUS 1450 1450 EFIAPI … … 1527 1527 @param This Protocol instance pointer. 1528 1528 @param Position Byte position from the start of the file. 1529 1529 1530 1530 @retval EFI_SUCCESS Data was written. 1531 1531 @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open. … … 1547 1547 @param This Protocol instance pointer. 1548 1548 @param Position Byte position from the start of the file. 1549 1549 1550 1550 @retval EFI_SUCCESS Data was written. 1551 1551 @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.. … … 1723 1723 1724 1724 @param This Protocol instance pointer. 1725 1725 1726 1726 @retval EFI_SUCCESS The device was opened. 1727 1727 @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted. … … 1742 1742 /** 1743 1743 File style interface for File (Close). 1744 1744 1745 1745 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1746 1746 1747 1747 @retval EFI_SUCCESS The file was closed. 1748 1748 **/ … … 1762 1762 File style interface for File (Write). 1763 1763 1764 If the file was opened with ASCII mode the data will be processed through 1764 If the file was opened with ASCII mode the data will be processed through 1765 1765 AsciiSPrint before writing. 1766 1766 1767 1767 @param[in] This The pointer to the EFI_FILE_PROTOCOL object. 1768 1768 @param[in, out] BufferSize Size in bytes of Buffer. 1769 1769 @param[in] Buffer The pointer to the buffer to write. 1770 1770 1771 1771 @retval EFI_SUCCESS The data was written. 1772 1772 **/ … … 1805 1805 This will create a new EFI_FILE_PROTOCOL identical to the Templace 1806 1806 except that the new one has Unicode and Ascii knowledge. 1807 1807 1808 1808 @param[in] Template A pointer to the EFI_FILE_PROTOCOL object. 1809 1809 @param[in] Unicode TRUE for UCS-2, FALSE for ASCII. 1810 1810 1811 1811 @return a new EFI_FILE_PROTOCOL object to be used instead of the template. 1812 1812 **/ -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/Shell.c
r58459 r58466 102 102 103 103 /** 104 Parse for the next instance of one string within another string. Can optionally make sure that 104 Parse for the next instance of one string within another string. Can optionally make sure that 105 105 the string was not escaped (^ character) per the shell specification. 106 106 … … 159 159 { 160 160 CONST CHAR16 *Walker; 161 161 162 162 Walker = NULL; 163 163 … … 165 165 ASSERT (EndPercent != NULL); 166 166 ASSERT (BeginPercent < EndPercent); 167 167 168 168 if ((BeginPercent + 1) == EndPercent) { 169 169 return FALSE; … … 212 212 TempSpot = FindFirstCharacter(CmdLine, L"|", L'^'); 213 213 214 if (FirstQuote == NULL || 215 TempSpot == NULL || 216 TempSpot == CHAR_NULL || 214 if (FirstQuote == NULL || 215 TempSpot == NULL || 216 TempSpot == CHAR_NULL || 217 217 FirstQuote > TempSpot 218 218 ) { … … 223 223 if (FirstQuote == NULL || FirstQuote > TempSpot) { 224 224 break; 225 } 225 } 226 226 SecondQuote = FindNextInstance (FirstQuote + 1, L"\"", TRUE); 227 227 if (SecondQuote == NULL) { … … 235 235 TempSpot = FindFirstCharacter(TempSpot + 1, L"|", L'^'); 236 236 continue; 237 } 238 } 239 237 } 238 } 239 240 240 return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)); 241 241 } 242 242 243 243 /** 244 Function to start monitoring for CTRL-S using SimpleTextInputEx. This 244 Function to start monitoring for CTRL-S using SimpleTextInputEx. This 245 245 feature's enabled state was not known when the shell initially launched. 246 246 … … 267 267 if (EFI_ERROR(Status)) { 268 268 ShellPrintHiiEx( 269 -1, 270 -1, 269 -1, 270 -1, 271 271 NULL, 272 272 STRING_TOKEN (STR_SHELL_NO_IN_EX), … … 285 285 NotificationFunction, 286 286 &ShellInfoObject.CtrlSNotifyHandle1); 287 287 288 288 KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; 289 289 if (!EFI_ERROR(Status)) { … … 303 303 NotificationFunction, 304 304 &ShellInfoObject.CtrlSNotifyHandle3); 305 } 305 } 306 306 KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; 307 307 if (!EFI_ERROR(Status)) { … … 1374 1374 continue; 1375 1375 } 1376 1376 1377 1377 if (FirstQuote == NULL || SecondPercent < FirstQuote) { 1378 1378 if (IsValidEnvironmentVariableName(FirstPercent, SecondPercent)) { … … 1515 1515 ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, L"^%", L"%", TRUE, FALSE); 1516 1516 StrnCpy(NewCommandLine1, NewCommandLine2, NewSize/sizeof(CHAR16)-1); 1517 1517 1518 1518 FreePool(NewCommandLine2); 1519 1519 FreePool(ItemTemp); … … 1633 1633 1634 1634 /** 1635 Take the original command line, substitute any variables, free 1635 Take the original command line, substitute any variables, free 1636 1636 the original string, return the modified copy. 1637 1637 … … 1658 1658 1659 1659 /** 1660 Take the original command line, substitute any alias in the first group of space delimited characters, free 1660 Take the original command line, substitute any alias in the first group of space delimited characters, free 1661 1661 the original string, return the modified copy. 1662 1662 … … 1718 1718 SHELL_FREE_NON_NULL(*CmdLine); 1719 1719 SHELL_FREE_NON_NULL(CommandName); 1720 1720 1721 1721 // 1722 1722 // re-assign the passed in double pointer to point to our newly allocated buffer … … 1731 1731 1732 1732 @param[in] CmdName pointer to the command line to update. 1733 1733 1734 1734 @retval Internal_Command The name is an internal command. 1735 1735 @retval File_Sys_Change the name is a file system change. … … 1760 1760 // 1761 1761 if (CmdName[(StrLen(CmdName)-1)] == L':') { 1762 if ( StrStr(CmdName, L" ") != NULL 1762 if ( StrStr(CmdName, L" ") != NULL 1763 1763 || StrLen(StrStr(CmdName, L":")) > 1 1764 1764 ) { … … 1790 1790 return (Efi_Application); 1791 1791 } 1792 1792 1793 1793 SHELL_FREE_NON_NULL(FileWithPath); 1794 1794 // … … 1807 1807 @retval EFI_NOT_FOUND The operation type is unknown or invalid. 1808 1808 **/ 1809 EFI_STATUS 1809 EFI_STATUS 1810 1810 EFIAPI 1811 1811 IsValidSplit( … … 1959 1959 // 1960 1960 ASSERT(CmdLine[(StrLen(CmdLine)-1)] == L':' && StrStr(CmdLine, L" ") == NULL); 1961 1961 1962 1962 // 1963 1963 // Call the protocol API to do the work … … 2107 2107 2108 2108 This API will upadate the shell's environment since these commands are libraries. 2109 2109 2110 2110 @param[in] CmdLine the command line to run. 2111 2111 @param[in] FirstParameter the first parameter on the command line … … 2129 2129 BOOLEAN LastError; 2130 2130 CHAR16 *Walker; 2131 CHAR16 *NewCmdLine; 2131 CHAR16 *NewCmdLine; 2132 2132 2133 2133 NewCmdLine = AllocateCopyPool (StrSize (CmdLine), CmdLine); … … 2389 2389 Function will process and run a command line. 2390 2390 2391 This will determine if the command line represents an internal shell 2391 This will determine if the command line represents an internal shell 2392 2392 command or dispatch an external application. 2393 2393 … … 2463 2463 SHELL_FREE_NON_NULL(CleanOriginal); 2464 2464 return (Status); 2465 } 2465 } 2466 2466 2467 2467 // … … 2499 2499 SetLastError(SHELL_NOT_FOUND); 2500 2500 } 2501 2501 2502 2502 SHELL_FREE_NON_NULL(CleanOriginal); 2503 2503 SHELL_FREE_NON_NULL(FirstParameter); -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/Shell.uni
-
Property svn:mime-type
changed from
application/octet-stream
totext/plain;encoding=UTF-16LE
-
Property svn:mime-type
changed from
-
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ShellEnvVar.c
r58459 r58466 139 139 return (EFI_INVALID_PARAMETER); 140 140 } 141 141 142 142 Status = EFI_SUCCESS; 143 143 144 144 ValBufferSize = INIT_DATA_BUFFER_SIZE; 145 145 NameBufferSize = INIT_NAME_BUFFER_SIZE; … … 167 167 Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); 168 168 } 169 169 170 170 if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){ 171 171 VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST)); … … 190 190 break; 191 191 } 192 192 193 193 ValSize = ValBufferSize; 194 194 Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val); -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ShellParametersProtocol.c
r58459 r58466 144 144 // Remove any remaining escape characters in the string 145 145 // 146 for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) 147 ; *NextDelim != CHAR_NULL 146 for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) 147 ; *NextDelim != CHAR_NULL 148 148 ; NextDelim = FindFirstCharacter(NextDelim, L"\"^", CHAR_NULL) 149 149 ) { … … 174 174 delimited and quote surrounded parameter definition. 175 175 176 All special character processing (alias, environment variable, redirection, 176 All special character processing (alias, environment variable, redirection, 177 177 etc... must be complete before calling this API. 178 178 … … 483 483 gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition); 484 484 gEfiShellProtocol->CloseFile(Handle); 485 return (Status); 485 return (Status); 486 486 } 487 487 … … 562 562 if ((TempLocation = StrStr(Copy , L"\"")) != NULL) { 563 563 TempLocation[0] = CHAR_NULL; 564 } 564 } 565 565 } else { 566 566 Copy = FileName; … … 570 570 if ((TempLocation = StrStr(Copy , L" ")) != NULL) { 571 571 TempLocation[0] = CHAR_NULL; 572 } 572 } 573 573 } 574 574 … … 603 603 if ((TempLocation = StrStr(Copy , L"%")) != NULL) { 604 604 TempLocation[0] = CHAR_NULL; 605 } 605 } 606 606 } 607 607 … … 612 612 Remove the unicode file tag from the begining of the file buffer since that will not be 613 613 used by StdIn. 614 614 615 615 @param[in] Handle Pointer to the handle of the file to be processed. 616 616 617 617 @retval EFI_SUCCESS The unicode file tag has been moved successfully. 618 618 **/ … … 820 820 Status = EFI_NOT_FOUND; 821 821 } 822 } 822 } 823 823 if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >> ")) != NULL) { 824 824 FirstLocation = MIN(CommandLineWalker, FirstLocation); … … 847 847 Status = EFI_NOT_FOUND; 848 848 } 849 } 849 } 850 850 if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>a ")) != NULL) { 851 851 FirstLocation = MIN(CommandLineWalker, FirstLocation); … … 861 861 Status = EFI_NOT_FOUND; 862 862 } 863 } 863 } 864 864 if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >a ")) != NULL) { 865 865 FirstLocation = MIN(CommandLineWalker, FirstLocation); … … 1089 1089 // Cant redirect during a reconnect operation. 1090 1090 // 1091 ||(StrStr(NewCommandLine, L"connect -r") != NULL 1091 ||(StrStr(NewCommandLine, L"connect -r") != NULL 1092 1092 && (StdOutVarName != NULL || StdOutFileName != NULL || StdErrFileName != NULL || StdErrVarName != NULL)) 1093 1093 // … … 1295 1295 SPLIT_LIST *Split; 1296 1296 1297 if (ShellParameters == NULL 1297 if (ShellParameters == NULL 1298 1298 ||OldStdIn == NULL 1299 1299 ||OldStdOut == NULL -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ShellProtocol.c
r58459 r58466 1172 1172 **/ 1173 1173 EFI_STATUS 1174 EFIAPI 1174 EFIAPI 1175 1175 EfiShellRegisterGuidName( 1176 1176 IN CONST EFI_GUID *Guid, … … 1402 1402 environment variable name and y is the value. If this 1403 1403 is NULL, then the current shell environment is used. 1404 1404 1405 1405 @param[out] StartImageStatus Returned status from gBS->StartImage. 1406 1406 … … 1440 1440 1441 1441 NewHandle = NULL; 1442 1442 1443 1443 NewCmdLine = AllocateCopyPool (StrSize (CommandLine), CommandLine); 1444 1444 if (NewCmdLine == NULL) { … … 2047 2047 **/ 2048 2048 EFI_STATUS 2049 EFIAPI 2049 EFIAPI 2050 2050 EfiShellGetGuidFromName( 2051 2051 IN CONST CHAR16 *GuidName, … … 2059 2059 return (EFI_INVALID_PARAMETER); 2060 2060 } 2061 2061 2062 2062 Status = GetGuidFromStringName(GuidName, NULL, &NewGuid); 2063 2063 … … 2087 2087 **/ 2088 2088 EFI_STATUS 2089 EFIAPI 2089 EFIAPI 2090 2090 EfiShellGetGuidName( 2091 2091 IN CONST EFI_GUID *Guid, … … 2563 2563 **/ 2564 2564 CONST CHAR16 * 2565 EFIAPI 2565 EFIAPI 2566 2566 EfiShellGetEnvEx( 2567 2567 IN CONST CHAR16 *Name, … … 3105 3105 ) 3106 3106 { 3107 3107 3108 3108 EFI_STATUS Status; 3109 3109 EFI_GUID Guid; … … 3140 3140 break; 3141 3141 } 3142 3142 3143 3143 NameSize = NameBufferSize; 3144 3144 Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); 3145 3145 } 3146 3146 3147 3147 if (EFI_ERROR (Status)) { 3148 3148 SHELL_FREE_NON_NULL(RetVal); … … 3150 3150 break; 3151 3151 } 3152 3152 3153 3153 if (CompareGuid(&Guid, &gShellAliasGuid)){ 3154 3154 ASSERT((RetVal == NULL && RetSize == 0) || (RetVal != NULL)); … … 3165 3165 Convert a null-terminated unicode string, in-place, to all lowercase. 3166 3166 Then return it. 3167 3167 3168 3168 @param Str The null-terminated string to be converted to all lowercase. 3169 3170 @return The null-terminated string converted into all lowercase. 3169 3170 @return The null-terminated string converted into all lowercase. 3171 3171 **/ 3172 3172 CHAR16 * … … 3628 3628 (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))) || 3629 3629 (KeyData->Key.UnicodeChar == 3) 3630 ){ 3630 ){ 3631 3631 if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) { 3632 3632 return (EFI_UNSUPPORTED); … … 3635 3635 } else if ((KeyData->Key.UnicodeChar == L's') && 3636 3636 (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED)) 3637 ){ 3637 ){ 3638 3638 ShellInfoObject.HaltOutput = TRUE; 3639 3639 } … … 3642 3642 3643 3643 /** 3644 Function to start monitoring for CTRL-C using SimpleTextInputEx. This 3644 Function to start monitoring for CTRL-C using SimpleTextInputEx. This 3645 3645 feature's enabled state was not known when the shell initially launched. 3646 3646 … … 3667 3667 if (EFI_ERROR(Status)) { 3668 3668 ShellPrintHiiEx( 3669 -1, 3670 -1, 3669 -1, 3670 -1, 3671 3671 NULL, 3672 3672 STRING_TOKEN (STR_SHELL_NO_IN_EX), … … 3689 3689 NotificationFunction, 3690 3690 &ShellInfoObject.CtrlCNotifyHandle1); 3691 3691 3692 3692 KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; 3693 3693 if (!EFI_ERROR(Status)) { -
trunk/src/VBox/Devices/EFI/Firmware/ShellPkg/Application/Shell/ShellProtocol.h
r58459 r58466 37 37 This must be removed via calling CleanUpShellProtocol(). 38 38 39 @param[in, out] NewShell The pointer to the pointer to the structure 39 @param[in, out] NewShell The pointer to the pointer to the structure 40 40 to install. 41 41 … … 50 50 51 51 /** 52 Opposite of CreatePopulateInstallShellProtocol. 52 Opposite of CreatePopulateInstallShellProtocol. 53 53 54 54 Free all memory and restore the system to the state it was in before calling … … 915 915 916 916 /** 917 Function to start monitoring for CTRL-C using SimpleTextInputEx. This 917 Function to start monitoring for CTRL-C using SimpleTextInputEx. This 918 918 feature's enabled state was not known when the shell initially launched. 919 919
Note:
See TracChangeset
for help on using the changeset viewer.