Changeset 27080 in vbox for trunk/src/VBox/Additions/common/VBoxGuestLib
- Timestamp:
- Mar 5, 2010 12:49:22 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58404
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r27023 r27080 39 39 #include "VBGLR3Internal.h" 40 40 41 /** @todo Split this file up so we can drop most of the VBOX_VBGLR3_XFREE86 42 * #ifdef'ing. */ 41 43 42 44 /** … … 48 50 * immediately and return those events. 49 51 * 50 * @returns IPRT status code 52 * @returns IPRT status code. 51 53 * 52 54 * @param fMask The events we want to wait for, or-ed together. … … 74 76 { 75 77 #if !defined(VBOX_VBGLR3_XFREE86) && !defined(RT_OS_WINDOWS) 76 AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d rc=% d\n", waitEvent.u32Result, rc));78 AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d rc=%Rrc\n", waitEvent.u32Result, rc)); 77 79 #endif 78 80 if (pfEvents) … … 93 95 * 94 96 * Can be used in combination with a termination flag variable for interrupting 95 * event loops. Avoiding race conditions is the responsibility of the caller.96 * 97 * @returns IPRT status code 97 * event loops. Avoiding race conditions is the responsibility of the caller. 98 * 99 * @returns IPRT status code. 98 100 */ 99 101 VBGLR3DECL(int) VbglR3InterruptEventWaits(void) … … 106 108 * Write to the backdoor logger from ring 3 guest code. 107 109 * 108 * @returns IPRT status code 110 * @returns IPRT status code. 111 * 112 * @param pch The string to log. Does not need to be terminated. 113 * @param cb The number of byte to log. 114 * @todo cb -> cch. 109 115 * 110 116 * @remarks This currently does not accept more than 255 bytes of data at … … 161 167 * Change the IRQ filter mask. 162 168 * 163 * @returns IPRT status code 169 * @returns IPRT status code. 164 170 * @param fOr The OR mask. 165 171 * @param fNo The NOT mask. … … 177 183 * Report a change in the capabilities that we support to the host. 178 184 * 179 * @returns IPRT status value185 * @returns IPRT status code. 180 186 * @param fOr Capabilities which have been added. 181 187 * @param fNot Capabilities which have been removed. … … 200 206 } 201 207 202 /** 203 * Query the current statistics update interval 204 * 205 * @returns IPRT status code 206 * @param pu32Interval Update interval in ms (out) 207 */ 208 VBGLR3DECL(int) VbglR3StatQueryInterval(uint32_t *pu32Interval) 208 #ifndef VBOX_VBGLR3_XFREE86 209 210 /** 211 * Query the current statistics update interval. 212 * 213 * @returns IPRT status code. 214 * @param pcMsInterval Update interval in ms (out). 215 */ 216 VBGLR3DECL(int) VbglR3StatQueryInterval(PRTMSINTERVAL pcMsInterval) 209 217 { 210 218 VMMDevGetStatisticsChangeRequest Req; … … 212 220 vmmdevInitRequest(&Req.header, VMMDevReq_GetStatisticsChangeRequest); 213 221 Req.eventAck = VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST; 222 Req.u32StatInterval = 1; 214 223 int rc = vbglR3GRPerform(&Req.header); 215 224 if (RT_SUCCESS(rc)) 216 *pu32Interval = Req.u32StatInterval * 1000; 217 return rc; 218 } 219 220 221 /** 222 * Report guest statistics 223 * 224 * @returns IPRT status code 225 * @param pReq Request packet with statistics 225 { 226 *pcMsInterval = Req.u32StatInterval * 1000; 227 if (*pcMsInterval / 1000 != Req.u32StatInterval) 228 *pcMsInterval = ~(RTMSINTERVAL)0; 229 } 230 return rc; 231 } 232 233 234 /** 235 * Report guest statistics. 236 * 237 * @returns IPRT status code. 238 * @param pReq Request packet with statistics. 226 239 */ 227 240 VBGLR3DECL(int) VbglR3StatReport(VMMDevReportGuestStats *pReq) … … 233 246 234 247 /** 235 * Refresh the memory balloon after a change 236 * 237 * @returns IPRT status code 238 * @param p u32Size Memory balloon size in MBs (out)239 * @param pfHandleInR3 Allocating of memory in R3 required (out)248 * Refresh the memory balloon after a change. 249 * 250 * @returns IPRT status code. 251 * @param pcChunks The size of the balloon in chunks of 1MB (out). 252 * @param pfHandleInR3 Allocating of memory in R3 required (out). 240 253 */ 241 254 VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3) … … 243 256 VBoxGuestCheckBalloonInfo Info; 244 257 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_CHECK_BALLOON, &Info, sizeof(Info)); 245 *pcChunks = Info.cBalloonChunks; 246 *pfHandleInR3 = Info.fHandleInR3; 258 if (RT_SUCCESS(rc)) 259 { 260 *pcChunks = Info.cBalloonChunks; 261 Assert(Info.fHandleInR3 == false || Info.fHandleInR3 == true || RT_FAILURE(rc)); 262 *pfHandleInR3 = Info.fHandleInR3 != false; 263 } 247 264 return rc; 248 265 } … … 252 269 * Change the memory by granting/reclaiming memory to/from R0. 253 270 * 254 * @returns IPRT status code 255 * @param pv Memory chunk (1MB) 256 * @param fInflate true = inflate balloon (grant memory) 257 * false = deflate balloon (reclaim memory) 271 * @returns IPRT status code. 272 * @param pv Memory chunk (1MB). 273 * @param fInflate true = inflate balloon (grant memory). 274 * false = deflate balloon (reclaim memory). 258 275 */ 259 276 VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate) … … 266 283 267 284 268 #ifndef VBOX_VBGLR3_XFREE86269 285 /** 270 286 * Fallback for vbglR3GetAdditionsVersion. … … 297 313 return VINF_SUCCESS; 298 314 } 299 #endif300 301 315 302 316 #ifdef RT_OS_WINDOWS … … 353 367 return RTErrConvertFromWin32(RegCloseKey(hKey)); 354 368 } 369 355 370 #endif /* RT_OS_WINDOWS */ 356 371 357 358 #ifndef VBOX_VBGLR3_XFREE86359 372 /** 360 373 * Retrieves the installed Guest Additions version and/or revision. … … 451 464 #endif /* !RT_OS_WINDOWS */ 452 465 } 453 #endif /* !VBOX_VBGLR3_XFREE86 */ 466 454 467 455 468 /** … … 506 519 return rc; 507 520 } 521 522 #endif /* !VBOX_VBGLR3_XFREE86 */ 523
Note:
See TracChangeset
for help on using the changeset viewer.