VixDiskLib_Connect() connects the library to either a local VMware host or a remote server. For hosted disk on the local system, provide null values for most connection parameters. For managed disk on vSphere, specify virtual machine name, vCenter Server or ESXi host, user name, password, and port number.
vixError = VixDiskLib_Connect(&cnxParams, &srcConnection)
Always call VixDiskLib_Disconnect() before the end of your program.
Calling vixDiskLib_Disconnect() invalidates any open file handles, so if you use the VixMntapi library, call VixMntApi_CloseDiskSet() before calling disconnect.
You can opt to use the VixDiskLibSSPICreds connection parameter to enable Security Support Provider Interface (SSPI) authentication. SSPI has the advantage of not storing plain text passwords in configuration files or in the registry. In order to be able to use SSPI, the following conditions must be met:
If your setup meets all these conditions, you can enable SSPI authentication by setting USERNAME to __sspi__. For SSPI, the password must be set, but it is ignored. It can be set to "" (null string).