Executes a program in a virtual machine.
PRL_HANDLE PrlVmGuest_RunProgram( PRL_HANDLE hVmGuest, PRL_CONST_STR sAppName, PRL_HANDLE hArgsList, PRL_HANDLE hEnvsList, PRL_UINT32 nFlags, PRL_FILE_DESC nStdin, PRL_FILE_DESC nStdout, PRL_FILE_DESC nStderr );
PrlApiVm.h
PFD_STDOUT - return stdout.
PFD_STDERR - return stderr.
PFD_ALL - return both stdout and stderr (a blank nFlags parameter yields the same result).
PRPM_RUN_PROGRAM_AND_RETURN_IMMEDIATELY - run the program and return immediately without waiting for the program execution results.
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.
Prior to calling this function, a handle to a user session in a virtual machine must be obtained using the PrlVm_LoginInGuest function. Once you obtain a session handle, you can use this function to run programs in the virtual machine. Depending on the options that were used during login, you will be able to run GUI applications and/or console programs. See the PrlVm_LoginInGuest function for more info.
To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are:
PRL_ERR_INVALID_ARG - invalid handle was passed.
PRL_ERR_VM_EXEC_PROGRAM_NOT_FOUND - the specified program at the specified path was not found.
PRL_ERR_UNINITIALIZED - file descriptors interface tried to use but PrlDevDisplay_ConnectToVm wasn't call.
PRL_ERR_SUCCESS - program executed successfully.