Microsoft SDK for Java

COM_GuidPool

The COM_GuidPool attribute stores the CLSIDs and IIDs that are referenced by index from the MethodPool. Valid indices range from 0 inclusive to nGuids exclusive. The index 0xffff is reserved to indicate the "null" index. Therefore, the GuidPool can contain a maximum of 65535 GUIDs.

Attribute Level Generated By Directives
Class @com.class
@com.interface
@com.method
@com.parameters
@com.structmap
@dll.structmap
when a GUID is specified.

COM_GuidPool_attribute {
    u2 attribute_name_index;
    u4 attribute_length;
    u2 nGuids;
    GUID aGuid[nGuids];
}

The C structure MCGuidPool, declared in comattr.h, defines the layout of this attribute for use in C/C++ programs.

Restrictions

The class access flags must be a subset of ACC_PUBLIC, ACC_FINAL, ACC_INTERFACE, or ACC_ABSTRACT.

Attribute Elements

attribute_name_index

This value must be a valid index into the constant_pool table. The constant_pool entry at that index must be the CONSTANT_Utf8_info structure representing the string "COM_GuidPool".

attribute_length

This value indicates the length of this attribute, excluding the initial six bytes, and varies depending on the value of nGuids.

nGuids

This value indicates the number of GUIDs defined in this table.

aGuid[]

This array stores the actual GUID representations based on the nGuids item.

nGuids

The number of actual GUID representations in the aGuid array.

A GUID is a 16-byte integer that is subdivided into fields as follows:

GUID {
    u4 Data1;
    u2 Data2;
    u2 Data3;
    u1 Data4[8];
}

Note   Each field in a GUID is stored in little endian format in the Java class file. This is an exception from the normal rule that numeric items stored in a Java class file are stored in big endian format.

An example of the @com.class directive that generates a GUID and item data for this attribute has the following syntax:

/** @com.class(clsid=2BEBEC42-6499-11D0-BFFC-00AA003CFDFC) */

The @com.interface directive that generates a GUID and item data for this attribute has the following syntax:

/** @com.interface(iid=GUID, [thread=AUTO | NO, type=DISPATCH | DUAL | VTABLE]) */

The iid parameter is required. Parameters to the @com.interface directive can appear in any order. When the type parameter is not specified, the default value is a vtable interface.

When used without optional parameters, this directive might look like the following:

/** @com.interface(iid=B2CD9D14-BD00-11D0-B5B3-00A0C913D22B) */

When used with optional parameters specified, this directive has the following syntax:

/** @com.interface(iid=B2CD9D14-BD00-11D0-B5B3-00A0C913D22B,
 thread=AUTO, type=DUAL) */

The @com.structmap and @dll.structmap directives use a similar syntax. The @com.structmap and @dll.structmap directives that generate a GUID and item data for this attribute have the following syntax:

/** @dll.structmap([[[offset=integer | long], [type=BOOLEAN | CURRENCY 
| CUSTOM | CUSTOMBYVAL | DATE | DISPATCH | FIXEDARRAY | I1 | I2 | I4 | I8
| OBJECT | PTR | R4 | R8 | STRING | TCHAR | TCHAR[integer] | U1 | U2 | U4 
| U8], [iid=GUID], [thread=AUTO | NO], [size=integer | long], 
[customMarshal=string], [customMarshalFlags=integer], 
[addFlags=integer]]] [string]) */

The @com.structmap and @dll.structmap directives have a syntax similar to the @com.parameter directive. Parameters may be specified in any order. The first enclosing brackets are required for the @com.structmap and @dll.structmap directive if any parameters are to be specified. The brackets for the TCHAR type are optional. The iid and thread parameter values for the @com.structmap and @dll.structmap directives can be specified only if the type is OBJECT or DISPATCH.

When used with optional parameters specified, this directive might look like the following:

/** @com.structmap( [offset=4, type=OBJECT,
     iid=2BEBEC42-6499-11D0-BFFC-00AA003CFDFC, thread=NO] ) */

Any of these @com directives that specify a GUID will cause an entry to be created in the COM_GuidPool attribute.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.