You generate a UUID with uuidgen. The creators of DCE recognised that an interface does not stay the same forever; you are likely to update it regularly. So they are also allow for a version number in the interface header. The complete version number consists of a major and a minor version number.
During a remote procedure call, the following rules determine wheter a client can use an interface than a server supports:
When you compile the interface definition, the IDL compiler
generates C code dta types that begin with idl_
, and
places them in the header file. For example, a typedef in an interface
definition uses the IDL data type long as follows:
typedef long TPartNum;
The IDL compiler generates the data type
idl_long_int
, corresponding to the long
IDL
type, and places it in the hedader file as follows:
typedef idl_long_int TPartNum;
You use the new data type, TPartNum, in your application code. Although the size of a particular IDL data type is always the same, it may map to different standard C data types on different systems. The idl_ data types are defined in a DCE RPC-supplied header file to map to the proper sized C data types for the system on which the compile took place.
The next table shows the basic IDL data types, the sizes of each in
bits, and the corresponding idl_
data types. Use the IDL
data types in interface definitions for type definitions, constant
declarations, and procedure declarations. Use idl_
data
types in your RPC application code for all return values and
parameters in remote procedure calls.
IDL Data Type | Size | C Code Data Type |
---|---|---|
boolean | 8 bits | idl_boolean |
byte | 8 bits | idl_byte |
char | 8 bits | idl_char |
void | - | void |
void * | opaque | application specific |
handle_t | opaque | rpc_binding_handle_t ,handle_t |
error_status_t | 32 bits | unsigned32 ,unsigned long ,error_status_t |
Integers | ||
small | 8 bits | idl_small_int |
short | 16 bits | idl_short_int |
long | 32 bits | idl_long_int |
hyper | 64 bits | idl_hyper_int |
unsigned small | 8 bits | idl_usmall_int |
unsigned short | 16 bits | idl_ushort_int |
unsigned long | 32 bits | idl_ulong_int |
unsigned hyper | 64 bits | idl_uhyper_int |
Float Point | ||
float | 32 bits | idl_short_float |
double | 64 bits | idl_long_float |
International Characters | ||
ISO_LATIN_1 | 8 bits | ISO_LATIN_1 |
ISO_UCS | 32 bits in a structure | ISO_UCS |
ISO_MULTI_LINGUAL | 16 bits in a structure | ISO_MULTI_LINGUAL |
For 32 bit systems you can use the standard C data types (long, float, and so on) for remote procedure return values and parameters. However, to assure that your DCE application code will port to other systems, use the C code data types from Table 1 in your application code. Next table contains notes about some of IDL data types.
IDL_ Type | Notes |
---|---|
boolean | Data that is either
idl_true or idl_false . |
byte | Data is not automatically converted when transmitted over the network to a system with a different data format. Use this type to transmit data that is untyped or opaque so that no conversion is performed on it. |
char | An unsigned, 8 bit
character. C uses the char data type to represent 8 bit integers as
well as characters, and it interprets them as signed on some systems
and unsigned on others. Use the IDL char data type for
true character data and use small or unsigned
small to represent 8 bit integers in interface
definitions. |
void | Indicates that a procedure does not return a value. |
void * | Used with the context_handle attribute to define context handles. It refers to opaque data. |
handle_t | Data that denotes a binding handle. |
error_status_t | Data that denotes an RPC communication status. |
ISO_LATIN_1 | The Latin character set defined by the Internatonal Standards Organization. |
ISO_UCS | The universal character set defined by the International Standards Oranization. |
ISO_MULTI_LINGUAL | A sunbset of the
characters of type ISO_UCS that can be represented in two
bytes. |