VirtualBox

Changeset 42818 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 15, 2012 9:45:06 AM (12 years ago)
Author:
vboxsync
Message:

Guest Control 2.0: Use timeouts for IFile operations, renamed size to toRead.

Location:
trunk/src/VBox/Main
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r42810 r42818  
    1030210302        <desc>Handle to read from. Usually 0 is stdin.</desc>
    1030310303      </param>
    10304       <param name="size" type="unsigned long" dir="in">
     10304      <param name="toRead" type="unsigned long" dir="in">
    1030510305        <desc>Number of bytes to read.</desc>
    1030610306      </param>
     
    1044710447  <interface
    1044810448    name="IFile" extends="$unknown"
    10449     uuid="b3484293-b98b-4952-ae23-f18eca6a5ff9"
     10449    uuid="b702a560-6139-4a8e-a892-bbf14b97bf97"
    1045010450    wsmap="managed"
    1045110451    >
     
    1053910539        <desc>Number of bytes to read.</desc>
    1054010540      </param>
    10541       <param name="read" type="unsigned long" dir="out">
    10542         <desc>How much bytes were read.</desc>
     10541      <param name="timeoutMS" type="unsigned long" dir="in">
     10542        <desc>
     10543          Timeout (in ms) to wait for the operation to complete.
     10544          Pass 0 for an infinite timeout.
     10545        </desc>
    1054310546      </param>
    1054410547      <param name="data" type="octet" dir="return" safearray="yes">
     
    1056110564        <desc>Number of bytes to read.</desc>
    1056210565      </param>
    10563       <param name="read" type="unsigned long" dir="out">
    10564         <desc>How much bytes were read.</desc>
     10566      <param name="timeoutMS" type="unsigned long" dir="in">
     10567        <desc>
     10568          Timeout (in ms) to wait for the operation to complete.
     10569          Pass 0 for an infinite timeout.
     10570        </desc>
    1056510571      </param>
    1056610572      <param name="data" type="octet" dir="return" safearray="yes">
     
    1061010616        </desc>
    1061110617      </param>
     10618      <param name="timeoutMS" type="unsigned long" dir="in">
     10619        <desc>
     10620          Timeout (in ms) to wait for the operation to complete.
     10621          Pass 0 for an infinite timeout.
     10622        </desc>
     10623      </param>
    1061210624      <param name="written" type="unsigned long" dir="return">
    1061310625        <desc>How much bytes were written.</desc>
     
    1063010642          Array of bytes to write. The size of the array also specifies
    1063110643          how much to write.
     10644        </desc>
     10645      </param>
     10646      <param name="timeoutMS" type="unsigned long" dir="in">
     10647        <desc>
     10648          Timeout (in ms) to wait for the operation to complete.
     10649          Pass 0 for an infinite timeout.
    1063210650        </desc>
    1063310651      </param>
  • trunk/src/VBox/Main/include/GuestFileImpl.h

    r42611 r42818  
    6363    STDMETHOD(Close)(void);
    6464    STDMETHOD(QueryInfo)(IFsObjInfo **aInfo);
    65     STDMETHOD(Read)(ULONG aToRead, ULONG *aRead, ComSafeArrayOut(BYTE, aData));
    66     STDMETHOD(ReadAt)(LONG64 aOffset, ULONG aToRead, ULONG *aRead, ComSafeArrayOut(BYTE, aData));
     65    STDMETHOD(Read)(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
     66    STDMETHOD(ReadAt)(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
    6767    STDMETHOD(Seek)(LONG64 aOffset, FileSeekType_T aType);
    6868    STDMETHOD(SetACL)(IN_BSTR aACL);
    69     STDMETHOD(Write)(ComSafeArrayIn(BYTE, aData), ULONG *aWritten);
    70     STDMETHOD(WriteAt)(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG *aWritten);
     69    STDMETHOD(Write)(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
     70    STDMETHOD(WriteAt)(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
    7171    /** @}  */
    7272
  • trunk/src/VBox/Main/include/GuestProcessImpl.h

    r42718 r42818  
    6161    STDMETHOD(COMGETTER(Status))(ProcessStatus_T *aStatus);
    6262
    63     STDMETHOD(Read)(ULONG aHandle, ULONG aSize, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
     63    STDMETHOD(Read)(ULONG aHandle, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
    6464    STDMETHOD(Terminate)(void);
    6565    STDMETHOD(WaitFor)(ULONG aWaitFlags, ULONG aTimeoutMS, ProcessWaitResult_T *aReason);
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r42611 r42818  
    246246}
    247247
    248 STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG *aRead, ComSafeArrayOut(BYTE, aData))
    249 {
    250 #ifndef VBOX_WITH_GUEST_CONTROL
    251     ReturnComNotImplemented();
    252 #else
    253     AutoCaller autoCaller(this);
    254     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    255 
    256     ReturnComNotImplemented();
    257 #endif /* VBOX_WITH_GUEST_CONTROL */
    258 }
    259 
    260 STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG *aRead, ComSafeArrayOut(BYTE, aData))
     248STDMETHODIMP GuestFile::Read(ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
     249{
     250#ifndef VBOX_WITH_GUEST_CONTROL
     251    ReturnComNotImplemented();
     252#else
     253    AutoCaller autoCaller(this);
     254    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     255
     256    ReturnComNotImplemented();
     257#endif /* VBOX_WITH_GUEST_CONTROL */
     258}
     259
     260STDMETHODIMP GuestFile::ReadAt(LONG64 aOffset, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
    261261{
    262262#ifndef VBOX_WITH_GUEST_CONTROL
     
    294294}
    295295
    296 STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG *aWritten)
    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     ReturnComNotImplemented();
    305 #endif /* VBOX_WITH_GUEST_CONTROL */
    306 }
    307 
    308 STDMETHODIMP GuestFile::WriteAt(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG *aWritten)
    309 {
    310 #ifndef VBOX_WITH_GUEST_CONTROL
    311     ReturnComNotImplemented();
    312 #else
    313     AutoCaller autoCaller(this);
    314     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    315 
    316     ReturnComNotImplemented();
    317 #endif /* VBOX_WITH_GUEST_CONTROL */
    318 }
    319 
     296STDMETHODIMP GuestFile::Write(ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
     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    ReturnComNotImplemented();
     305#endif /* VBOX_WITH_GUEST_CONTROL */
     306}
     307
     308STDMETHODIMP GuestFile::WriteAt(LONG64 aOffset, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten)
     309{
     310#ifndef VBOX_WITH_GUEST_CONTROL
     311    ReturnComNotImplemented();
     312#else
     313    AutoCaller autoCaller(this);
     314    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     315
     316    ReturnComNotImplemented();
     317#endif /* VBOX_WITH_GUEST_CONTROL */
     318}
     319
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r42810 r42818  
    15011501/////////////////////////////////////////////////////////////////////////////
    15021502
    1503 STDMETHODIMP GuestProcess::Read(ULONG aHandle, ULONG aSize, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
     1503STDMETHODIMP GuestProcess::Read(ULONG aHandle, ULONG aToRead, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData))
    15041504{
    15051505#ifndef VBOX_WITH_GUEST_CONTROL
    15061506    ReturnComNotImplemented();
    15071507#else
    1508     if (aSize == 0)
     1508    if (aToRead == 0)
    15091509        return setError(E_INVALIDARG, tr("The size to read is zero"));
    15101510    CheckComArgOutSafeArrayPointerValid(aData);
     
    15131513    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    15141514
    1515     com::SafeArray<BYTE> data((size_t)aSize);
    1516     Assert(data.size() >= aSize);
     1515    com::SafeArray<BYTE> data((size_t)aToRead);
     1516    Assert(data.size() >= aToRead);
    15171517
    15181518    size_t cbRead;
    1519     int vrc = readData(aHandle, aSize, aTimeoutMS, data.raw(), aSize, &cbRead);
     1519    int vrc = readData(aHandle, aToRead, aTimeoutMS, data.raw(), aToRead, &cbRead);
    15201520    if (RT_SUCCESS(vrc))
    15211521    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette