| title | IClientVirtualDeviceSet2::GetBufferHandle |
|---|---|
| titlesuffix | SQL Server VDI reference |
| description | This article provides reference for the IClientVirtualDeviceSet2::GetBufferHandle 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]
Some applications may require more than one process to operate on the buffers returned by IClientVirtualDevice2::GetCommand. In such cases, the process that receives the command can use GetBufferHandle to obtain a process independent handle that identifies the buffer. This handle can then be communicated to any other process that also has the same Virtual Device Set open. That process would then use IClientVirtualDeviceSet2::MapBufferHandle to obtain the address of the buffer. The address will likely be a different address than in its partner because each process may be mapping buffers at different addresses.
HRESULT IClientVirtualDeviceSet2::GetBufferHandle (
BYTE* pBuffer,
DWORD* pBufferHandle
);pBuffer This is the address of a buffer obtained from a Read or Write command.
pBufferHandle A unique identifier for the buffer is returned.
| Return Value | Explanation |
|---|---|
| NOERROR | The function succeeded. |
| VD_E_PROTOCOL | The virtual device set is not currently open. |
| VD_E_INVALID | The pBuffer is not a valid address. |
The process that invokes the GetBufferHandle function is responsible for invoking IClientVirtualDevice2::CompleteCommand when the data transfer is complete.
For more information, see the SQL Server virtual device interface reference overview.