Collapse All
Parallels C API Reference Guide
PrlVmCfg_GetDevsList Function
PrlApi.h PHT_VM_CONFIGURATION Send Feedback

Returns a pointer to a buffer containing handles to the virtual devices installed in a virtual machine.

Syntax
PRL_RESULT PrlVmCfg_GetDevsList(
    PRL_HANDLE hVmCfg, 
    PRL_HANDLE_PTR vmdev_handles, 
    PRL_UINT32_PTR vmdev_handles_count
);
File
Parameters

hVmCfg
A handle of type PHT_VM_CONFIGURATION identifying the virtual machine configuration.
vmdev_handles
[out] A pointer to a variable that receives the data.
vmdev_handles_count
[in] The number of handles that can be placed into the output buffer. [out] The actual number of handles returned.
Returns

PRL_RESULT . Possible values are:

PRL_ERR_INVALID_ARG - invalid handle, null pointer, or invalid number of handles.

PRL_ERR_BUFFER_OVERRUN - the size of the output buffer is not large enough to fit all of the available devices.

PRL_ERR_OUT_OF_MEMORY - not enough memory to create a device object.

PRL_ERR_SUCCESS - function completed successfully.

Remarks

To determine the number of virtual devices installed in a virtual machine (so that you can allocate the output buffer memory dynamically), use the PrlVmCfg_GetDevsCount function. You can also allocate the memory statically if you wish. When iterating through the returned array, the handle type (essentially the device type) in each iteration can be determined using the PrlHandle_GetType function. You can search this documentation for topics with PHT_VIRTUAL_DEV_ prefix in their names for the list of the available virtual device handles. It is the responsibility of the caller to free the memory when the handles are no longer needed.

Links
Copyright (c) 1999-2008 Parallels Software International Inc.
What do you think about this topic? Send feedback!