VirtualBox

Ignore:
Timestamp:
Mar 23, 2009 7:28:13 PM (16 years ago)
Author:
vboxsync
Message:

Main: add read/write param to OpenHardDisk to allow for opening disk images during import without requiring write access

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r18049 r18162  
    11251125    ComObjPtr<HardDisk> hardDisk;
    11261126    hardDisk.createObject();
    1127     rc = hardDisk->init (this, format, aLocation);
     1127    rc = hardDisk->init(this, format, aLocation);
    11281128
    11291129    if (SUCCEEDED (rc))
     
    11331133}
    11341134
    1135 STDMETHODIMP VirtualBox::OpenHardDisk(IN_BSTR aLocation,
    1136                                       IHardDisk **aHardDisk)
     1135STDMETHODIMP VirtualBox::OpenHardDisk(IN_BSTR aLocation, BOOL fWrite, IHardDisk **aHardDisk)
    11371136{
    11381137    CheckComArgNotNull(aLocation);
     
    11481147    ComObjPtr<HardDisk> hardDisk;
    11491148    hardDisk.createObject();
    1150     rc = hardDisk->init (this, aLocation);
     1149    rc = hardDisk->init(this,
     1150                        aLocation,
     1151                        (fWrite) ? HardDisk::OpenReadWrite : HardDisk::OpenReadOnly );
    11511152
    11521153    if (SUCCEEDED (rc))
     
    30913092                ComObjPtr<HardDisk> hardDisk;
    30923093                hardDisk.createObject();
    3093                 rc = hardDisk->init (this, NULL, *it);
     3094                rc = hardDisk->init(this, NULL, *it);
    30943095                CheckComRCBreakRC (rc);
    30953096
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