Changeset 23634 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Oct 9, 2009 7:54:09 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp
r23608 r23634 139 139 *ppszValue = NULL; 140 140 141 char *pszPropNameUTF8;142 rc = RTStrCurrentCPToUtf8(&pszPropNameUTF8, pszPropName);143 if (RT_FAILURE(rc))144 {145 VBoxServiceError("Exec: Failed to convert property name \"%s\" to UTF-8!\n", pszPropName);146 return rc;147 }148 149 141 for (unsigned cTries = 0; cTries < 10; cTries++) 150 142 { … … 163 155 char *pszFlags; 164 156 uint64_t uTimestamp; 165 rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropName UTF8,157 rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropName, 166 158 pvBuf, cbBuf, 167 159 &pszValue, &uTimestamp, &pszFlags, NULL); … … 208 200 } 209 201 RTMemFree(pvBuf); 210 RTStrFree(pszPropNameUTF8);211 202 return rc; 212 203 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp
r23577 r23634 39 39 int VBoxServiceWritePropF(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...) 40 40 { 41 char *pszNameUTF8; 42 int rc = RTStrCurrentCPToUtf8(&pszNameUTF8, pszName); 43 if (RT_SUCCESS(rc)) 41 int rc; 42 if (pszValueFormat != NULL) 44 43 { 45 if (pszValueFormat != NULL) 46 { 47 VBoxServiceVerbose(3, "Writing guest property \"%s\"\n", pszNameUTF8); 48 va_list va; 49 va_start(va, pszValueFormat); 50 rc = VbglR3GuestPropWriteValueV(u32ClientId, pszNameUTF8, pszValueFormat, va); 51 va_end(va); 52 if (RT_FAILURE(rc)) 53 VBoxServiceError("Error writing guest property \"%s\" (rc=%Rrc)\n", pszNameUTF8, rc); 54 } 55 else 56 rc = VbglR3GuestPropWriteValue(u32ClientId, pszNameUTF8, NULL); 57 RTStrFree(pszNameUTF8); 44 VBoxServiceVerbose(3, "Writing guest property \"%s\"\n", pszName); 45 va_list va; 46 va_start(va, pszValueFormat); 47 rc = VbglR3GuestPropWriteValueV(u32ClientId, pszName, pszValueFormat, va); 48 va_end(va); 49 if (RT_FAILURE(rc)) 50 VBoxServiceError("Error writing guest property \"%s\" (rc=%Rrc)\n", pszName, rc); 58 51 } 52 else 53 rc = VbglR3GuestPropWriteValue(u32ClientId, pszName, NULL); 59 54 return rc; 60 55 }
Note:
See TracChangeset
for help on using the changeset viewer.