Collapse All
Parallels C API Reference Guide
PrlSrv_AttachToLostTask Function
PrlApi.h PHT_SERVER

The PrlSrv_AttachToLostTask function allows to obtain a handle to a running task after the connection to the Parallels Service was lost.

Syntax
PRL_HANDLE PrlSrv_AttachToLostTask(
    PRL_HANDLE hServer, 
    PRL_CONST_STR sTaskId
);
File
Parameters

hServer
A handle of type PHT_SERVER identifying the Parallels Service.
sTaskId
The ID of the task to get a job handle for.
Returns

A handle of type PHT_JOB containing the results of this asynchronous operation, or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object. The returned PHT_JOB object will be attached to the specified task.

Remarks

If you've started a long asynchronous operation and then lost a connection with the Parallels Service, you may use this function to get a handle to the task after reconnecting to the Parallels Service. In order to do that, log in to the Parallels Service using the PrlSrv_Login or the PrlSrv_LoginLocal function passing the UUID of the session that you've lost. The returned PHT_LOGIN_RESPONSE object will contain the list of the tasks that belong to the lost session and are still running. Select a task that you want to get a handle to and pass its ID to the PrlSrv_AttachToLostTask function. The function will return a handle of type PHT_JOB which you may use to continue controlling and monitoring the task as usual.

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are:

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.

PRL_ERR_SUCCESS - function completed successfully.

Links
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!