IClientVirtualDeviceSet2::CreateEx

Microsoft SQL Server Virtual Backup

Microsoft SQL Server Virtual Backup Device Specification

IClientVirtualDeviceSet2::CreateEx

Purpose This function creates the virtual device set.
Syntax HRESULT IClientVirtualDeviceSet2::CreateEx (

   LPCWSTR         lpInstanceName,

   LPCWSTR         lpName,

   VDConfig*      pCfg

);

Parameters Argument Explanation
  lpInstanceName This string identifies the SQL Server instance to which the SQL command will be sent.
  lpName This identifies the virtual device set. The rules for names used by CreateFileMapping() must be followed. Any character except backslash (\) may be used. This is a wide-character Unicode string. Prefixing the string with the user's product or company name and database name is recommended.
  pCfg This is the configuration for the virtual device set. For more information, see Configuration.
Return Values Argument Explanation
  NOERROR The function succeeded.
  VD_E_NOTSUPPORTED One or more of the fields in the configuration was invalid or otherwise unsupported.
  VD_E_PROTOCOL The virtual device set has been created.
Remarks The CreateEx method should be called only once per BACKUP or RESTORE operation. After invoking the Close method, the client can reuse the interface to create another virtual device set.

The instance name must identify the instance to which the Transact-SQL is issued. NULL identifies the default instance. No "machineName\" prefix is accepted.

The CreateEx (and Create) calls will modify the security DACL on the process handle in the client process. Because of this, any other modification of the process handle must be serialized with invocation of CreateEx. CreateEx will serialize with other calls to CreateEx, but is unable to serialize with external processing. Access is granted to the account running the SQL Server service.

The CreateEx method supersedes the Create method defined in the original IClientVirtualDeviceSet. The original Create method is deprecated and should not be used in future development. The original Create method implements a form of instance name support with the _VIRTUAL_SERVER_NAME_ environment variable. If that variable is set in the environment, then the Create method internally calls CreateEx, passing the value of _VIRTUAL_SERVER_NAME_ as the instance name.