PreviousNext

rpc_object_set_inq_fn(3rpc)

Registers an object inquiry function

Used by server applications.

Synopsis

#include <dce/rpc.h>

void rpc_object_set_inq_fn(

rpc_object_inq_fn_t inquiry_fn,

unsigned32 *status);

Parameters

Input

inquiry_fn
Specifies a pointer to an object type inquiry function. When an application calls the rpc_object_inq_type( ) routine and the RPC runtime finds that the specified object is not registered, the runtime automatically calls the rpc_object_inq_type( ) routine to determine the object's type. Specify NULL to remove a previously set inquiry function.

The following C language definition for rpc_object_inq_fn_t illustrates the prototype for this function:

typedef void (*rpc_object_inq_fn_t)

(
uuid_t *object_uuid, /* in */
uuid_t *type_uuid, /* out */
unsigned32 *status /* out */
);


The returned type_uuid and status values are returned as the output arguments from the rpc_object_inq_type( ) routine.

If you specify NULL, the rpc_object_set_inq_fn( ) routine unregisters (that is, removes) a previously registered object type inquiry function.

Output

status
Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.

Description
A server application calls rpc_object_set_inq_fn( ) to specify a function to determine an object's type. If an application privately maintains object/type registrations, the specified inquiry function returns the type UUID of an object from that registration.

The RPC runtime automatically calls the inquiry function when the application calls rpc_object_inq_type( ) and the object was not previously registered by rpc_object_set_type( ). The RPC runtime also automatically calls the inquiry function for every remote procedure call it receives if the object was not previously registered.

Cautions
Use this routine with caution. When the RPC runtime automatically calls this routine in response to a received remote procedure call, the inquiry function can be called from the context of runtime internal threads with runtime internal locks held. The inquiry function should not block or at least not block for long (for example, the inquiry function should not perform a remote procedure call). Also, the inquiry function must not unwind because of an exception. In general, the inquiry function should not call back into the RPC runtime. It is legal to call rpc_object_set_type( ) or any of the uuid_* routines. Failure to comply with these restrictions will result in undefined behavior.

Return Values
No value is returned.

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

rpc_s_ok
Success.

Related Information
Functions: rpc_object_inq_type(3rpc)

rpc_object_set_type(3rpc)