vm.go
func (v *VM) SetSharedFolderState(name, hostpath string, options SharedFolderOption) error {
	var jobHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK

	sfname := C.CString(name)
	hpath := C.CString(hostpath)
	defer C.free(unsafe.Pointer(sfname))
	defer C.free(unsafe.Pointer(hpath))

	jobHandle = C.VixVM_SetSharedFolderState(v.handle, //vmHandle
		sfname, //shareName
		hpath,  //hostPathName
		C.VixMsgSharedFolderOptions(options), //flags
		nil, //callbackProc
		nil) //clientData

	defer C.Vix_ReleaseHandle(jobHandle)

	err = C.vix_job_wait(jobHandle)
	if C.VIX_OK != err {
		return &Error{
			Operation: "vm.SetSharedFolderState",
			Code:      int(err & 0xFFFF),
			Text:      C.GoString(C.Vix_GetErrorText(err, nil)),
		}
	}

	C.Vix_ReleaseHandle(v.handle)
	return nil
}
func (v *VM) SetSharedFolderState(name, hostpath string, options SharedFolderOption) error {
	var jobHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK

	sfname := C.CString(name)
	hpath := C.CString(hostpath)
	defer C.free(unsafe.Pointer(sfname))
	defer C.free(unsafe.Pointer(hpath))

	jobHandle = C.VixVM_SetSharedFolderState(v.handle, //vmHandle
		sfname, //shareName
		hpath,  //hostPathName
		C.VixMsgSharedFolderOptions(options), //flags
		nil, //callbackProc
		nil) //clientData

	defer C.Vix_ReleaseHandle(jobHandle)

	err = C.vix_job_wait(jobHandle)
	if C.VIX_OK != err {
		return &Error{
			Operation: "vm.SetSharedFolderState",
			Code:      int(err & 0xFFFF),
			Text:      C.GoString(C.Vix_GetErrorText(err, nil)),
		}
	}

	C.Vix_ReleaseHandle(v.handle)
	return nil
}
// SetSharedFolderState modifies the state of a shared folder mounted in the virtual
// machine.
//
// Parameters:
//
//   name: Specifies the name of the shared folder.
//   hostpath: Specifies the host path of the shared folder.
//   options: The new flag settings.
//
// Remarks:
//
//   * This function modifies the state flags of an existing shared folder.
//
//   * If the shared folder does not exist before calling
//     this function, the function will return a not found error.
//
//   * Shared folders are not supported for the following guest operating
//     systems: Windows ME, Windows 98, Windows 95, Windows 3.x, and DOS.
//
//   * In this release, this function requires the virtual machine to be powered
//     on with VMware Tools installed.
//
// Since VMware Workstation 6.0
//