Changeset 10017 in vbox
- Timestamp:
- Jun 30, 2008 2:06:54 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32491
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibInfoSvc.cpp
r10006 r10017 154 154 rc = Msg.hdr.result; 155 155 uint32_t cbActual; 156 if (RT_SUCCESS(rc)) 157 rc = VbglHGCMParmUInt32Get(&Msg.size, &cbActual); 158 if (RT_SUCCESS(rc)) 156 if (RT_SUCCESS(rc) || (VERR_BUFFER_OVERFLOW == rc)) 159 157 { 160 if (pcbActual != NULL) 161 *pcbActual = cbActual; 162 if (cbActual > cbValue) 163 rc = VINF_BUFFER_OVERFLOW; 158 int rc2 = VbglHGCMParmUInt32Get(&Msg.size, &cbActual); 159 if (RT_SUCCESS(rc2)) 160 { 161 if (pcbActual != NULL) 162 *pcbActual = cbActual; 163 } 164 164 else 165 rc = Msg.hdr.result; 166 if ((cbValue > 0) && (0 == cbActual)) /* No such property */ 167 pszValue[0] = 0; 165 rc = rc2; 168 166 } 169 167 return rc; -
trunk/src/VBox/HostServices/SharedInfoServices/service.cpp
r10004 r10017 238 238 /** 239 239 * Retrieve a value from the guest registry by key, checking the validity 240 * of the arguments passed. 240 * of the arguments passed. If the guest has not allocated enough buffer 241 * space for the value then we return VERR_OVERFLOW and set the size of the 242 * buffer needed in the "size" HGCM parameter. If the key was not found at 243 * all, we return VERR_NOT_FOUND. 241 244 * 242 245 * @returns iprt status value … … 269 272 VBoxHGCMParmUInt32Set(&paParms[2], cbValueActual); 270 273 if (RT_SUCCESS(rc) && (cbValueActual > cbValue)) 271 rc = V INF_BUFFER_OVERFLOW;274 rc = VERR_BUFFER_OVERFLOW; 272 275 if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW)) 273 276 rc = CFGMR3QueryString(mpNode, pszKey, pszValue, cbValue); … … 275 278 Log2(("Queried string %s, rc=%Rrc, value=%.*s\n", pszKey, rc, cbValue, pszValue)); 276 279 else if (VERR_CFGM_VALUE_NOT_FOUND == rc) 277 { 278 VBoxHGCMParmUInt32Set(&paParms[2], 0); 279 rc = VINF_SUCCESS; 280 } 280 rc = VERR_NOT_FOUND; 281 281 LogFlowThisFunc(("rc = %Rrc\n", rc)); 282 282 return rc; … … 396 396 case SET_CONFIG_KEY: 397 397 LogFlowFunc(("SET_CONFIG_KEY\n")); 398 if (RT_SUCCESS(rc)) 399 rc = setKey(cParms, paParms); 398 rc = setKey(cParms, paParms); 400 399 break; 401 400 … … 403 402 case DEL_CONFIG_KEY: 404 403 LogFlowFunc(("DEL_CONFIG_KEY\n")); 405 if (RT_SUCCESS(rc)) 406 rc = delKey(cParms, paParms); 404 rc = delKey(cParms, paParms); 407 405 break; 408 406 … … 466 464 case SET_CONFIG_KEY_HOST: 467 465 LogFlowFunc(("SET_CONFIG_KEY_HOST\n")); 468 if (RT_SUCCESS(rc)) 469 rc = setKey(cParms, paParms); 466 rc = setKey(cParms, paParms); 470 467 break; 471 468 … … 473 470 case DEL_CONFIG_KEY_HOST: 474 471 LogFlowFunc(("DEL_CONFIG_KEY_HOST\n")); 475 if (RT_SUCCESS(rc)) 476 rc = delKey(cParms, paParms); 472 rc = delKey(cParms, paParms); 477 473 break; 478 474
Note:
See TracChangeset
for help on using the changeset viewer.