共用方式為


3.11.1 Abstract Data Model

This section describes a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to explain how the protocol behaves. This specification does not mandate that implementations adhere to this model, as long as their external behavior is consistent with the behavior described in this specification.

An automation type library server provides a concrete representation of an IDL automation scope.

Every automation type library server MUST maintain the following data elements:

  • A string that MUST specify the name of the type library.

  • A value or structure that MUST specify the attributes declared with the type library in the IDL, as specified in section 2.2.49.2.

  • A type information table (see below) that contains a list of automation type description mapping entries for types that are defined in the automation scope.

  • A type reference table (see below) that contains a list of mappings between HREFTYPE values and automation type descriptions.

  • A library reference table (see below) that contains a list of mappings between strings, as specified by importlib statements (see section 2.2.49.10) and automation type libraries.

  • A reference to an ITypeComp server whose binding context (see section 3.5.4.1.1) is specified by the members of the automation type library.

  • A system pointer size value that specifies the size of a pointer within the data structures used by the automation type descriptions in its type information table. This value is determined when the server is initialized, and is not specified as part of the IDL automation scope.

Each entry in the type information table MUST correspond to a type that is defined or referenced in the automation scope. The entry that corresponds to a dual interface MUST be its partner dispinterface. Each entry MUST contain:

  • An ordinal value. The ordinal position of automation type descriptions within the type information table MUST be permanent.

  • A GUID. The GUID MUST be the GUID specified in the automation scope defining the type, or IID_NULL if no GUID is specified. The mapping between a GUID and an automation type description MUST be permanent and MUST be consistent among all servers that represent automation scopes within the same automation scope family.

  • A string. The mapping between a type name and an automation type description MUST be permanent and MUST be consistent among all servers that represent automation scopes with the same LCID in the same automation scope family.

The type reference table MUST contain one entry for each type defined or referenced in the automation scope.

Each element of the type reference table MUST include the following:

  • An HREFTYPE.

  • A reference to the automation type description object corresponding to the HREFTYPE.

  •  A reference to an entry in the library reference table (see below) if the automation type description corresponds to a type that is defined by another automation type library.

The library reference table MUST contain one entry for each external automation type library that defines types that are referenced by members of the type reference table.

Each element of the library reference table MUST include the following:

  • A string specified by an importlib statement (see section 2.2.49.10).

  • A reference to the automation type library instance that corresponds to the specified string.