| title | IServerVirtualDeviceSet2::OpenDevice |
|---|---|
| titlesuffix | SQL Server VDI reference |
| description | This article provides reference for the IServerVirtualDeviceSet2::OpenDevice command. |
| ms.date | 08/30/2019 |
| ms.prod | sql |
| ms.prod_service | backup-restore |
| ms.technology | backup-restore |
| ms.topic | reference |
| author | mashamsft |
| ms.author | mathoma |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md]
The OpenDevice function obtains virtual device interfaces from the virtual device set.
HRESULT IServerVirtualDeviceSet2::OpenDevice (
LPCWSTR lpName,
IServerVirtualDevice** ppVirtualDevice
);lpName This is provided from the first VIRTUAL_DEVICE= clause of the BACKUP or RESTORE command. This name is used as the key to obtain access to the virtual device set created by the client.
ppVirtualDevice This is used to return a virtual device interface.
| Return Value | Explanation |
|---|---|
| NOERROR | The function succeeded. |
| VD_E_OPEN | All devices have been opened. |
Each call returns the next unopened device. The function can be called only the number of times equal to the number of devices specified in the virtual device set configuration.
For more information, see the SQL Server virtual device interface reference overview.