Among all RAPI functions, there are two functions that execute functions and applications residing on the Windows CE-based platform:
This function creates a new process that runs a specified executable file residing on the Windows CE-based platform.
This function remotely executes a function residing on the Windows CE-based platform and provides for both input parameters and output data. It operates in either of two modes: block, known as synchronous, or stream, known as asynchronous.
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.
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 timeouts.
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.