Changeset 99214 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2023 8:28:22 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r98103 r99214 960 960 const char *vrdeEnabled = NULL; 961 961 unsigned cVRDEProperties = 0; 962 const char *a VRDEProperties[16];962 const char *apszVRDEProperties[16]; 963 963 unsigned fPaused = 0; 964 964 #ifdef VBOX_WITH_RECORDING … … 1055 1055 break; 1056 1056 case 'e': 1057 if (cVRDEProperties < RT_ELEMENTS(a VRDEProperties))1058 a VRDEProperties[cVRDEProperties++] = ValueUnion.psz;1057 if (cVRDEProperties < RT_ELEMENTS(apszVRDEProperties)) 1058 apszVRDEProperties[cVRDEProperties++] = ValueUnion.psz; 1059 1059 else 1060 1060 RTPrintf("Warning: too many VRDE properties. Ignored: '%s'\n", ValueUnion.psz); … … 1397 1397 for (unsigned i = 0; i < cVRDEProperties; i++) 1398 1398 { 1399 /* Parse 'name=value'*/1400 c har *pszProperty = RTStrDup(aVRDEProperties[i]);1401 if (psz Property)1399 /* Split 'name=value' and feed the parts to SetVRDEProperty. */ 1400 const char *pszDelimiter = strchr(apszVRDEProperties[i], '='); 1401 if (pszDelimiter) 1402 1402 { 1403 char *pDelimiter = strchr(pszProperty, '='); 1404 if (pDelimiter) 1405 { 1406 *pDelimiter = '\0'; 1407 1408 Bstr bstrName = pszProperty; 1409 Bstr bstrValue = &pDelimiter[1]; 1410 CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(bstrName.raw(), bstrValue.raw())); 1411 } 1412 else 1413 { 1414 RTPrintf("Error: Invalid VRDE property '%s'\n", aVRDEProperties[i]); 1415 RTStrFree(pszProperty); 1416 hrc = E_INVALIDARG; 1417 break; 1418 } 1419 RTStrFree(pszProperty); 1403 Bstr bstrName(apszVRDEProperties[i], pszDelimiter - apszVRDEProperties[i]); 1404 Bstr bstrValue(pszDelimiter + 1); 1405 CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(bstrName.raw(), bstrValue.raw())); 1420 1406 } 1421 1407 else 1422 1408 { 1423 RTPrintf("Error: Failed to allocate memory for VRDE property '%s'\n", aVRDEProperties[i]);1424 hrc = E_ OUTOFMEMORY;1409 RTPrintf("Error: Invalid VRDE property '%s'\n", apszVRDEProperties[i]); 1410 hrc = E_INVALIDARG; 1425 1411 break; 1426 1412 }
Note:
See TracChangeset
for help on using the changeset viewer.