Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlVm_RegEventHandler Function
PHT_VIRTUAL_MACHINE

Registers an event handler (callback function) with the virtual machine.

Syntax
PRL_RESULT PrlVm_RegEventHandler(
    PRL_HANDLE hObj, 
    PRL_EVENT_HANDLER_PTR handler, 
    PRL_VOID_PTR userData
);
File

PrlApiVm.h

Parameters

hObj
handler
A pointer to the callback function that will handle events.
userData
A pointer to a user data that will be passed to the callback function.

Returns

PRL_RESULT. Possible values: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Remarks

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.

Links
Copyright ©2016-2017 Parallels International GmbH. All rights reserved.