OSF DCE Application Development Guide--Introduction and Style Guide
RPC Parameters
side. However, this default behavior can be modified by applying the
[reflect_deletions] attribute to the operation. In this case, the client-side stub will
deallocate the pointer referent. The client and server must use the rpc_sm_*
routines to allocate and free memory for this reflection of deletions to work.
• For an [in,out] parameter which is a [ptr] pointer, if the server sets the parameter
value to NULL, the client will no longer be able to dereference the pointer on return.
If the client has no other means to reference the original pointed-to node, the node is
said to be orphaned: the client will be unable to free it.
6.3.3.3 Pointer Examples
The following sample code demonstrates the basic properties of pointers. The first
example demonstrates pointer arithmetic and how changes in the server address space
can be reflected back to the client using full pointers. In the .idl file we declare a type
that is an array of three integers, and a type that is a pointer to an integer. The operation
takes the array as an [in] parameter and the pointer as an [in,out] parameter.
const unsigned32 ARRAY_SIZE = 3;
typedef unsigned32 num_array[ARRAY_SIZE];
typedef [ptr] unsigned32 *num_ptr;
void ptr_test1(
[in] handle_t handle,
[in, out] num_ptr *client_ptr,
[in ] num_array client_array,
[out] error_status_t *status
);
124246 Tandem Computers Incorporated 6− 13