Name

GetSharedFolderState

Description

HRESULT
GetSharedFolderState([in] LONG index,
                     [in] ICallback* jobDoneCallback,
                     [out,retval] IJob** getJob);

This function returns the state of a shared folder mounted in the virtual machine.

Parameters

index
Identifies the shared folder.
jobDoneCallback
A callback function that will be invoked when the operation is complete.
getJob
Returns an IJob object that describes the state of this asynchronous operation.

Return Value

HRESULT

Remarks

Side Effects

None.

Requirements

VixCOM.h, since VMware Workstation 6.0

Example

Dim numResults
Dim results
Dim job
Dim error

Set job = vm.GetNumSharedFolders(Nothing)
err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT), results)
If lib.ErrorIndicatesFailure(err) Then
   WScript.Echo("Error: " & lib.GetErrorText(err, empty))
   WScript.Quit
End If
numResults = results(0)

Dim propIds
Redim propIds(2)
' Build an array of properties to request
propIds(0) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_ITEM_NAME
propIds(1) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST
propIds(2) = VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS
For i=0 to numResults-1
   Set job = vm.GetSharedFolderState(i, Nothing)
   ' Wait for the result, and get the result properties  
   err = job.Wait(propIds, results)
   If lib.ErrorIndicatesFailure(err) Then
      WScript.Echo("Error: " & lib.GetErrorText(err, empty))
      WScript.Quit
   End If
   folderName = results(0)       ' VIX_PROPERTY_JOB_RESULT_ITEM_NAME
   folderHostPath = results(1)   ' VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST
   folderFlags = results(2)      ' VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS
   WScript.Echo(folderName & " on " & folderHostPath & " with flags: " & folderFlags)
Next

Set results = Nothing
Set job = Nothing

Copyright (C) 2007-2011 VMware, Inc. All rights reserved.