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 corresponding identifier 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

When GetProperties() returns an error, the values of the output parameters are indeterminate.

Remarks

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[] propertyIDs = new int[] {VixCOM.Constants.VIX_PROPERTY_VM_POWER_STATE, VixCOM.Constants.VIX_PROPERTY_VM_VMX_PATHNAME};
object properties = null;
err = ((VixCOM.IVixHandle)vm).GetProperties(propertyIDs, 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

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