|
MLPIRESULT | mlpiTaskExecuteFile (const MLPIHANDLE connection, const WCHAR16 *path, const WCHAR16 *envArguments, const WCHAR16 *arguments, MLPITASKHANDLE *handle) |
|
MLPIRESULT | mlpiTaskExecuteGetStatus (const MLPIHANDLE connection, const MLPITASKHANDLE handle, MlpiProcessState *state) |
|
MLPIRESULT | mlpiTaskExecuteGetActive (const MLPIHANDLE connection, MLPITASKHANDLE *handles, const ULONG numElements, ULONG *numElementsRet) |
|
MLPIRESULT | mlpiTaskExecuteKill (const MLPIHANDLE connection, const MLPITASKHANDLE handle) |
|
MLPIRESULT | mlpiTaskExecuteGetName (const MLPIHANDLE connection, const MLPITASKHANDLE handle, WCHAR16 *name, const ULONG numElements) |
|
The following functions are used for controlling execution of user tasks.
This function executes a file.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | path | Path of file to be executed. |
[in] | envArguments | Arguments for execution environment. |
[in] | arguments | Arguments for execution. |
[out] | handle | Pointer to value where execution handle will be stored. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
3 // start execution of file /ata0b/test.lua without argument for Lua-VM and without arguments for file
4 result = mlpiTaskExecuteFile(connection, L"/ata0b/test.lua", L"", L"", &handle);
5 if (MLPI_FAILED(result))
7 printf("unable to start execution of file with error code: %08X", result);
This function gets the status of an executed file.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | handle | Handle of the execution |
[out] | state | Status of the executed file |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
3 // start execution of file /ata0b/test.lua without argument for Lua-VM and without arguments for file
4 result = mlpiTaskExecuteFile(connection, L"/ata0b/test.lua", L"", L"", &handle);
5 if (MLPI_FAILED(result))
7 printf("unable to start execution of file with error code: %08X", result);
11 MlpiProcessState state;
12 result = mlpiTaskExecuteGetStatus(connection, handle, &state);
13 if (MLPI_FAILED(result))
15 printf("unable to get state of file execution with error code: %08X", result);
This function gets handles for all executed files.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | handles | Pointer to an array of handles where handles of executions will be stored |
[in] | numElements | Number of handle elements available in 'handles' for reading. |
[out] | numElementsRet | Number of elements used. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
2 MLPITASKHANDLE handles[100];
3 ULONG numElementsRet = 0;
4 result = mlpiTaskExecuteGetActive(connection, handles, 100, &numElementsRet);
5 if (MLPI_FAILED(result))
7 printf("unable to get all active file executions with error code: %08X", result);
10 for(ULONG index = 0; index < numElementsRet; index++)
12 printf("\nhandle of file %u is %016LX", index, handles[index]);
This function stops execution of file.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | handle | Handle of the execution |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
3 // start execution of file /ata0b/test.lua without argument for Lua-VM and without arguments for file
4 result = mlpiTaskExecuteFile(connection, L"/ata0b/test.lua", L"", L"", &handle);
5 if (MLPI_FAILED(result))
7 printf("unable to start execution of file with error code: %08X", result);
11 result = mlpiTaskExecuteKill(connection, handle);
12 if (MLPI_FAILED(result))
14 printf("unable to kill file execution with error code: %08X", result);
This function gets the name of an executed file.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | handle | Handle of the execution |
[out] | name | Name of the executed file |
[in] | numElements | Number of handle elements available in 'name' for reading. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
3 // start execution of file /ata0b/test.lua without argument for Lua-VM and without arguments for file
4 result = mlpiTaskExecuteFile(connection, L"/ata0b/test.lua", L"", L"", &handle);
5 if (MLPI_FAILED(result))
7 printf("unable to start execution of file with error code: %08X", result);
12 result = mlpiTaskExecuteGetName(connection, handle, name, 256);
13 if (MLPI_FAILED(result))
15 printf("unable to get name of file execution with error code: %08X", result);