VirtualBox

Changeset 95338 in vbox for trunk/include/VBox/HostServices


Ignore:
Timestamp:
Jun 21, 2022 9:20:50 PM (3 years ago)
Author:
vboxsync
Message:

GuestPropertySvc.h,Main: Changed GuestPropValidateName and GuestPropValidateValue to take size_t instead of uint32_t, eliminating the need for a bunch of (uint32_t) casts. Call setErrorBoth when either of the two fails in Main. bugref:10185

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestPropertySvc.h

    r95334 r95338  
    7171 *
    7272 * @returns IPRT status code
    73  * @param   pszName   the string to check, must be valid Utf8
    74  * @param   cbName    the number of bytes @a pszName points to, including the terminating character.
    75  */
    76 DECLINLINE(int) GuestPropValidateName(const char *pszName, uint32_t cbName)
     73 * @param   pszName   The string to check, must be valid Utf8
     74 * @param   cbName    The number of bytes @a pszName points to, including the
     75 *                    terminating character.
     76 */
     77DECLINLINE(int) GuestPropValidateName(const char *pszName, size_t cbName)
    7778{
    7879    /* Property name is expected to be at least 1 charecter long plus terminating character. */
     
    9697 * @retval  VERR_TOO_MUCH_DATA if guest property value size exceeds limits.
    9798 * @retval  VERR_INVALID_PARAMETER if guest property does not correspond to all other criteria.
    98  * @param   pszValue  the string to check, must be valid Utf8
    99  * @param   cbValue   the length in bytes of @a pszValue, including the
    100  *                    terminator
     99 * @param   pszValue  The string to check, must be valid utf-8.
     100 * @param   cbValue   The size of of @a pszValue in bytes, including the
     101 *                    terminator.
    101102 * @thread  HGCM
    102103 */
    103 DECLINLINE(int) GuestPropValidateValue(const char *pszValue, uint32_t cbValue)
     104DECLINLINE(int) GuestPropValidateValue(const char *pszValue, size_t cbValue)
    104105{
    105106    AssertPtrReturn(pszValue, VERR_INVALID_POINTER);
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