VirtualBox

Changeset 9917 in vbox


Ignore:
Timestamp:
Jun 25, 2008 1:57:56 PM (17 years ago)
Author:
vboxsync
Message:

Corrected hungarian spelling and added a todo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedInfoServices/service.cpp

    r9882 r9917  
    3434 * Since the CFGM APIs are single threaded, the creator must also ensure that
    3535 * no-one else accesses the configuration node while the service is running.
    36  * 
     36 *
    3737 * If this service is extended to deal with new requests it would probably be a
    3838 * good idea to split it up into several files.
     
    111111    }
    112112
    113     /** 
     113    /**
    114114     * @copydoc VBOXHGCMSVCHELPERS::pfnConnect
    115115     * Stub implementation of pfnConnect and pfnDisconnect.
     
    122122    }
    123123
    124     /** 
     124    /**
    125125     * @copydoc VBOXHGCMSVCHELPERS::pfnCall
    126126     * Wraps to the call member function
     
    139139    }
    140140
    141     /** 
    142      * @copydoc VBOXHGCMSVCHELPERS::pfnHostCall 
     141    /**
     142     * @copydoc VBOXHGCMSVCHELPERS::pfnHostCall
    143143     * Wraps to the hostCall member function
    144144     */
     
    154154private:
    155155    int getKey(uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    156     int validateGetKey(const char *pcKey, uint32_t cbKey, char *pcValue, uint32_t cbValue);
     156    int validateGetKey(const char *pszKey, uint32_t cbKey, char *pszValue, uint32_t cbValue);
    157157    int setKey(uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    158     int validateSetKey(const char *pcKey, uint32_t cbKey, char *pcValue, uint32_t cbValue);
     158    int validateSetKey(const char *pszKey, uint32_t cbKey, char *pszValue, uint32_t cbValue);
    159159    void call (VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID,
    160160               void *pvClient, uint32_t eFunction, uint32_t cParms,
     
    167167 * Retrieve a value from the guest registry by key, checking the validity
    168168 * of the arguments passed.
    169  * 
     169 *
    170170 * @returns iprt status value
    171171 * @param   cParms  the number of HGCM parameters supplied
     
    176176{
    177177    int rc = VINF_SUCCESS;
    178     char *pszKey, *pcValue;
     178    char *pszKey, *pszValue;
    179179    uint32_t cbKey, cbValue;
    180180    size_t cbValueActual;
     
    189189        rc = VBoxHGCMParmPtrGet(&paParms[0], (void **) &pszKey, &cbKey);
    190190    if (RT_SUCCESS(rc))
    191         rc = VBoxHGCMParmPtrGet(&paParms[1], (void **) &pcValue, &cbValue);
    192     if (RT_SUCCESS(rc))
    193         rc = validateGetKey(pszKey, cbKey, pcValue, cbValue);
     191        rc = VBoxHGCMParmPtrGet(&paParms[1], (void **) &pszValue, &cbValue);
     192    if (RT_SUCCESS(rc))
     193        rc = validateGetKey(pszKey, cbKey, pszValue, cbValue);
    194194    if (RT_SUCCESS(rc))
    195195        rc = CFGMR3QuerySize(mpNode, pszKey, &cbValueActual);
     
    199199        rc = VINF_BUFFER_OVERFLOW;
    200200    if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
    201         rc = CFGMR3QueryString(mpNode, pszKey, pcValue, cbValue);
     201        rc = CFGMR3QueryString(mpNode, pszKey, pszValue, cbValue);
    202202    if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
    203         Log2(("Queried string %s, rc=%Rrc, value=%.*s\n", pszKey, rc, cbValue, pcValue));
     203        Log2(("Queried string %s, rc=%Rrc, value=%.*s\n", pszKey, rc, cbValue, pszValue));
    204204    else if (VERR_CFGM_VALUE_NOT_FOUND == rc)
    205205    {
     
    218218 *
    219219 * @returns IPRT status code
    220  * @param   pcKey     the key passed by the guest
    221  * @param   cbKey     the number of bytes in the array cbKey
    222  * @param   pcValue   the array to store the key into
     220 * @param   pszKey    the key passed by the guest
     221 * @param   cbKey     the number of bytes pszKey points to, including the terminating '\0'
     222 * @param   pszValue  the buffer to store the key name into
    223223 * @param   cbValue   the size of the array for storing the key value
    224224 * @thread  HGCM
    225225 */
    226 int Service::validateGetKey(const char *pcKey, uint32_t cbKey, char *pcValue, uint32_t cbValue)
     226int Service::validateGetKey(const char *pszKey, uint32_t cbKey, char *pszValue, uint32_t cbValue)
    227227{
    228228    LogFlowFunc(("cbKey=%d, cbValue=%d\n", cbKey, cbValue));
     
    235235        rc = VERR_INVALID_PARAMETER;
    236236    /* Only accept names in printable ASCII without spaces */
    237     for (count = 0; (count < cbKey) && (pcKey[count] != '\0'); ++count)
    238         if ((pcKey[count] < 33) || (pcKey[count] > 126))
     237    for (count = 0; (count < cbKey) && (pszKey[count] != '\0'); ++count)
     238        if ((pszKey[count] < 33) || (pszKey[count] > 126))
    239239            rc = VERR_INVALID_PARAMETER;
    240240    if (RT_SUCCESS(rc) && (count == cbKey))
     
    245245
    246246    if (RT_SUCCESS(rc))
    247         LogFlow(("    pcKey=%s\n", pcKey));
     247        LogFlow(("    pszKey=%s\n", pszKey));
    248248    LogFlowFunc(("returning %Rrc\n", rc));
    249249    return rc;
     
    254254 * Set a value in the guest registry by key, checking the validity
    255255 * of the arguments passed.
    256  * 
     256 *
    257257 * @returns iprt status value
    258258 * @param   cParms  the number of HGCM parameters supplied
     
    306306 *
    307307 * @returns IPRT status code
    308  * @param   pcKey     the key passed by the guest
    309  * @param   cbKey     the number of bytes in the array cbKey
    310  * @param   pcValue   the value to store in the key
    311  * @param   cbValue   the number of bytes in the array pcValue
     308 * @param   pszKey    the key passed by the guest
     309 * @param   cbKey     the number of bytes in the buffer pszKey points to
     310 * @param   pszValue  the value to store in the key
     311 * @param   cbValue   the number of bytes in the buffer pszValue points to
    312312 * @thread  HGCM
    313313 */
    314 int Service::validateSetKey(const char *pcKey, uint32_t cbKey, char *pcValue,
     314int Service::validateSetKey(const char *pszKey, uint32_t cbKey, char *pszValue,
    315315                                   uint32_t cbValue)
    316316{
     
    323323    if (cbKey < sizeof(VBOX_SHARED_INFO_KEY_PREFIX))
    324324        rc = VERR_INVALID_PARAMETER;
     325    /** @todo duplicate check in validateGetKey, use separate method. mixing unsigned and uint32_t. */
    325326    /* Only accept names in printable ASCII without spaces */
    326     for (count = 0; (count < cbKey) && (pcKey[count] != '\0'); ++count)
    327         if ((pcKey[count] < 33) || (pcKey[count] > 126))
     327    for (count = 0; (count < cbKey) && (pszKey[count] != '\0'); ++count)
     328        if ((pszKey[count] < 33) || (pszKey[count] > 126))
    328329            rc = VERR_INVALID_PARAMETER;
    329330    if (RT_SUCCESS(rc) && (count == cbKey))
     
    337338        /* Validate the format of the value. */
    338339        /* Only accept values in printable ASCII without spaces */
    339         for (count = 0; (count < cbValue) && (pcValue[count] != '\0'); ++count)
    340             if ((pcValue[count] < 33) || (pcValue[count] > 126))
     340        for (count = 0; (count < cbValue) && (pszValue[count] != '\0'); ++count)
     341            if ((pszValue[count] < 33) || (pszValue[count] > 126))
    341342                rc = VERR_INVALID_PARAMETER;
    342343        if (RT_SUCCESS(rc) && (count == cbValue))
     
    348349
    349350    if (RT_SUCCESS(rc))
    350         LogFlow(("    pcKey=%s, pcValue=%s\n", pcKey, cbValue > 0 ? pcValue : NULL));
     351        LogFlow(("    pszKey=%s, pszValue=%s\n", pszKey, cbValue > 0 ? pszValue : NULL));
    351352    LogFlowFunc(("returning %Rrc\n", rc));
    352353    return rc;
     
    360361 *          handled synchronously.  If needed, we will add a request handler
    361362 *          thread in future for those which do.
    362  *         
     363 *
    363364 * @thread  HGCM
    364365 */
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