Using

Running RPC Applications

Port Mapper

To run RPC applications, you usually have to start the port mapper. You can do this on NT via the Services control panel or from the command line with the command net start portmap. If you want, you can start the non-service version of the port mapper by starting portmap from the command prompt.

The %SystemRoot%\system32\drivers\etc\rpc file contains symbolic names for RPC services. You can edit this file to change the symbolic names understood by the RPC library.

hello (and the demo apps)

Once the port mapper is running, you should start the hello service. You can do that by starting hello_svc.exe. Then, run the rhello.exe program with the address of the machine where the hello service is running. For example: rhello localhost (if the hello service is running on the local machine).

The demo applications work in the same way. To see the syntax for each of the demo clients, just run the client without any parameters.

Error-reporting

The RPC library currently writes its error messages to the application log since Win32 applications do not always have a console. Use the Event Viewer to view these messages.

Developing RPC Applications

rpcgen

If you are developing an RPC application and need to use rpcgen, you will need to make sure that your C pre-processor is in your path. Currently, rpcgen uses the Microsoft pre-propcessor if compiled under Microsoft Visual C++ or the Borland pre-processor if compiled under Borland C++. In the future, it will support using an environment variable to specify the C pre-processor and flags.

RPC API

The API provided by this package is the same one provided by Sun/ONC RPC with the following one exception. The current version of the RPC API requires that you call rpc_nt_init() to initialize the RPC library. Note that rpc_nt_init() returns -1 on error and 0 on success.

Note that the error-reporting functions in the library currently only output error messages to the application log. This can be annoying for your console applications. In the future, the RPC library initialization should provide more flexibility in this regard.

Currently, Windows only supports null authentication on the server-side.

Sample RPC programs can be found in the src/demo directory.