Changeset 70090 in vbox for trunk/include/VBox
- Timestamp:
- Dec 12, 2017 5:53:44 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestPropertySvc.h
r70089 r70090 164 164 /** 165 165 * Write out flags to a string. 166 *167 166 * @returns IPRT status code 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)167 * @param fFlags the flags to write out 168 * @param pszFlags where to write the flags string. This must point to 169 * a buffer of size (at least) MAX_FLAGS_LEN. 170 */ 171 DECLINLINE(int) GuestPropWriteFlags(uint32_t fFlags, char *pszFlags) 173 172 { 174 173 /* Putting READONLY before the other RDONLY flags keeps the result short. */ … … 182 181 if ((fFlags & ~GUEST_PROP_F_ALLFLAGS) == GUEST_PROP_F_NILFLAG) 183 182 { 183 char *pszNext; 184 unsigned i; 185 184 186 /* TRANSRESET implies TRANSIENT. For compatability with old clients we 185 187 always set TRANSIENT when TRANSRESET appears. */ … … 195 197 if (s_aFlagList[i] == (fFlags & s_aFlagList[i])) 196 198 { 197 RTStrAAppend(&pszTemp, GuestPropFlagName(s_aFlagList[i])); 199 strcpy(pszNext, GuestPropFlagName(s_aFlagList[i])); 200 pszNext += GuestPropFlagNameLen(s_aFlagList[i]); 198 201 fFlags &= ~s_aFlagList[i]; 199 202 if (fFlags != GUEST_PROP_F_NILFLAG) 200 RTStrAAppend(&pszTemp, ", "); 203 { 204 strcpy(pszNext, ", "); 205 pszNext += 2; 206 } 201 207 } 202 208 } 203 204 if ( RT_SUCCESS(rc) 205 && pszTemp) 206 rc = RTStrCopy(pszFlags, cbFlags, pszTemp); 207 208 if (pszTemp) 209 RTStrFree(pszTemp); 209 *pszNext = '\0'; 210 210 211 211 Assert(fFlags == GUEST_PROP_F_NILFLAG); /* bad s_aFlagList */
Note:
See TracChangeset
for help on using the changeset viewer.