9.2. The Basic Idea

Once everything is set up and working properly, a remote procedure call looks very easy. In your code, you simply call a function just like you normally would. Looking at the code, there is no way to distinguish an RPC from a normal function. For example, in a graphics program you might have a function named CalcPixel that calculates the value for a pixel in a ray-traced image. In any ray-tracing application, CalcPixel would represent a fairly CPU-intensive function call. A typical call might look like this:

color = CalcPixel(x,y);

In a normal program, when you call the function, the program first branches off to execute the function, then calculates the result, and returns with the answer. In an RPC program, however, the ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.