Changeset 55668 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 5, 2015 3:45:27 PM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55633 r55668 9981 9981 <enum 9982 9982 name="FileSeekOrigin" 9983 uuid=" 939ba94f-497a-4119-ebd3-d193e176c98e"9983 uuid="ad32f789-4279-4530-979c-f16892e1c263" 9984 9984 > 9985 9985 <desc> … … 9987 9987 </desc> 9988 9988 9989 <const name=" Set"value="0">9990 <desc>Seek from the startof the file.</desc>9989 <const name="Begin" value="0"> 9990 <desc>Seek from the beginning of the file.</desc> 9991 9991 </const> 9992 9992 <const name="Current" value="1"> … … 10559 10559 10560 10560 <enum 10561 name="FileOpenExFlags" 10562 uuid="9d62017b-ddd3-4e5a-a08e-14d1c23bbac1" 10563 > 10564 <desc> 10565 Open flags for <link to="IGuestSession::fileOpenEx"/>. 10566 </desc> 10567 <const name="None" value="0"> 10568 <desc>No flag set.</desc> 10569 </const> 10570 </enum> 10571 10572 <enum 10561 10573 name="FileStatus" 10562 10574 uuid="8c86468b-b97b-4080-8914-e29f5b0abd2c" … … 10968 10980 <interface 10969 10981 name="IGuestSession" extends="$unknown" 10970 uuid=" 91306653-4e3a-88cb-a809-85ae64ceb4fd"10982 uuid="3cbf62cf-c9cd-48c6-9623-d1dbe54ca557" 10971 10983 wsmap="managed" 10972 10984 > … … 11682 11694 </desc> 11683 11695 </param> 11684 <!-- r=bird: Use case for the 'offset' parameter, please? I see no possible rational, especially with readAt/writeAt/seek handy. 11685 Or is this an alternative way of doing "append" accessMode? Anyway, it's pretty harmless... --> 11686 <param name="offset" type="long long" dir="in"> 11687 <desc>The initial read/write offset (in bytes).</desc> 11696 <param name="flags" type="FileOpenExFlags" dir="in" safearray="yes"> 11697 <desc>Zero or more <link to="FileOpenExFlags"/> values. </desc> 11688 11698 </param> 11689 11699 <param name="file" type="IGuestFile" dir="return"> -
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r55644 r55668 610 610 /** Octal creation mode. */ 611 611 uint32_t mCreationMode; 612 /** The initial offset on open. */613 uint 64_t mInitialOffset;612 /** Extended open flags (currently none defined). */ 613 uint32_t mfOpenEx; 614 614 }; 615 615 -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r55631 r55668 353 353 FileSharingMode_T aSharingMode, 354 354 ULONG aCreationMode, 355 LONG64 aOffset,355 const std::vector<FileOpenExFlags_T> &aFlags, 356 356 ComPtr<IGuestFile> &aFile); 357 357 HRESULT fileQuerySize(const com::Utf8Str &aPath, -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r55645 r55668 475 475 pSvcCbData->mpaParms[idx++].getUInt32(&dataCb.u.open.uHandle); 476 476 477 { 478 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 479 AssertMsg(mData.mID == VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID), 480 ("File ID %RU32 does not match context ID %RU32\n", mData.mID, 481 VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID))); 482 483 /* Set the initial offset. On the guest the whole opening operation 484 * would fail if an initial seek isn't possible. */ 485 mData.mOffCurrent = mData.mOpenInfo.mInitialOffset; 486 } 477 AssertMsg(mData.mID == VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID), 478 ("File ID %RU32 does not match context ID %RU32\n", mData.mID, 479 VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pCbCtx->uContextID))); 487 480 488 481 /* Set the process status. */ … … 654 647 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 655 648 656 LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32, uOffset=%RU64\n",649 LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32, mfOpenEx=%RU32\n", 657 650 mData.mOpenInfo.mFileName.c_str(), mData.mOpenInfo.mAccessMode, mData.mOpenInfo.mpszAccessMode, 658 651 mData.mOpenInfo.mOpenAction, mData.mOpenInfo.mpszOpenAction, mData.mOpenInfo.mCreationMode, 659 mData.mOpenInfo.m InitialOffset));652 mData.mOpenInfo.mfOpenEx)); 660 653 int vrc; 661 654 … … 686 679 paParms[i++].setString(""); /** @todo sharing mode. */ 687 680 paParms[i++].setUInt32(mData.mOpenInfo.mCreationMode); 688 paParms[i++].setUInt64(mData.mOpenInfo.mInitialOffset); 681 paParms[i++].setUInt64(0 /* initial offset */); 682 /** @todo Next protocol version: add flags, replace strings, remove initial offset. */ 689 683 690 684 alock.release(); /* Drop write lock before sending. */ … … 1300 1294 switch (aWhence) 1301 1295 { 1302 case FileSeekOrigin_ Set:1296 case FileSeekOrigin_Begin: 1303 1297 eSeekType = GUEST_FILE_SEEKTYPE_BEGIN; 1304 1298 break; -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r55645 r55668 1232 1232 ComObjPtr<GuestFile> &pFile, int *pGuestRc) 1233 1233 { 1234 LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32 , uOffset=%RU64\n",1234 LogFlowThisFunc(("strFile=%s, enmAccessMode=%d (%s) enmOpenAction=%d (%s) uCreationMode=%RU32 mfOpenEx=%RU32\n", 1235 1235 openInfo.mFileName.c_str(), openInfo.mAccessMode, openInfo.mpszAccessMode, 1236 openInfo.mOpenAction, openInfo.mpszOpenAction, openInfo.mCreationMode, openInfo.m InitialOffset));1236 openInfo.mOpenAction, openInfo.mpszOpenAction, openInfo.mCreationMode, openInfo.mfOpenEx)); 1237 1237 1238 1238 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2978 2978 { 2979 2979 LogFlowThisFuncEnter(); 2980 return fileOpenEx(aPath, aAccessMode, aOpenAction, FileSharingMode_All, aCreationMode, 0 /* aOffset */, aFile); 2980 const std::vector<FileOpenExFlags_T> EmptyFlags; 2981 return fileOpenEx(aPath, aAccessMode, aOpenAction, FileSharingMode_All, aCreationMode, EmptyFlags, aFile); 2981 2982 } 2982 2983 2983 2984 HRESULT GuestSession::fileOpenEx(const com::Utf8Str &aPath, FileAccessMode_T aAccessMode, FileOpenAction_T aOpenAction, 2984 FileSharingMode_T aSharingMode, ULONG aCreationMode, LONG64 aOffset, ComPtr<IGuestFile> &aFile) 2985 FileSharingMode_T aSharingMode, ULONG aCreationMode, 2986 const std::vector<FileOpenExFlags_T> &aFlags, ComPtr<IGuestFile> &aFile) 2985 2987 { 2986 2988 LogFlowThisFuncEnter(); … … 2996 2998 openInfo.mFileName = aPath; 2997 2999 openInfo.mCreationMode = aCreationMode; 2998 openInfo.mInitialOffset = aOffset;2999 3000 3000 3001 /* convert + validate aAccessMode to the old format. */ … … 3045 3046 return setError(E_INVALIDARG, tr("Unknown FileOpenAction value %u (%#x)"), aAccessMode, aAccessMode); 3046 3047 } 3048 3049 /* Combine and validate flags. */ 3050 uint32_t fOpenEx = 0; 3051 for (size_t i = 0; i < aFlags.size(); i++) 3052 fOpenEx = aFlags[i]; 3053 if (fOpenEx) 3054 return setError(E_INVALIDARG, tr("Unsupported FileOpenExFlags values in aFlags (%#x)"), fOpenEx); 3055 openInfo.mfOpenEx = fOpenEx; 3047 3056 3048 3057 ComObjPtr <GuestFile> pFile;
Note:
See TracChangeset
for help on using the changeset viewer.