Registers an event handler (callback function) with the virtual machine.
PRL_RESULT PrlVm_RegEventHandler( PRL_HANDLE hObj, PRL_EVENT_HANDLER_PTR handler, PRL_VOID_PTR userData );
PrlApiVm.h
PRL_RESULT. Possible values:
PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.
PRL_ERR_SUCCESS - function completed successfully.
To use the callback functionality, you first have to implement a callback function. The callback function must have a specific signature (see PRL_METHOD_PTR for the prototype). After you register an event handler with a virtual machine, the callback function will be called every time an event is generated in the machine.
You can also register an event handler with a Virtuozzo Service (instead of a particular virtual machine) using the PrlSrv_RegEventHandler function. If you register the event handler with the Virtuozzo Service, you will be able to receive events from all of the virtual machines registered with that Virtuozzo Service. For more information on events and asynchronous functions, see the Virtuozzo Virtualization SDK Programmer's Guide.