VirtualBox

Changeset 23634 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Oct 9, 2009 7:54:09 AM (15 years ago)
Author:
vboxsync
Message:

VBoxService: No need for RTStrCurrentCPToUtf8() anymore.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceExec.cpp

    r23608 r23634  
    139139    *ppszValue = NULL;
    140140
    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 
    149141    for (unsigned cTries = 0; cTries < 10; cTries++)
    150142    {
     
    163155        char    *pszFlags;
    164156        uint64_t uTimestamp;
    165         rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropNameUTF8,
     157        rc = VbglR3GuestPropRead(g_uExecGuestPropSvcClientID, pszPropName,
    166158                                 pvBuf, cbBuf,
    167159                                 &pszValue, &uTimestamp, &pszFlags, NULL);
     
    208200    }
    209201    RTMemFree(pvBuf);
    210     RTStrFree(pszPropNameUTF8);
    211202    return rc;
    212203}
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp

    r23577 r23634  
    3939int VBoxServiceWritePropF(uint32_t u32ClientId, const char *pszName, const char *pszValueFormat, ...)
    4040{
    41     char *pszNameUTF8;
    42     int rc = RTStrCurrentCPToUtf8(&pszNameUTF8, pszName);
    43     if (RT_SUCCESS(rc))
     41    int rc;
     42    if (pszValueFormat != NULL)
    4443    {
    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);
    5851    }
     52    else
     53        rc = VbglR3GuestPropWriteValue(u32ClientId, pszName, NULL);
    5954    return rc;
    6055}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette