vm.go
func (v *VM) SharedFolderState(index int) (string, string, int, error) {
	var jobHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK
	var (
		folderName, folderHostPath *C.char
		folderFlags                *C.int
	)

	jobHandle = C.VixVM_GetSharedFolderState(v.handle, //vmHandle
		C.int(index), //index
		nil,          //callbackProc
		nil)          //clientData

	defer C.Vix_ReleaseHandle(jobHandle)

	err = C.get_shared_folder(jobHandle, folderName, folderHostPath, folderFlags)
	defer C.Vix_FreeBuffer(unsafe.Pointer(folderName))
	defer C.Vix_FreeBuffer(unsafe.Pointer(folderHostPath))

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

	C.Vix_ReleaseHandle(v.handle)
	return C.GoString(folderName), C.GoString(folderHostPath), int(*folderFlags),
		nil
}
func (v *VM) SharedFolderState(index int) (string, string, int, error) {
	var jobHandle C.VixHandle = C.VIX_INVALID_HANDLE
	var err C.VixError = C.VIX_OK
	var (
		folderName, folderHostPath *C.char
		folderFlags                *C.int
	)

	jobHandle = C.VixVM_GetSharedFolderState(v.handle, //vmHandle
		C.int(index), //index
		nil,          //callbackProc
		nil)          //clientData

	defer C.Vix_ReleaseHandle(jobHandle)

	err = C.get_shared_folder(jobHandle, folderName, folderHostPath, folderFlags)
	defer C.Vix_FreeBuffer(unsafe.Pointer(folderName))
	defer C.Vix_FreeBuffer(unsafe.Pointer(folderHostPath))

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

	C.Vix_ReleaseHandle(v.handle)
	return C.GoString(folderName), C.GoString(folderHostPath), int(*folderFlags),
		nil
}
// SharedFolderState returns the state of a shared folder mounted in the virtual
// machine.
//
// Parameters:
//
//   index: Identifies the shared folder
//
// Remarks:
//
//   * Shared folders are indexed from 0 to n-1, where n is the number of shared
//     folders. Use the function VM.NumSharedFolders() to get the value of n.
//
//   * 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
//