OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
uuid_t,
idl_char *,
idl_long_int *,
error_status_t *);
void sample_put_text(rpc_binding_handle_t,
uuid_t,
idl_char *,
idl_long_int *,
error_status_t *);
void print_manager_error(char *,
error_status_t);
/******
*
* sample_call -- It don’t do too much right now...
*
*
*
*
******/
/****************************************************************************/
void
sample_call(
rpc_binding_handle_t binding, /* Client binding. */
idl_long_int *status,
error_status_t *remote_status)
{
extern uuid_t sample_acl_mgr_uuid, sample_acl_uuid;
boolean32 authorized = 0;
/****************************************************************************/
/* We have to explicitly initialize the remote status value; */
/* otherwise, if no error occurs in the transmission (which */
/* would cause the runtime to assign an error value to this */
/* variable), its value will be whatever it happened to be */
/* when the RPC was made by the client... */
*remote_status = rpc_s_ok;
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug6,
"Entering sample_call()..."));
/* Check whether client is authorized or not... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_manager, svc_c_debug6,
"Calling dce_acl_is_client_authorized()..."));
dce_acl_is_client_authorized(
binding, /* Client’s binding handle. */
&sample_acl_mgr_uuid, /* ACL manager type UUID. */
&sample_acl_uuid, /* The ACL UUID. */
NULL, /* Pointer to owner’s UUID. */
NULL, /* Pointer to owner’s group’s UUID. */
sec_acl_perm_read, /* The desired privileges. */
124246 Tandem Computers Incorporated A 75