Parallels Virtualization SDK
Example
PrlJob_Wait Function
// Log in to Parallels Service.
// This is an asynchronous call.
// Returns a handle to the Job object.
PRL_HANDLE hJob = PrlSrv_Login(
    hServer, "10.30.23.105", "miket", "1q2w3e",
    0, 0, 0, PRL_SECURITY_LEVEL::PSL_LOW_SECURITY);

// Wait for the Job object to receive the results of the operation.
ret = PrlJob_Wait( hJob, 1000 );
if (PRL_FAILED(ret))
{
    printf("PrlJob_Wait returned with error (%s)\n",
        PRL_RESULT_TO_STRING(ret));
    return -1;
}

// Get the results from the Job object.
PRL_RESULT nJobResult;
ret = PrlJob_GetRetCode( hJob, &nJobResult );
if (PRL_FAILED( nJobResult ))
{
    printf("login job returned with error (%s)\n",
        PRL_RESULT_TO_STRING( nJobResult ));
    return -1;
}
else
    printf( "Login succeeded.\n" );

// Delete the Job handle.
PrlHandle_Free( hJob );
Copyright © 1999-2017 Parallels International GmbH. All rights reserved.