IVdsVDisk::Surface Method
Surfaces a virtual disk.
Syntax
HRESULT Surface(
[in] LPWSTR pStringSecurityDescriptor,
[in] SURFACE_VIRTUAL_DISK_FLAG Flags,
[in] ULONG ProviderSpecificFlags,
[in] ULONG TimeoutInMs,
[out] IVdsAsync **ppAsync
);
Parameters
pStringSecurityDescriptor [in]
A string that contains the security descriptor for the virtual disk. If not specified, the security descriptor for the backing file is used.Flags [in]
A bitmask of SURFACE_VIRTUAL_DISK_FLAG enumeration values that specify the virtual disk to be surfaced. Possible values include the following.Value Meaning SURFACE_VIRTUAL_DISK_FLAG_NONE 0x00000000 No flags are specified.
SURFACE_VIRTUAL_DISK_FLAG_READ_ONLY 0x00000001 Surfaces the virtual disk as read-only.
SURFACE_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER 0x00000002 Do not use this flag. Use SURFACE_VIRTUAL_DISK_FLAG_HIDDEN_VOLUMES instead.
SURFACE_VIRTUAL_DISK_FLAG_PERMANENT_LIFETIME 0x00000004 This flag is reserved for system use.
SURFACE_VIRTUAL_DISK_FLAG_NO_LOCAL_HOST 0x00000008 The drive will be surfaced to a virtual machine and not to the local computer.
SURFACE_VIRTUAL_DISK_FLAG_BOOT_DRIVE 0x00000010 The drive will be surfaced as the boot device.
SURFACE_VIRTUAL_DISK_FLAG_HIDDEN_VOLUMES 0x00000020 All volumes on the virtual disk will be mounted as hidden volumes.
ProviderSpecificFlags [in]
A bitmask of flags that are specific to the type of virtual disk that is being surfaced. These flags are provider-specific. For the Microsoft virtual disk provider, this parameter must be zero.TimeoutInMs [in]
The length of time, in milliseconds, before this method should return after waiting for the virtual disk to be surfaced completely. If this parameter is zero, the method returns immediately without waiting for the disk to be surfaced. If this parameter is INFINITE, the method does not return until the surfacing operation is complete. If this parameter is set to a value other than zero or INFINITE and the time-out value is reached, the method guarantees that the disk is not surfaced after the operation is complete.ppAsync [out]
A pointer to an IVdsAsync interface that upon successful completion receives the IVdsAsync interface to monitor and control this operation. Callers must release the interface received when they are done with it. If the IVdsAsync::Wait method is called on the interface and a success HRESULT value is returned, the interfaces returned in the VDS_ASYNC_OUTPUT structure must be released by calling the IUnknown::Release method on each interface pointer. However, if Wait returns a failure HRESULT value, or if the pHrResult parameter of Wait receives a failure HRESULT value, the interface pointers in the VDS_ASYNC_OUTPUT structure are NULL and do not need to be released. You can test for success or failure HRESULT values by using the SUCCEEDED and FAILED macros defined in Winerror.h.
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. |
Requirements
| Minimum supported client | Windows 7 |
| Minimum supported server | Windows Server 2008 R2 |
| Header | Vds.h |
| Library | Uuid.lib |
See Also
Send comments about this topic to Microsoft
Build date: 3/19/2009