Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlJob_GetResult Function
PHT_JOB  Example

Obtains a handle of type PHT_RESULT containing the result returned by the job.

Syntax
PRL_RESULT PrlJob_GetResult(
    PRL_HANDLE hJob, 
    PRL_HANDLE_PTR handle
);
File

PrlApiCore.h

Parameters

hJob
A handle of type PHT_JOB identifying the job.
handle
[out] pointer to the job result handle

Returns

PRL_RESULT. Possible values: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_OPERATION_PENDING - the asynchronous operation that this job refers to is still in progress. 

PRL_ERR_SUCCESS - function completed successfully. 

 

Remarks

Depending on the job, the PHT_RESULT object may contain a handle, a list of handles, a string, or a list of strings. The description of each asynchronous function in this documentation contains information whether the function returns a PHT_RESULT object or not, and provides instructions on how to obtain it.

Example

The following code illustrates how to obtain a result from the job object using the login operation as an example.

// Log in to a Virtuozzo Service.
hJob =
PrlSrv_LoginLocal( hServer, NULL, 0, PSL_LOW_SECURITY );

// Wait for the job to complete.
PrlJob_Wait( hJob, 10000 );

// Get a handle of type PHT_RESULT containing the results
// of the operation.
PrlJob_GetResult( hJob, &hJobResult );
PrlHandle_Free( hJob );

// Get the PHT_LOGIN_RESPONSE handle from the job result object.
PRL_HANDLE hHandle;
PrlResult_GetParam( hJobResult, &hHandle );
Links
Copyright ©2016-2017 Parallels International GmbH. All rights reserved.