wchar_t_net_size(3rpc)Calculates the necessary buffer size for code set conversion from a local code set to a network code set prior to marshalling; used by client and server stubs but not directly by applications Synopsis #include <dce/rpc.h> void wchar_t_net_size( rpc_binding_handle_t binding, unsigned32 network_code_set_value, unsigned32 local_buffer_size, idl_cs_convert_t *conversion_type, unsigned32 *network_buffer_size, error_status_t *status); Parameters Input
binding
network_code_set_value
local_buffer_size Output
conversion_type
network_buffer_size
status
Description The wchar_t_net_size( ) routine is one of the DCE RPC buffer sizing routines that RPC stubs use before they marshall or unmarshall data to determine whether or not the buffers allocated for code set conversion need to be enlarged to hold the converted data. The buffer sizing routines determine the type of conversion required and calculate the size of the necessary buffer (if a conformant or conformant varying array is to be marshalled or unmarshalled); the RPC stub then allocates a buffer of that size before it calls one of the code set conversion routines. Client and server stubs call the two wchar_t_*_size routines when the wchar_t type has been specified as the local data type using the cs_char attribute in the attribute configuration file for the application. The wchar_t_net_size( ) routine is used to evaluate buffer size requirements prior to marshalling data to be sent over the network. Applications do not call the wchar_t_net_size( ) routine directly. Client and server stubs call the routine before they marshall any data. The stubs pass the routine a binding handle and a code set value that identifies the code set to be used to transfer international character data over the network. The stubs also specify the local storage size of the data, in units of wchar_t. Because wchar_t and idl_byte require different numbers of bytes to encode one character, wchar_t_net_size( ) always sets conversion_type to idl_cs_new_buffer_convert, regardless of whether it is called from a client or server stub, or whether client and server code set tag information has been stored in the binding handle by a code sets evaluation or tag-setting routine. If a conformant or conformant varying array is to be marshalled, the routine then calculates a new buffer size by dividing the value of local_buffer_size by the number of bytes required to encode one wchar_t unit. The routine returns the new buffer size in the network_buffer_size parameter. The size is specified in units of idl_byte, which is the network representation used for international character data. When a fixed or varying array is being marshalled, the wchar_t_net_size routine cannot calculate the required buffer size and does not return a value in the network_buffer_size argument.
Permissions Required
Return Values 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
rpc_s_ss_incompatible codesets When invoked from the server stub, this routine calls the dce_cs_loc_to_rgy( ) and the rpc_rgy_get_max_bytes( ) routines. If either of these routines return an error, the wchar_t_net_size( ) routine raises an exception to the client application.
Related Information
|