Changeset 79300 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 24, 2019 10:33:35 AM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r79287 r79300 14161 14161 The <link to="IFile::seek"/> is used to change this attribute without 14162 14162 transfering any file data like read and write does. 14163 14164 <note> This will not always be correct with older guest additions 14165 (version 5.2.30 and earlier, as well as versions 6.0.0 thru 6.0.8) 14166 after a calling <link to="IFile::readAt"/> or <link to="IFile::writeAt"/>, 14167 or after calling <link to="IFile::write"/> on a file in append mode. 14168 The correct file offset can be obtained using <link to="IFile::seek"/>.</note> 14169 14163 14170 </desc> 14164 14171 </attribute> -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r79296 r79300 298 298 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 299 299 300 /** @todo r=bird: Why do you have both a offset and a tell() function? 301 * After a ReadAt or WriteAt with a non-current offset, the tell() result will 302 * differ from this value, because mOffCurrent is only ever incremented with 303 * data read or written. */ 300 /* Note! This will not be accurate with older (< 5.2.32, 6.0.0 - 6.0.9) 301 guest additions when using writeAt, readAt or writing to a file 302 opened in append mode. */ 304 303 *aOffset = mData.mOffCurrent; 305 304 … … 507 506 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 508 507 509 mData.mOffCurrent += cbRead; 508 mData.mOffCurrent += cbRead; /* Bogus for readAt, which is why we've got GUEST_FILE_NOTIFYTYPE_READ_OFFSET. */ 510 509 511 510 alock.release(); … … 569 568 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 570 569 571 mData.mOffCurrent += cbWritten; 570 mData.mOffCurrent += cbWritten; /* Bogus for writeAt and append mode, thus GUEST_FILE_NOTIFYTYPE_WRITE_OFFSET. */ 572 571 573 572 alock.release(); … … 626 625 alock.release(); 627 626 628 fireGuestFileOffsetChangedEvent(mEventSource, mSession, this, mData.mOffCurrent, 0 /* Processed */);627 fireGuestFileOffsetChangedEvent(mEventSource, mSession, this, dataCb.u.seek.uOffActual, 0 /* Processed */); 629 628 } 630 629 break; … … 632 631 633 632 case GUEST_FILE_NOTIFYTYPE_TELL: 634 { 635 if (pSvcCbData->mParms == 4) 636 { 637 rc = HGCMSvcGetU64(&pSvcCbData->mpaParms[idx++], &dataCb.u.tell.uOffActual); 638 if (RT_FAILURE(rc)) 639 break; 640 641 Log3ThisFunc(("uOffActual=%RU64\n", dataCb.u.tell.uOffActual)); 642 643 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 644 645 mData.mOffCurrent = dataCb.u.tell.uOffActual; 646 647 alock.release(); 648 649 fireGuestFileOffsetChangedEvent(mEventSource, mSession, this, mData.mOffCurrent, 0 /* Processed */); 650 } 633 /* We don't issue any HOST_MSG_FILE_TELL, so we shouldn't get these notifications! */ 634 AssertFailed(); 651 635 break; 652 }653 636 654 637 case GUEST_FILE_NOTIFYTYPE_SET_SIZE:
Note:
See TracChangeset
for help on using the changeset viewer.