Invoking Functions and Applications
Among all RAPI functions, there are two functions that invoke functions and applications residing on the Windows CE platform:
- CeCreateProcess
This function creates a new process that runs a specified executable file residing on the Windows CE platform.
- CeRapiInvoke
This function remotely executes a function residing on the Windows CE platform and provides for both input parameters and output data. It operates in either of two modes:
- Block, which is known as synchronous. In block mode, the caller passes both input parameters and output data in a single buffer. Because this is a synchronous call, all input data must be present in memory at the time of the call and all output data must be present before the function finishes.
- Stream, which is known as asynchronous. In stream mode, an Istream-type interface is used to exchange arbitrarily-sized data in any order and direction. The caller can pass input data in a single buffer, but from that point on all data should be exchanged through the stream. Because the data can be read, written, and stored in chunks, stream code is significantly faster than block mode. The interface used is based on Istream, but has two additional methods to allow you to do time-outs.
Note LocalAlloc allocates the memory passed for both the pInput and ppOutput parameters of CeRapiInvoke. The called function frees the input memory allocation, and the calling application frees the output memory allocation.