A SERVICE OF

logo

www.vmware.com
12
C API Reference Guide
RC1
Vix_FreeBuffer
Function Signature
void
Vix_FreeBuffer(void *p);
Parameters
Results
None.
Notes
When Vix_GetProperties() or Vix_JobWait() returns a string property, it
allocates a buffer for the string. Client applications are responsible for calling
Vix_FreeBuffer() to free the string buffer when no longer needed.
If you pass a null pointer to Vix_FreeBuffer(), the function returns immediately.
Example
This example retrieves the path name and power state of a virtual machine.
Vix_FreeBuffer() is used to free the path name storage.
VixError err = VIX_OK;
VixHandle myVM = VIX_INVALID_HANDLE;
char *pathName;
int vmPowerState = 0;
// ...Open the virtual machine and get a handle...
err = Vix_GetProperties(myVM,
VIX_VM_VMX_PATHNAME,
&pathName,
VIX_VM_POWER_STATE_PROPERTY,
&vmPowerState,
VIX_PROPERTY_NONE);
if (VIX_OK != err) {
// Handle the error...
}
Vix_FreeBuffer(pathName);
p A string pointer returned by a call to Vix_GetProperties() or
Vix_JobWait().