IVdsVDisk::Open method (vds.h)

[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]

Opens a handle to the specified virtual disk file and returns an IVdsOpenVDisk interface pointer to the object that represents the opened handle.

Syntax

HRESULT Open(
  [in]  VIRTUAL_DISK_ACCESS_MASK AccessMask,
  [in]  OPEN_VIRTUAL_DISK_FLAG   Flags,
  [in]  ULONG                    ReadWriteDepth,
  [out] IVdsOpenVDisk            **ppOpenVDisk
);

Parameters

[in] AccessMask

A bitmask of VIRTUAL_DISK_ACCESS_MASK flags specifying the access rights to be applied to the opened virtual disk.

[in] Flags

A bitmask of OPEN_VIRTUAL_DISK_FLAG flags specifying how the virtual disk is to be opened.

[in] ReadWriteDepth

The number of stores (backing files), beginning with the child, of the backing store chain to open read/write. The remaining stores in the differencing chain will be opened read-only. (This is necessary for merge operations to succeed.)

[out] ppOpenVDisk

A pointer to a variable that receives an IVdsOpenVDisk interface pointer to the newly created object that represents the handle opened to the virtual disk object. Callers must release the interface pointer when it is no longer needed by calling the IUnknown::Release method.

Return value

This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.

Return code Description
S_OK
The method completed successfully.

Remarks

Applications must initialize process-wide security by calling the CoInitializeSecurity function. The dwImpLevel parameter should be set to RPC_C_IMP_LEVEL_IMPERSONATE.

Windows Server 2008, Windows Vista and Windows Server 2003:  These actions are not required until Windows 7 and Windows Server 2008 R2.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header vds.h
Library Uuid.lib

See also

IVdsVDisk