Changeset 50618 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 26, 2014 7:55:39 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 92493
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r50559 r50618 171 171 ///////////////////////////////////////////////////////////////////////////// 172 172 173 int GuestDirectory:: callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)173 int GuestDirectory::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb) 174 174 { 175 175 AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER); … … 242 242 * removed from the public directory list. 243 243 */ 244 int GuestDirectory:: onRemove(void)244 int GuestDirectory::i_onRemove(void) 245 245 { 246 246 LogFlowThisFuncEnter(); -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r50544 r50618 241 241 ///////////////////////////////////////////////////////////////////////////// 242 242 243 STDMETHODIMP GuestFile::COMGETTER(CreationMode)(ULONG *aCreationMode) 244 { 245 #ifndef VBOX_WITH_GUEST_CONTROL 246 ReturnComNotImplemented(); 247 #else 248 AutoCaller autoCaller(this); 249 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 250 251 CheckComArgOutPointerValid(aCreationMode); 252 243 HRESULT GuestFile::getCreationMode(ULONG *aCreationMode) 244 { 245 #ifndef VBOX_WITH_GUEST_CONTROL 246 ReturnComNotImplemented(); 247 #else 253 248 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 254 249 … … 259 254 } 260 255 261 STDMETHODIMP GuestFile::COMGETTER(Disposition)(BSTR *aDisposition) 262 { 263 #ifndef VBOX_WITH_GUEST_CONTROL 264 ReturnComNotImplemented(); 265 #else 266 AutoCaller autoCaller(this); 267 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 268 269 CheckComArgOutPointerValid(aDisposition); 270 256 HRESULT GuestFile::getDisposition(com::Utf8Str &aDisposition) 257 { 258 #ifndef VBOX_WITH_GUEST_CONTROL 259 ReturnComNotImplemented(); 260 #else 271 261 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 272 262 273 mData.mOpenInfo.mDisposition.cloneTo(aDisposition);263 aDisposition = mData.mOpenInfo.mDisposition; 274 264 275 265 return S_OK; … … 277 267 } 278 268 279 STDMETHODIMP GuestFile::COMGETTER(EventSource)(IEventSource ** aEventSource) 280 { 281 #ifndef VBOX_WITH_GUEST_CONTROL 282 ReturnComNotImplemented(); 283 #else 284 CheckComArgOutPointerValid(aEventSource); 285 286 AutoCaller autoCaller(this); 287 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 288 269 HRESULT GuestFile::getEventSource(ComPtr<IEventSource> &aEventSource) 270 { 271 #ifndef VBOX_WITH_GUEST_CONTROL 272 ReturnComNotImplemented(); 273 #else 289 274 /* No need to lock - lifetime constant. */ 290 mEventSource.queryInterfaceTo(aEventSource );275 mEventSource.queryInterfaceTo(aEventSource.asOutParam()); 291 276 292 277 return S_OK; … … 294 279 } 295 280 296 STDMETHODIMP GuestFile::COMGETTER(FileName)(BSTR *aFileName) 297 { 298 #ifndef VBOX_WITH_GUEST_CONTROL 299 ReturnComNotImplemented(); 300 #else 301 AutoCaller autoCaller(this); 302 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 303 304 CheckComArgOutPointerValid(aFileName); 305 281 HRESULT GuestFile::getFileName(com::Utf8Str &aFileName) 282 { 283 #ifndef VBOX_WITH_GUEST_CONTROL 284 ReturnComNotImplemented(); 285 #else 306 286 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 307 287 308 mData.mOpenInfo.mFileName.cloneTo(aFileName);288 aFileName = mData.mOpenInfo.mFileName; 309 289 310 290 return S_OK; … … 312 292 } 313 293 314 STDMETHODIMP GuestFile::COMGETTER(Id)(ULONG *aID) 315 { 316 #ifndef VBOX_WITH_GUEST_CONTROL 317 ReturnComNotImplemented(); 318 #else 319 AutoCaller autoCaller(this); 320 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 321 322 CheckComArgOutPointerValid(aID); 323 294 HRESULT GuestFile::getId(ULONG *aId) 295 { 296 #ifndef VBOX_WITH_GUEST_CONTROL 297 ReturnComNotImplemented(); 298 #else 324 299 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 325 300 326 *aI D= mData.mID;301 *aId = mData.mID; 327 302 328 303 return S_OK; … … 330 305 } 331 306 332 STDMETHODIMP GuestFile::COMGETTER(InitialSize)(LONG64 *aInitialSize) 333 { 334 #ifndef VBOX_WITH_GUEST_CONTROL 335 ReturnComNotImplemented(); 336 #else 337 AutoCaller autoCaller(this); 338 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 339 340 CheckComArgOutPointerValid(aInitialSize); 341 307 HRESULT GuestFile::getInitialSize(LONG64 *aInitialSize) 308 { 309 #ifndef VBOX_WITH_GUEST_CONTROL 310 ReturnComNotImplemented(); 311 #else 342 312 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 343 313 … … 348 318 } 349 319 350 STDMETHODIMP GuestFile::COMGETTER(Offset)(LONG64 *aOffset) 351 { 352 #ifndef VBOX_WITH_GUEST_CONTROL 353 ReturnComNotImplemented(); 354 #else 355 AutoCaller autoCaller(this); 356 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 357 358 CheckComArgOutPointerValid(aOffset); 359 320 HRESULT GuestFile::getOffset(LONG64 *aOffset) 321 { 322 #ifndef VBOX_WITH_GUEST_CONTROL 323 ReturnComNotImplemented(); 324 #else 360 325 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 361 326 … … 366 331 } 367 332 368 STDMETHODIMP GuestFile::COMGETTER(OpenMode)(BSTR *aOpenMode) 369 { 370 #ifndef VBOX_WITH_GUEST_CONTROL 371 ReturnComNotImplemented(); 372 #else 373 AutoCaller autoCaller(this); 374 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 375 376 CheckComArgOutPointerValid(aOpenMode); 377 333 HRESULT GuestFile::getOpenMode(com::Utf8Str &aOpenMode) 334 { 335 #ifndef VBOX_WITH_GUEST_CONTROL 336 ReturnComNotImplemented(); 337 #else 378 338 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 379 339 380 mData.mOpenInfo.mOpenMode.cloneTo(aOpenMode);340 aOpenMode = mData.mOpenInfo.mOpenMode; 381 341 382 342 return S_OK; … … 384 344 } 385 345 386 STDMETHODIMP GuestFile::COMGETTER(Status)(FileStatus_T *aStatus)346 HRESULT GuestFile::getStatus(FileStatus_T *aStatus) 387 347 { 388 348 #ifndef VBOX_WITH_GUEST_CONTROL … … 390 350 #else 391 351 LogFlowThisFuncEnter(); 392 393 AutoCaller autoCaller(this);394 if (FAILED(autoCaller.rc())) return autoCaller.rc();395 352 396 353 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 405 362 ///////////////////////////////////////////////////////////////////////////// 406 363 407 int GuestFile:: callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)364 int GuestFile::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb) 408 365 { 409 366 AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER); … … 417 374 { 418 375 case GUEST_DISCONNECTED: 419 vrc = onGuestDisconnected(pCbCtx, pSvcCb);376 vrc = i_onGuestDisconnected(pCbCtx, pSvcCb); 420 377 break; 421 378 422 379 case GUEST_FILE_NOTIFY: 423 vrc = onFileNotify(pCbCtx, pSvcCb);380 vrc = i_onFileNotify(pCbCtx, pSvcCb); 424 381 break; 425 382 … … 436 393 } 437 394 438 int GuestFile:: closeFile(int *pGuestRc)395 int GuestFile::i_closeFile(int *pGuestRc) 439 396 { 440 397 LogFlowThisFunc(("strFile=%s\n", mData.mOpenInfo.mFileName.c_str())); … … 466 423 vrc = sendCommand(HOST_FILE_CLOSE, i, paParms); 467 424 if (RT_SUCCESS(vrc)) 468 vrc = waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,469 NULL /* FileStatus */, pGuestRc);425 vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */, 426 NULL /* FileStatus */, pGuestRc); 470 427 unregisterWaitEvent(pEvent); 471 428 … … 475 432 476 433 /* static */ 477 Utf8Str GuestFile:: guestErrorToString(int guestRc)434 Utf8Str GuestFile::i_guestErrorToString(int guestRc) 478 435 { 479 436 Utf8Str strError; … … 506 463 } 507 464 508 int GuestFile:: onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)465 int GuestFile::i_onFileNotify(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData) 509 466 { 510 467 AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER); … … 532 489 if (RT_FAILURE(guestRc)) 533 490 { 534 int rc2 = setFileStatus(FileStatus_Error, guestRc);491 int rc2 = i_setFileStatus(FileStatus_Error, guestRc); 535 492 AssertRC(rc2); 536 493 … … 546 503 case GUEST_FILE_NOTIFYTYPE_ERROR: 547 504 { 548 int rc2 = setFileStatus(FileStatus_Error, guestRc);505 int rc2 = i_setFileStatus(FileStatus_Error, guestRc); 549 506 AssertRC(rc2); 550 507 … … 570 527 571 528 /* Set the process status. */ 572 int rc2 = setFileStatus(FileStatus_Open, guestRc);529 int rc2 = i_setFileStatus(FileStatus_Open, guestRc); 573 530 AssertRC(rc2); 574 531 } … … 581 538 case GUEST_FILE_NOTIFYTYPE_CLOSE: 582 539 { 583 int rc2 = setFileStatus(FileStatus_Closed, guestRc);540 int rc2 = i_setFileStatus(FileStatus_Closed, guestRc); 584 541 AssertRC(rc2); 585 542 … … 692 649 } 693 650 694 int GuestFile:: onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)651 int GuestFile::i_onGuestDisconnected(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData) 695 652 { 696 653 AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER); 697 654 AssertPtrReturn(pSvcCbData, VERR_INVALID_POINTER); 698 655 699 int vrc = setFileStatus(FileStatus_Down, VINF_SUCCESS);656 int vrc = i_setFileStatus(FileStatus_Down, VINF_SUCCESS); 700 657 701 658 LogFlowFuncLeaveRC(vrc); … … 707 664 * from the public file list. 708 665 */ 709 int GuestFile:: onRemove(void)666 int GuestFile::i_onRemove(void) 710 667 { 711 668 LogFlowThisFuncEnter(); … … 731 688 } 732 689 733 int GuestFile:: openFile(uint32_t uTimeoutMS, int *pGuestRc)690 int GuestFile::i_openFile(uint32_t uTimeoutMS, int *pGuestRc) 734 691 { 735 692 LogFlowThisFuncEnter(); … … 777 734 vrc = sendCommand(HOST_FILE_OPEN, i, paParms); 778 735 if (RT_SUCCESS(vrc)) 779 vrc = waitForStatusChange(pEvent, uTimeoutMS,780 NULL /* FileStatus */, pGuestRc);736 vrc = i_waitForStatusChange(pEvent, uTimeoutMS, 737 NULL /* FileStatus */, pGuestRc); 781 738 782 739 unregisterWaitEvent(pEvent); … … 786 743 } 787 744 788 int GuestFile:: readData(uint32_t uSize, uint32_t uTimeoutMS,789 void* pvData, uint32_t cbData, uint32_t* pcbRead)745 int GuestFile::i_readData(uint32_t uSize, uint32_t uTimeoutMS, 746 void* pvData, uint32_t cbData, uint32_t* pcbRead) 790 747 { 791 748 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 828 785 vrc = sendCommand(HOST_FILE_READ, i, paParms); 829 786 if (RT_SUCCESS(vrc)) 830 vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);787 vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead); 831 788 832 789 if (RT_SUCCESS(vrc)) … … 844 801 } 845 802 846 int GuestFile:: readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS,847 void* pvData, size_t cbData, size_t* pcbRead)803 int GuestFile::i_readDataAt(uint64_t uOffset, uint32_t uSize, uint32_t uTimeoutMS, 804 void* pvData, size_t cbData, size_t* pcbRead) 848 805 { 849 806 LogFlowThisFunc(("uOffset=%RU64, uSize=%RU32, uTimeoutMS=%RU32, pvData=%p, cbData=%zu\n", … … 884 841 vrc = sendCommand(HOST_FILE_READ_AT, i, paParms); 885 842 if (RT_SUCCESS(vrc)) 886 vrc = waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead);843 vrc = i_waitForRead(pEvent, uTimeoutMS, pvData, cbData, &cbRead); 887 844 888 845 if (RT_SUCCESS(vrc)) … … 900 857 } 901 858 902 int GuestFile:: seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType,903 uint32_t uTimeoutMS, uint64_t *puOffset)859 int GuestFile::i_seekAt(int64_t iOffset, GUEST_FILE_SEEKTYPE eSeekType, 860 uint32_t uTimeoutMS, uint64_t *puOffset) 904 861 { 905 862 LogFlowThisFunc(("iOffset=%RI64, uTimeoutMS=%RU32\n", … … 940 897 vrc = sendCommand(HOST_FILE_SEEK, i, paParms); 941 898 if (RT_SUCCESS(vrc)) 942 vrc = waitForOffsetChange(pEvent, uTimeoutMS, puOffset);899 vrc = i_waitForOffsetChange(pEvent, uTimeoutMS, puOffset); 943 900 944 901 unregisterWaitEvent(pEvent); … … 949 906 950 907 /* static */ 951 HRESULT GuestFile:: setErrorExternal(VirtualBoxBase *pInterface, int guestRc)908 HRESULT GuestFile::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc) 952 909 { 953 910 AssertPtr(pInterface); 954 911 AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n")); 955 912 956 return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile:: guestErrorToString(guestRc).c_str());957 } 958 959 int GuestFile:: setFileStatus(FileStatus_T fileStatus, int fileRc)913 return pInterface->setError(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(guestRc).c_str()); 914 } 915 916 int GuestFile::i_setFileStatus(FileStatus_T fileStatus, int fileRc) 960 917 { 961 918 LogFlowThisFuncEnter(); … … 987 944 hr = errorInfo->initEx(VBOX_E_IPRT_ERROR, fileRc, 988 945 COM_IIDOF(IGuestFile), getComponentName(), 989 guestErrorToString(fileRc));946 i_guestErrorToString(fileRc)); 990 947 ComAssertComRC(hr); 991 948 } … … 1000 957 } 1001 958 1002 int GuestFile:: waitForOffsetChange(GuestWaitEvent *pEvent,1003 uint32_t uTimeoutMS, uint64_t *puOffset)959 int GuestFile::i_waitForOffsetChange(GuestWaitEvent *pEvent, 960 uint32_t uTimeoutMS, uint64_t *puOffset) 1004 961 { 1005 962 AssertPtrReturn(pEvent, VERR_INVALID_POINTER); … … 1029 986 } 1030 987 1031 int GuestFile::waitForRead(GuestWaitEvent *pEvent, 1032 uint32_t uTimeoutMS, 1033 void *pvData, size_t cbData, uint32_t *pcbRead) 988 int GuestFile::i_waitForRead(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, 989 void *pvData, size_t cbData, uint32_t *pcbRead) 1034 990 { 1035 991 AssertPtrReturn(pEvent, VERR_INVALID_POINTER); … … 1074 1030 } 1075 1031 1076 int GuestFile:: waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,1077 FileStatus_T *pFileStatus, int *pGuestRc)1032 int GuestFile::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, 1033 FileStatus_T *pFileStatus, int *pGuestRc) 1078 1034 { 1079 1035 AssertPtrReturn(pEvent, VERR_INVALID_POINTER); … … 1118 1074 } 1119 1075 1120 int GuestFile:: waitForWrite(GuestWaitEvent *pEvent,1121 uint32_t uTimeoutMS, uint32_t *pcbWritten)1076 int GuestFile::i_waitForWrite(GuestWaitEvent *pEvent, 1077 uint32_t uTimeoutMS, uint32_t *pcbWritten) 1122 1078 { 1123 1079 AssertPtrReturn(pEvent, VERR_INVALID_POINTER); … … 1147 1103 } 1148 1104 1149 int GuestFile:: writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,1150 uint32_t *pcbWritten)1105 int GuestFile::i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData, 1106 uint32_t *pcbWritten) 1151 1107 { 1152 1108 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 1190 1146 vrc = sendCommand(HOST_FILE_WRITE, i, paParms); 1191 1147 if (RT_SUCCESS(vrc)) 1192 vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);1148 vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten); 1193 1149 1194 1150 if (RT_SUCCESS(vrc)) … … 1206 1162 } 1207 1163 1208 int GuestFile:: writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS,1209 void *pvData, uint32_t cbData, uint32_t *pcbWritten)1164 int GuestFile::i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, 1165 void *pvData, uint32_t cbData, uint32_t *pcbWritten) 1210 1166 { 1211 1167 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 1250 1206 vrc = sendCommand(HOST_FILE_WRITE_AT, i, paParms); 1251 1207 if (RT_SUCCESS(vrc)) 1252 vrc = waitForWrite(pEvent, uTimeoutMS, &cbWritten);1208 vrc = i_waitForWrite(pEvent, uTimeoutMS, &cbWritten); 1253 1209 1254 1210 if (RT_SUCCESS(vrc)) … … 1266 1222 } 1267 1223 1268 // implementation of publicmethods1224 // Wrapped IGuestFile methods 1269 1225 ///////////////////////////////////////////////////////////////////////////// 1270 1271 STDMETHODIMP GuestFile::Close(void) 1226 HRESULT GuestFile::close() 1272 1227 { 1273 1228 #ifndef VBOX_WITH_GUEST_CONTROL … … 1275 1230 #else 1276 1231 LogFlowThisFuncEnter(); 1277 1278 AutoCaller autoCaller(this);1279 if (FAILED(autoCaller.rc())) return autoCaller.rc();1280 1232 1281 1233 /* Close file on guest. */ 1282 1234 int guestRc; 1283 int rc = closeFile(&guestRc);1235 int rc = i_closeFile(&guestRc); 1284 1236 /* On failure don't return here, instead do all the cleanup 1285 1237 * work first and then return an error. */ … … 1293 1245 { 1294 1246 if (rc == VERR_GSTCTL_GUEST_ERROR) 1295 return GuestFile:: setErrorExternal(this, guestRc);1247 return GuestFile::i_setErrorExternal(this, guestRc); 1296 1248 1297 1249 return setError(VBOX_E_IPRT_ERROR, … … 1304 1256 } 1305 1257 1306 STDMETHODIMP GuestFile::QueryInfo(IFsObjInfo **aInfo) 1307 { 1308 #ifndef VBOX_WITH_GUEST_CONTROL 1309 ReturnComNotImplemented(); 1310 #else 1311 AutoCaller autoCaller(this); 1312 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1313 1314 ReturnComNotImplemented(); 1315 #endif /* VBOX_WITH_GUEST_CONTROL */ 1316 } 1317 1318 STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData)) 1258 HRESULT GuestFile::queryInfo(ComPtr<IFsObjInfo> &aObjInfo) 1259 { 1260 #ifndef VBOX_WITH_GUEST_CONTROL 1261 ReturnComNotImplemented(); 1262 #else 1263 ReturnComNotImplemented(); 1264 #endif /* VBOX_WITH_GUEST_CONTROL */ 1265 } 1266 1267 HRESULT GuestFile::read(ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData) 1319 1268 { 1320 1269 #ifndef VBOX_WITH_GUEST_CONTROL … … 1323 1272 if (aToRead == 0) 1324 1273 return setError(E_INVALIDARG, tr("The size to read is zero")); 1325 CheckComArgOutSafeArrayPointerValid(aData);1326 1327 AutoCaller autoCaller(this);1328 if (FAILED(autoCaller.rc())) return autoCaller.rc();1329 1274 1330 1275 com::SafeArray<BYTE> data((size_t)aToRead); … … 1334 1279 1335 1280 uint32_t cbRead; 1336 int vrc = readData(aToRead, aTimeoutMS, 1337 data.raw(), aToRead, &cbRead); 1281 int vrc = i_readData(aToRead, aTimeoutMS, 1282 data.raw(), aToRead, &cbRead); 1283 1338 1284 if (RT_SUCCESS(vrc)) 1339 1285 { 1340 1286 if (data.size() != cbRead) 1341 1287 data.resize(cbRead); 1342 data.detachTo(ComSafeArrayOutArg(aData)); 1288 aData.resize(data.size()); 1289 for(size_t i = 0; i < data.size(); ++i) 1290 aData[i] = data[i]; 1343 1291 } 1344 1292 else … … 1358 1306 #endif /* VBOX_WITH_GUEST_CONTROL */ 1359 1307 } 1360 1361 STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData)) 1308 HRESULT GuestFile::readAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, std::vector<BYTE> &aData) 1309 1362 1310 { 1363 1311 #ifndef VBOX_WITH_GUEST_CONTROL … … 1366 1314 if (aToRead == 0) 1367 1315 return setError(E_INVALIDARG, tr("The size to read is zero")); 1368 CheckComArgOutSafeArrayPointerValid(aData);1369 1370 AutoCaller autoCaller(this);1371 if (FAILED(autoCaller.rc())) return autoCaller.rc();1372 1316 1373 1317 com::SafeArray<BYTE> data((size_t)aToRead); … … 1377 1321 1378 1322 size_t cbRead; 1379 int vrc = readDataAt(aOffset, aToRead, aTimeoutMS,1380 data.raw(), aToRead, &cbRead);1323 int vrc = i_readDataAt(aOffset, aToRead, aTimeoutMS, 1324 data.raw(), aToRead, &cbRead); 1381 1325 if (RT_SUCCESS(vrc)) 1382 1326 { 1383 1327 if (data.size() != cbRead) 1384 1328 data.resize(cbRead); 1385 data.detachTo(ComSafeArrayOutArg(aData)); 1329 aData.resize(data.size()); 1330 for(size_t i = 0; i < data.size(); ++i) 1331 aData[i] = data[i]; 1386 1332 } 1387 1333 else … … 1402 1348 } 1403 1349 1404 STDMETHODIMP GuestFile::Seek(LONG64 aOffset, FileSeekType_T aType)1350 HRESULT GuestFile::seek(LONG64 aOffset, FileSeekType_T aWhence) 1405 1351 { 1406 1352 #ifndef VBOX_WITH_GUEST_CONTROL … … 1409 1355 LogFlowThisFuncEnter(); 1410 1356 1411 AutoCaller autoCaller(this);1412 if (FAILED(autoCaller.rc())) return autoCaller.rc();1413 1414 1357 HRESULT hr = S_OK; 1415 1358 1416 1359 GUEST_FILE_SEEKTYPE eSeekType; 1417 switch (a Type)1360 switch (aWhence) 1418 1361 { 1419 1362 case FileSeekType_Set: … … 1430 1373 } 1431 1374 1432 int vrc = seekAt(aOffset, eSeekType,1433 30 * 1000 /* 30s timeout */, NULL /* puOffset */);1375 int vrc = i_seekAt(aOffset, eSeekType, 1376 30 * 1000 /* 30s timeout */, NULL /* puOffset */); 1434 1377 if (RT_FAILURE(vrc)) 1435 1378 { … … 1449 1392 } 1450 1393 1451 STDMETHODIMP GuestFile::SetACL(IN_BSTR aACL) 1452 { 1453 #ifndef VBOX_WITH_GUEST_CONTROL 1454 ReturnComNotImplemented(); 1455 #else 1456 AutoCaller autoCaller(this); 1457 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1458 1459 ReturnComNotImplemented(); 1460 #endif /* VBOX_WITH_GUEST_CONTROL */ 1461 } 1462 1463 STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten) 1394 HRESULT GuestFile::setACL(const com::Utf8Str &aAcl) 1395 { 1396 #ifndef VBOX_WITH_GUEST_CONTROL 1397 ReturnComNotImplemented(); 1398 #else 1399 ReturnComNotImplemented(); 1400 #endif /* VBOX_WITH_GUEST_CONTROL */ 1401 } 1402 1403 HRESULT GuestFile::write(const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten) 1464 1404 { 1465 1405 #ifndef VBOX_WITH_GUEST_CONTROL … … 1468 1408 LogFlowThisFuncEnter(); 1469 1409 1470 CheckComArgSafeArrayNotNull(aData);1471 CheckComArgOutPointerValid(aWritten);1472 1473 AutoCaller autoCaller(this);1474 if (FAILED(autoCaller.rc())) return autoCaller.rc();1475 1476 1410 HRESULT hr = S_OK; 1477 1411 1478 com::SafeArray<BYTE> data( ComSafeArrayInArg(aData));1479 int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),1480 (uint32_t*)aWritten);1412 com::SafeArray<BYTE> data(aData); 1413 int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(), 1414 (uint32_t*)aWritten); 1481 1415 if (RT_FAILURE(vrc)) 1482 1416 { … … 1496 1430 } 1497 1431 1498 STDMETHODIMP GuestFile::WriteAt(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten) 1432 HRESULT GuestFile::writeAt(LONG64 aOffset, const std::vector<BYTE> &aData, ULONG aTimeoutMS, ULONG *aWritten) 1433 1499 1434 { 1500 1435 #ifndef VBOX_WITH_GUEST_CONTROL … … 1503 1438 LogFlowThisFuncEnter(); 1504 1439 1505 CheckComArgSafeArrayNotNull(aData);1506 CheckComArgOutPointerValid(aWritten);1507 1508 AutoCaller autoCaller(this);1509 if (FAILED(autoCaller.rc())) return autoCaller.rc();1510 1511 1440 HRESULT hr = S_OK; 1512 1441 1513 com::SafeArray<BYTE> data( ComSafeArrayInArg(aData));1514 int vrc = writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(),1515 (uint32_t*)aWritten);1442 com::SafeArray<BYTE> data(aData); 1443 int vrc = i_writeData(aTimeoutMS, data.raw(), (uint32_t)data.size(), 1444 (uint32_t*)aWritten); 1516 1445 if (RT_FAILURE(vrc)) 1517 1446 { -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r50544 r50618 462 462 ///////////////////////////////////////////////////////////////////////////// 463 463 464 int GuestProcess:: callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)464 int GuestProcess::i_callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb) 465 465 { 466 466 AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER); … … 866 866 * removed from the public process list. 867 867 */ 868 int GuestProcess:: onRemove(void)868 int GuestProcess::i_onRemove(void) 869 869 { 870 870 LogFlowThisFuncEnter(); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r50559 r50618 293 293 Assert(mData.mNumObjects); 294 294 mData.mNumObjects--; 295 itDirs->second-> onRemove();295 itDirs->second->i_onRemove(); 296 296 itDirs->second->uninit(); 297 297 } … … 305 305 Assert(mData.mNumObjects); 306 306 mData.mNumObjects--; 307 itFiles->second-> onRemove();307 itFiles->second->i_onRemove(); 308 308 itFiles->second->uninit(); 309 309 } … … 317 317 Assert(mData.mNumObjects); 318 318 mData.mNumObjects--; 319 itProcs->second-> onRemove();319 itProcs->second->i_onRemove(); 320 320 itProcs->second->uninit(); 321 321 } … … 810 810 Utf8Str(strName).c_str(), mData.mSession.mID, mData.mDirectories.size() - 1, mData.mNumObjects - 1)); 811 811 812 rc = pDirectory-> onRemove();812 rc = pDirectory->i_onRemove(); 813 813 mData.mDirectories.erase(itDirs); 814 814 mData.mNumObjects--; … … 1043 1043 alock.release(); 1044 1044 1045 rc = pDirectory-> callbackDispatcher(pCtxCb, pSvcCb);1045 rc = pDirectory->i_callbackDispatcher(pCtxCb, pSvcCb); 1046 1046 } 1047 1047 else … … 1076 1076 alock.release(); 1077 1077 1078 rc = pFile-> callbackDispatcher(pCtxCb, pSvcCb);1078 rc = pFile->i_callbackDispatcher(pCtxCb, pSvcCb); 1079 1079 } 1080 1080 else … … 1167 1167 1168 1168 alock.release(); 1169 rc = pProcess-> callbackDispatcher(pCtxCb, pSvcCb);1169 rc = pProcess->i_callbackDispatcher(pCtxCb, pSvcCb); 1170 1170 } 1171 1171 else … … 1247 1247 Utf8Str(strName).c_str(), mData.mSession.mID, mData.mFiles.size() - 1, mData.mNumObjects - 1)); 1248 1248 1249 rc = pFile-> onRemove();1249 rc = pFile->i_onRemove(); 1250 1250 mData.mFiles.erase(itFiles); 1251 1251 mData.mNumObjects--; … … 1385 1385 { 1386 1386 int guestRc; 1387 rc = pFile-> openFile(30 * 1000 /* 30s timeout */, &guestRc);1387 rc = pFile->i_openFile(30 * 1000 /* 30s timeout */, &guestRc); 1388 1388 if ( rc == VERR_GSTCTL_GUEST_ERROR 1389 1389 && pGuestRc) … … 1875 1875 pProcess->getObjectID(), mData.mSession.mID, uPID, mData.mProcesses.size() - 1, mData.mNumObjects - 1)); 1876 1876 1877 rc = pProcess-> onRemove();1877 rc = pProcess->i_onRemove(); 1878 1878 mData.mProcesses.erase(itProcs); 1879 1879 mData.mNumObjects--; … … 2948 2948 2949 2949 case VERR_GSTCTL_GUEST_ERROR: 2950 hr = GuestFile:: setErrorExternal(this, guestRc);2950 hr = GuestFile::i_setErrorExternal(this, guestRc); 2951 2951 break; 2952 2952 … … 3285 3285 3286 3286 case VERR_GSTCTL_GUEST_ERROR: 3287 hr = GuestFile:: setErrorExternal(this, guestRc);3287 hr = GuestFile::i_setErrorExternal(this, guestRc); 3288 3288 break; 3289 3289 -
trunk/src/VBox/Main/src-client/xpcom/module.cpp
r50613 r50618 69 69 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest) 70 70 #ifdef VBOX_WITH_GUEST_CONTROL 71 NS_DECL_CLASSINFO(GuestFile)72 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestFile, IGuestFile, IFile)73 71 NS_DECL_CLASSINFO(GuestProcess) 74 72 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestProcess, IGuestProcess, IProcess)
Note:
See TracChangeset
for help on using the changeset viewer.