共用方式為


3.1.4.11.2 CreateLegacyConfiguration (Opnum 4)

This method is called by a client to create a component legacy configuration for an existing component in an existing conglomeration in the global partition.

 HRESULT CreateLegacyConfiguration(
   [in, string] LPCWSTR pwszConglomerationIdOrName,
   [in, string] LPCWSTR pwszCLSIDOrProgId,
   [in] eComponentType ctComponentType
 );

pwszConglomerationIdOrName: A string containing either the Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of a conglomeration identifier or the Name property (see section 3.1.1.3.3) of a conglomeration.

pwszCLSIDOrProgId: A string containing either the Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of a CLSID or the ProgID property (see section 3.1.1.3.1) of a component.

ctComponentType: An eComponentType (section 2.2.5) value to select the bitness of the component when there might be multiple bitnesses. This value MUST NOT be eCT_UNKNOWN or eCT_ANY.

Return Values: This method MUST return S_OK (0x00000000) on success and a failure result, as specified in [MS-ERREF] section 2.1, on failure. All failure results MUST be treated identically.

Upon receiving a call to this method, the server MUST verify that catalog version negotiation has been performed by checking the negotiated catalog version (see section 3.1.1.5), and fail the call if not.

The server then MUST perform parameter validation as follows:

  • The server MUST verify that ctComponentType is a valid eComponentType (section 2.2.5) value and that it represents a bitness that is supported by the server.

The server then MUST select a target conglomeration based on the value of pwszConglomerationIdOrName as follows:

  • If pwszConglomerationIdOrName is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3), the server MUST do the following:

    • The server MUST convert this string to a GUID.

    • If this GUID is the conglomeration identifier of a conglomeration that exists on the server, the server MUST select that conglomeration. Otherwise, the server MUST return a failure result. as specified in [MS-ERREF] section 2.1.

  • If pwszConglomerationIdOrName is not in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3), the server MUST verify that there exists a conglomeration with the value pwszConglomerationIdOrName for the Name property (see section 3.1.1.3.3). If so, the server MUST select that conglomeration.

The server then MUST verify that the target conglomeration is contained in the global partition.

The server then MUST select a component and bitness to configure, based on the value of pwszCLSIDOrProgId as follows:

  • If the server does not support the multiple-bitness capability (section 3.1.4.4) or the value of ctComponentType specifies the bitness, the server MUST perform the following:

    • If the first character of pwszCLSIDOrProgId is not "{", the server MUST determine whether or not there exists a component that has the specified bitness and for which the value of the ProgID (see section 3.1.1.3.1) property of the non-native bitness is pwszCLSIDOrProgId. If such a component exists, the server MUST select that component and the specified bitness. If no such component exists, the server MUST return a failure result (as specified in [MS-ERREF] (section 2.1)).

    • If the first character of pwszCLSIDOrProgId is "{", the server MUST verify that pwszCLSIDOrProgId is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3). The server then MUST determine whether or not there exists a component with the CLSID represented by pwszCLSIDOrProgId that has the specified bitness. If such a component exists, the server MUST select that component and the specified bitness. If no such component exists, the server MUST return a failure result, as specified in [MS-ERREF] section 2.1.

The server then MUST verify that creating a component legacy configuration for the selected component and bitness in the selected conglomeration would not violate the constraints specified for component configurations in sections 3.1.1.3.1 and 3.1.1.3.3.

The server then MUST attempt to create a component legacy configuration for the selected component and bitness in the selected conglomeration, using implementation-specific default values for the properties, and fail the call if it cannot.