Collapse All
Parallels C API Reference Guide
ContentsIndex
PreviousUpNext
PRL_STATES_CALLBACK
Callback Prototypes  Send Feedback

PRL_STATES_CALLBACK is a function prototype for implementing callback functions for use in PHT_VIRTUAL_DISK calls.

Syntax
typedef PRL_BOOL (PRL_CALL *PRL_STATES_CALLBACK)(PRL_STATES_CALLBACK_TYPE iCallbackType, PRL_INT32 iProgress, PRL_VOID_PTR pParameter);
Parameters

iCallbackType
Callback type. At the time of this writing the only supported callback type is PRL_STATE_DISK_CALLBACK.
iProgress
An integer value indicating the state of the disk operation completion. To determine the state (e.g. percentage of completion), compare the received value to the following constants: 

PRL_STATE_PROGRESS_MIN -- The lower bound of the operation completion range. 

PRL_STATE_PROGRESS_MAX -- The upper bound of the operation completion range. 

PRL_STATE_PROGRESS_COMPLETED -- Indicates that the operation completed successfully. 

A value between PRL_STATE_PROGRESS_MIN and PRL_STATE_PROGRESS_MAX indicates that the operation is still in progress. A value greater than PRL_STATE_PROGRESS_COMPLETED indicates that the operation completed successfully. A negative value indicates an error.

pParameter
A pointer to a buffer containing user-defined data.

Remarks

A pointer to a callback function can be passed to another function that accepts it as a parameter. The operation initiated by that function will be performed in the background thread, which will call the callback function (possibly more than once) passing to it intermediate results or the final result of the operation.

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