Name
GetProperties
Description
HRESULT
GetProperties([in] VARIANT propertyIDs,
[in,out] VARIANT* propertiesArray,
[out,retval] ULONGLONG* error);
This
method
allows you to get one or more properties from a handle.
For a list of property IDs, see Topics > Types > VixPropertyID.
Parameters
- propertyIDs
-
An array of propertyIDs to identify the properties
to fetch.
- propertiesArray
-
An returned array that stores the properties
identified by the array "propertyIDs". Each
element in "propertiesArray" matches the
correspoding indentifier in "propertiesArray";
for example, if the first element in the "propertyIDs" array
is VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE,
the first element in "propertiesArray" will be the
object that is the result of this job, if one exists.
- error
-
This returns VIX_OK if the method call succeeded, otherwise the
return value indicates an error.
Return Value
HRESULT
Remarks
- This function allows you to get one or more properties from a handle.
You may use this function on any type of handle, but only specific
properties are defined for each handle.
- When
GetProperties()
returns an error, the values of the output
parameters are indeterminate.
- The value of
VixCOM.Constants.VIX_PROPERTY_VM_TOOLS_STATE
is valid only after calling
WaitForToolsInGuest.
- This function does not apply in VBScript, since it is not possible
to access the IVixHandle interface of an object.
Side Effects
None.
Requirements
VixCOM.h, since VMware Workstation 6.0.
Example
C#:
VixCOM.IVM vm;
UInt64 err;
// ...Open the virtual machine and get a handle...
int[] properyIDs = new int[] {VixCOM.Constants.VIX_PROPERTY_VM_POWER_STATE, VixCOM.Constants.VIX_PROPERTY_VM_VMX_PATHNAME};
object properties = null;
err = ((VixCOM.IVixHandle)vm).GetProperties(properyIDs, ref properties);
if (lib.ErrorIndicatesFailure(err)) {
// Handle the error...
}
int vmPowerState = ((object[])properties)[0]; // VixCOM.Constants.VIX_PROPERTY_VM_POWER_STATE
string vmPathName = ((object[])properties)[1]; // VixCOM.Constants.VIX_PROPERTY_VM_VMX_PATHNAME