PreviousNext

The enable_allocate Attribute

The enable_allocate attribute on an operation causes the server stub to initialize the rpc_ss_allocate( )routine. The rpc_ss_allocate( ) routine requires initialization of its environment before it can be called. The server stub automatically initializes (enables) rpc_ss_allocate( )if the operation uses either full pointers, or a type with the represent_as attribute. If the operation does not meet either of these conditions, but the manager application code needs to make use of the rpc_ss_allocate( ) and rpc_ss_free( )routines, then use the enable_allocate attribute to force the stub code to enable.

The enable_allocate attribute has the following syntax.

For an operation:

[enable_allocate] operation_name (parameter_list]);

Example Using the enable_allocate Attribute

ACF

[auto_handle] interface phonedir

{

[enable_allocate] lookup ();

}

IDL File

[uuid(06a12100-2d26-11c9-aa24-08002b0ecef1)]

interface phonedir

{

typedef struct

{

short int area_code;

long int phone_num;

char last_name[20];

char first_name[15];

char city[20];

} dir_t;

void add ([in] dir_t *info);

void lookup ([in] char city[20],

[in] char last_name[20],

[in] char first_name[15],

[out] dir_t *info);

void delete ([in] dir_t *info);

}