3.1.4.18.2 CopyComponentConfiguration (Opnum 4)
This method is called by a client to copy a component full configuration from one conglomeration to another.
-
HRESULT CopyComponentConfiguration( [in, string] LPCWSTR pwszSourceConglomeration, [in, string] LPCWSTR pwszComponent, [in, string] LPCWSTR pwszDestConglomeration );
pwszSourceConglomeration: The Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of the conglomeration identifier or the Name property of a conglomeration from which the component configuration is to be copied.
pwszComponent: The Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of the CLSID or the ProgID property of a component configured in the conglomeration specified by pwszSourceConglomeration.
pwszDestConglomeration: The Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3) representation of the conglomeration identifier or the Name property of a conglomeration into which the component configuration is to be copied.
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 select the source conglomeration as follows:
If pwszSourceConglomeration is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3), the server MUST select the conglomeration with a conglomeration identifier equal to the GUID represented, and fail the call if no such conglomeration exists.
Otherwise, the server MUST select the conglomeration with a Name property equal to pwszSourceConglomeration, and fail the call if no such conglomeration exists.
The server then MUST select the destination conglomeration as follows:
If pwszDestConglomeration is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3), the server MUST select the conglomeration with a conglomeration identifier equal to the GUID represented, and fail the call if no such conglomeration exists.
Otherwise, the server MUST select the conglomeration with a Name property equal to pwszDestConglomeration, and fail the call if no such conglomeration exists.
The server then MUST select the component configuration to be copied as follows:
If pwszComponent is in Curly Braced GUID String Syntax ([MS-DTYP] section 2.3.4.3), the server MUST select the component with a CLSID equal to the GUID represented, and fail the call if no such component exists.
Otherwise, the server MUST select the component with a ProgID property equal to pwszComponent, and fail the call if no such component exists.
The server then MUST select the component full configuration for the selected component in the source conglomeration, and fail the call if no such component full configuration exists.
The server then MUST verify that the copy operation specified is valid as follows:
The server MUST verify that the source conglomeration and the destination conglomeration are not contained in the same partition, and fail the call if not.
The server MUST verify that the component of the component configuration to be copied is not already configured in the destination conglomeration, and fail the call if this is already configured.
The server MUST verify that the Changeable property (see section 3.1.1.3.6) of the destination conglomeration is set to TRUE (0x00000001), and fail the call if not.
The remainder of the protocol behavior specified for this method SHOULD be performed as an atomic transaction, in other words, either the operation SHOULD fully succeed or the server SHOULD make no changes to the catalog. This described behavior is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
The server MUST attempt to create a new component full configuration for the component in the destination conglomeration, copying all properties other than PartitionIdentifier and ConglomerationIdentifier from the original component full configuration, and fail the call if it cannot.