Changeset 70108 in vbox for trunk/include/VBox/HostServices
- Timestamp:
- Dec 13, 2017 12:35:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestPropertySvc.h
r70091 r70108 164 164 /** 165 165 * Write out flags to a string. 166 * 166 167 * @returns IPRT status code 167 * @param fFlags the flags to write out168 * @param pszFlags where to write the flags string. This must point to169 * a buffer of size (at least) MAX_FLAGS_LEN.170 */ 171 DECLINLINE(int) GuestPropWriteFlags(uint32_t fFlags, char *pszFlags)168 * @param fFlags The flags to write out. 169 * @param pszFlags Where to write the flags string. 170 * @param cbFlags The size of the destination buffer (in bytes). 171 */ 172 DECLINLINE(int) GuestPropWriteFlags(uint32_t fFlags, char* pszFlags, size_t cbFlags) 172 173 { 173 174 /* Putting READONLY before the other RDONLY flags keeps the result short. */ … … 179 180 180 181 AssertLogRelReturn(VALID_PTR(pszFlags), VERR_INVALID_POINTER); 182 AssertLogRelReturn(cbFlags, VERR_INVALID_PARAMETER); 183 184 pszFlags[0] = '\0'; 185 181 186 if ((fFlags & ~GUEST_PROP_F_ALLFLAGS) == GUEST_PROP_F_NILFLAG) 182 187 { 183 char *pszNext;184 188 unsigned i; 185 189 … … 189 193 fFlags |= GUEST_PROP_F_TRANSIENT; 190 194 191 pszNext = pszFlags;192 195 for (i = 0; i < RT_ELEMENTS(s_aFlagList); ++i) 193 196 { 194 197 if (s_aFlagList[i] == (fFlags & s_aFlagList[i])) 195 198 { 196 strcpy(pszNext, GuestPropFlagName(s_aFlagList[i])); 197 pszNext += GuestPropFlagNameLen(s_aFlagList[i]); 199 rc = RTStrCat(pszFlags, cbFlags, GuestPropFlagName(s_aFlagList[i])); 200 if (RT_FAILURE(rc)) 201 break; 202 198 203 fFlags &= ~s_aFlagList[i]; 204 199 205 if (fFlags != GUEST_PROP_F_NILFLAG) 200 206 { 201 strcpy(pszNext, ", "); 202 pszNext += 2; 207 rc = RTStrCat(pszFlags, cbFlags, ", "); 208 if (RT_FAILURE(rc)) 209 break; 203 210 } 204 211 } 205 212 } 206 *pszNext = '\0';207 213 208 214 Assert(fFlags == GUEST_PROP_F_NILFLAG); /* bad s_aFlagList */
Note:
See TracChangeset
for help on using the changeset viewer.