3.1.6.3 Create Directory Object

This event MUST be generated with the following arguments:

  • iObjectType: One of the directory object types, as defined in section 2.2.8.

  • iPathName: The directory service pathname of the object to be created, as defined in section 2.2.9.

  • iNumberOfProperties: The size (in elements) of the arrays iPropertyID and iPropertyValue. The arrays iPropertyID and iPropertyValue MUST have an identical number of elements.

  • iPropertyID: An array of property identifiers of properties to associate with the created object. Each element MUST specify a value from the property identifiers table as specified in section 2.2.10.1, for the directory object type specified in iObjectType. Each element MUST specify the property identifier for the corresponding property value at the same element index in iPropertyValue.

  • iPropertyValue: An array of property values in PROPVARIANT structures to associate with the created object. Each element MUST specify the property value for the corresponding property identifier at the same element index in iPropertyID.

  • iPartitionID: A DirectoryPartitionIdentifier (section 3.1.1.2).

  • iSeqNumber: A DirectorySequenceNumber (section 3.1.1.1).

  • iReplicate: A Boolean value indicating whether replication of this change is needed. TRUE if replication is required, or FALSE if it is not.

Return value:

  • rStatus: An HRESULT indicating the result of the operation.

The server MUST perform the following actions to process this event:

  • Verify that the arrays iPropertyID and iPropertyValue contain at least one element. If not, the server MUST return an error.

  • Verify that for each property identifier in iPropertyID, the property identifier is valid for the object type specified in iObjectType<123> and that the corresponding variant in iPropertyValue is of the type defined for the property identifier, as specified in the tables in section 2.2.10.1.

  • The server MUST ignore any property identifier that is not valid for the object type specified in iObjectType.

  • The server response depends on the iObjectType parameter value. If the value of this parameter is unsupported, the server MUST NOT execute the call and MUST return an error.

  • Verify that the property identifiers required to create an object of the type indicated by iObjectType are present in iPropertyValue. If not all of the required property identifiers are present, the server MUST return an error code.<124>

  • Map the property identifiers in iPropertyID to the corresponding directory service object attributes as specified in the tables in section 3.1.4.21.8.

  • Let dirObject be a directory object and initialized to NULL.

  • If iObjectType equals MQDS_QUEUE:

    • Create a new Queue ADM element instance using the values contained in iPropertyID and iPropertyValue according to the rules specified in section 3.1.4.21.8.3.3 with the changes listed as follows and assign it to dirObject. Queue property identifiers are specified in [MS-MQMQ] section 2.3.1.

      • dirObject.Identifier is set from the PROPID_Q_INSTANCE property.

      • dirObject.Pathname is set from the PROPID_Q_PATHNAME property.

      • dirObject.PartitionIdentifier is set from iPartitionID.

      • dirObject.SequenceNumber is set from iSeqNumber.

      • Invalid property identifiers are ignored.

  • Else if iObjectType equals MQDS_ROUTINGLINK:

    • Create a new RoutingLink ADM element instance using the values contained in iPropertyID and iPropertyValue according to the rules specified in section 3.1.4.21.8.3.5 with the changes listed as follows and assign it to dirObject. RoutingLink property identifiers are specified in [MS-MQMQ] section 2.3.7.

      • dirObject.SequenceNumber is set from iSeqNumber.

      • Invalid property identifiers are ignored.

  • Else if iObjectType equals MQDS_MACHINE:

    • Create a new QueueManager ADM element instance using the values contained in iPropertyID and iPropertyValue according to the rules specified in section 3.1.4.21.8.1.1 with the changes listed as follows and assign it to dirObject. QueueManager property identifiers are specified in [MS-MQMQ] section 2.3.2.

      • dirObject.ComputerName is set from the PROPID_QM_PATHNAME property.

      • dirObject.PartitionIdentifier is set from iPartitionID.

      • dirObject.SequenceNumber is set from iSeqNumber.

      • Invalid property identifiers are ignored.

  • Else if iObjectType equals MQDS_ENTERPRISE:

    • The server SHOULD<125> return an error.

  • Else if iObjectType equals MQDS_USER:

    • Create a new User ADM element instance using the values contained in iPropertyID and iPropertyValue according to the rules specified in section 3.1.4.21.8.3.7 with the changes listed as follows and assign it to dirObject. User property identifiers are specified in [MS-MQMQ] section 2.3.6.

      • dirObject.Identifier is set from the PROPID_U_ID property.

      • dirObject.SequenceNumber is set from iSeqNumber.

      • Invalid property identifiers are ignored.

  • Else if iObjectType equals MQDS_SITE:

    • Create a new Site ADM element instance using the values contained in iPropertyID and iPropertyValue according to the rules specified in section 3.1.4.21.8.3.4 with the changes listed as follows and assign it to dirObject. Site property identifiers are specified in [MS-MQMQ] section 2.3.3.

      • dirObject.Name is set from the PROPID_S_PATHNAME property.

      • dirObject.PrimarySiteController is set from the PROPID_S_PSC property.

      • dirObject.SequenceNumber is set from iSeqNumber.

      • Invalid property identifiers are ignored.

  • Else if iObjectType equals MQDS_CN, the server SHOULD<126> return an error code.

  • Generate the Add Object to Directory (section 3.1.6.11) event with the iObject argument set to dirObject. If rStatus returned by the event is not 0x00000000, return rStatus, and take no further action.

  • If iReplicate is TRUE, the server MAY<127> contact other servers to propagate the changes.