<div class="content" name="S_DSSetPropsGuid" uuid="d8124983-c4e5-404c-8dd6-1d293ee8a10d"><p>This method sets properties for a directory object specified
by an object identifier.</p><dl>
<dd>
<div><pre> HRESULT S_DSSetPropsGuid(
   [in] handle_t hBind,
   [in, range(1,58)] unsigned long dwObjectType,
   [in] const GUID* pGuid,
   [in, range(1,128)] unsigned long cp,
   [in, size_is(cp)] unsigned long aProp[],
   [in, size_is(cp)] PROPVARIANT apVar[]
 );
</pre></div>
</dd></dl><p><b>hBind: </b> MUST specify an <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> binding handle, as
specified in <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>
section <a href="../ms-rpce/a01f5886-c485-4bcf-bb23-e0d755510ab7" data-linktype="relative-path">2</a>.</p><p><b>dwObjectType: </b> Specifies the type of object for which
properties are to be set. MUST be one of the object types specified in section <a href="0d63e0e1-8b17-4103-9080-01e6c7c9f61f" data-linktype="relative-path">2.2.8</a>.</p><p><b>pGuid: </b> Pointer to the <a href="../ms-dtyp/4926e530-816e-41c2-b251-ec5c7aca018a" data-linktype="relative-path">GUID</a> of
the object for which properties are to be set.</p><p><b>cp: </b> MUST be set to the size (in elements) of the
arrays <i>aProp</i> and <i>apVar</i>. The arrays <i>aProp</i> and <i>apVar</i>
MUST have an identical number of elements and MUST contain at least one
element.</p><p><b>aProp: </b> An array of identifiers of properties to
associate with the object designated by <i>pGuid</i>. Each element MUST specify
a value from the <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_382ac1cd-8ff9-493a-bfec-d9ad08955707" data-linktype="relative-path">property
identifiers</a> table, as specified in section <a href="1f12668a-2fa3-45cf-8236-74f0fe4a6b7d" data-linktype="relative-path">2.2.10.1</a>, for the object
type specified in <i>dwObjectType</i>. Each element MUST specify the property
identifier for the corresponding property value at the same element index in <i>apVar</i>.
The array MUST contain at least one element.</p><p><b>apVar: </b> An array that specifies the property values
to associate with the created object. Each element MUST specify the property value
for the corresponding property identifier at the same element index in <i>aProp</i>.
The array MUST contain at least one element.</p><p><b>Return Values: </b> If the method succeeds, the return
value is 0. If the method fails, the return value is an implementation-specific
error code. </p><p><b>MQ_OK</b> (0x00000000)</p><p><b>MQ_ERROR_ILLEGAL_PROPID</b> (0xC00E0039)</p><p><b>MQ_ERROR</b> (0xC00E0001)</p><p><b>MQ_ERROR_DS_ERROR</b> (0xC00E0043)</p><p><b>MQDS_OBJECT_NOT_FOUND</b> (0xC00E050F)</p><p><b>E_ADS_PROPERTY_NOT_FOUND</b> (0x8000500D)</p><p><b>Exceptions Thrown:</b> No exceptions are thrown beyond
those thrown by the underlying RPC protocol, as specified in [MS-RPCE].</p><p> When processing this call, the server MUST:</p><ul><li><p><span><span> 
</span></span>Verify that the arrays <i>aProp</i> and <i>apVar</i> contain at
least one element. If not, the server SHOULD<a id="Appendix_A_Target_49"></a><a aria-label="Product behavior note 49" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_49" data-linktype="relative-path">&lt;49&gt;</a> take no
further action and return an error <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>.</p>
</li><li><p><span><span> 
</span></span>If the value of <i>dwObjectType</i> is not one of the values
listed in the table in section 2.2.8, or is MQDS_DELETEDOBJECT, the server MUST
take no further action and return a failure HRESULT.</p>
</li><li><p><span><span> 
</span></span>The server MAY<a id="Appendix_A_Target_50"></a><a aria-label="Product behavior note 50" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_50" data-linktype="relative-path">&lt;50&gt;</a> forward
the update to another server.</p>
</li><li><p><span><span> 
</span></span>Verify for each property identifier in <i>aProp</i> that the
property identifier is valid for an object of type <i>dwObjectType</i>, and
that the corresponding variant in <i>apVar</i> is of the type defined for the
property identifier, using the rules in the following table. If the object type
is not in the table or any invalid property identifier or type is found, the
server MUST take no further action and return a failure HRESULT.</p>
<table><thead>
  <tr>
   <th>
   <p>Value of dwObjectType</p>
   </th>
   <th>
   <p>Rules</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>MQDS_QUEUE</p>
  </td>
  <td>
  <p>See <a href="../ms-mqmq/b7cc2590-a617-45df-b6a3-1f31102b36fb" data-linktype="relative-path">[MS-MQMQ]</a>
  section <a href="../ms-mqmq/9d5bf18a-5c7d-4df0-9e92-014ac661ae8a" data-linktype="relative-path">2.3.1</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_MACHINE</p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/13c7ee4a-0676-402f-97d7-e880ded0015f" data-linktype="relative-path">2.3.2</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_SITE</p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/c68aaafb-8d65-4106-bf69-22145abdf4d0" data-linktype="relative-path">2.3.3</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ENTERPRISE</p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/3901eb7d-1629-45ae-9dbb-591bf80c670e" data-linktype="relative-path">2.3.5</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_USER</p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/f57441c5-97e2-4d31-800e-4e8502371999" data-linktype="relative-path">2.3.6</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ROUTINGLINK</p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/de8d5810-1fc2-4c93-9f5c-dfaabd8dd230" data-linktype="relative-path">2.3.7</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_CN<a id="Appendix_A_Target_51"></a><a aria-label="Product behavior note 51" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_51" data-linktype="relative-path">&lt;51&gt;</a></p>
  </td>
  <td>
  <p>See [MS-MQMQ] section <a href="../ms-mqmq/e54bb2e8-0b16-42dc-b3ad-0a4f87cc2159" data-linktype="relative-path">2.3.4</a></p>
  </td>
 </tr></tbody></table>
</li><li><p><span><span> 
</span></span>Let <i>dirObject</i>  be a directory object and initialized to
NULL.</p>
</li><li><p><span><span> 
</span></span>Generate the <a href="d4ae6231-1485-4155-83e2-e6509b3ff5da" data-linktype="relative-path">Get
Directory Object for Update (section 3.1.6.14)</a> event with the
following arguments:</p>
<ul><li><p><span><span>  </span></span><i>iObjectType</i>
:= <i>dwObjectType</i></p>
</li><li><p><span><span>  </span></span><i>iPathName</i>
:= NULL</p>
</li><li><p><span><span>  </span></span><i>iGuid</i>
:= <i>pGuid</i></p>
</li></ul></li><li><p><span><span> 
</span></span>If <i>rStatus</i> returned by the event is not 0x00000000, return
<i>rStatus</i> and take no further action; otherwise, set <i>dirObject</i> to
the returned <i>rObject</i>.</p>
</li><li><p><span><span> 
</span></span>Map the values contained in <i>aProp</i> and <i>apVar</i> to <i>dirObject</i>
attributes according to the rules specified in the following table. If any
property identifier is not listed in those rules, or if the rules indicate that
the property identifier is invalid, the server MUST take no further action and
return a failure HRESULT.</p>
<table><thead>
  <tr>
   <th>
   <p>Value of dwObjectType</p>
   </th>
   <th>
   <p>Rules</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>MQDS_QUEUE</p>
  </td>
  <td>
  <p>See section <a href="05d0c685-8de8-4847-9b92-ef3b53c5e656" data-linktype="relative-path">3.1.4.21.8.2.4</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_MACHINE</p>
  </td>
  <td>
  <p>See section <a href="79297a27-8bea-4b05-addd-69bf32b50e80" data-linktype="relative-path">3.1.4.21.8.2.1</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_SITE</p>
  </td>
  <td>
  <p>See section <a href="ad78e384-1c91-44fe-99b6-bc1e1835b964" data-linktype="relative-path">3.1.4.21.8.2.8</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ENTERPRISE</p>
  </td>
  <td>
  <p>See section <a href="1fad7f5e-4b1e-4f9a-9b12-75fd16c649bc" data-linktype="relative-path">3.1.4.21.8.2.6</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_USER</p>
  </td>
  <td>
  <p>See section <a href="3c54afad-eb94-4d71-b4ba-59f6de90ef14" data-linktype="relative-path">3.1.4.21.8.2.12</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ROUTINGLINK</p>
  </td>
  <td>
  <p>See section <a href="632537bf-8f1d-40e1-8cf8-5f8aa8673c4e" data-linktype="relative-path">3.1.4.21.8.2.9</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_CN</p>
  </td>
  <td>
  <p>See section <a href="c644799e-5a7b-40d4-b7dc-9fdd4b380d58" data-linktype="relative-path">3.1.4.21.8.2.10</a></p>
  </td>
 </tr></tbody></table>
</li><li><p><span><span> 
</span></span>Update the attributes of <i>dirObject</i> using the mapping from
the preceding step. For each updated attribute, add the ADM element attribute
name to a list, referred to as <i>attrList</i>.</p>
</li><li><p><span><span> 
</span></span>Generate the <a href="2e861a2a-b45d-4268-8403-42e7b2a97a97" data-linktype="relative-path">Commit
Directory Object Update (section 3.1.6.15)</a> event with the
arguments set to <i>dirObject</i> and <i>attrList</i> respectively. If the
event returns <b>DirectoryOperationResult.Success</b>, set <i>rStatus</i> to
0x00000000; otherwise, set <i>rStatus</i> to a failure HRESULT and take no
further action.</p>
</li><li><p><span><span> 
</span></span>If <i>dwObjectType</i> equals MQDS_QUEUE:</p>
<ul><li><p><span><span>  </span></span>If
the Computer portion of the <i>dirObject</i>.<b>PathName</b> (as specified in
[MS-MQMQ] section <a href="../ms-mqmq/0f858702-0f3d-471a-972c-e6706906fa4d" data-linktype="relative-path">2.1.1</a>)
is different from the <b>LocalQueueManager.ComputerName</b>, the server MAY<a id="Appendix_A_Target_52"></a><a aria-label="Product behavior note 52" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_52" data-linktype="relative-path">&lt;52&gt;</a> do the following:</p>
<ul><li><p><span><span> 
</span></span>Generate a <a href="../ms-mqcn/be84743d-30a7-4fb2-8ec6-7d2443c23913" data-linktype="relative-path">Send Change
Notification</a> event as specified in <a href="../ms-mqcn/bacb4ae1-01e4-4eaa-8e1f-c30af0df1a7f" data-linktype="relative-path">[MS-MQCN]</a>
section 3.3.4.1 with the following arguments:</p>
<ul><li><p><span><span> 
</span></span><i>iOperation</i> := QueueUpdate</p>
</li><li><p><span><span> 
</span></span><i>iDirectoryObject</i> := <i>dirObject</i></p>
</li></ul></li></ul></li></ul></li><li><p><span><span> 
</span></span>If <i>dwObjectType</i> equals MQDS_MACHINE:</p>
<ul><li><p><span><span>  </span></span>If
the <i>dirObject</i>.<b>Identifier</b> is different from the <b>LocalQueueManager.Identifier</b>,
the server MAY<a id="Appendix_A_Target_53"></a><a aria-label="Product behavior note 53" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_53" data-linktype="relative-path">&lt;53&gt;</a> do the following:</p>
<ul><li><p><span><span> 
</span></span>Generate a Send Change Notification event as specified in
[MS-MQCN] section 3.3.4.1 with the following arguments:</p>
<ul><li><p><span><span> 
</span></span><i>iOperation</i> := QueueManagerUpdate</p>
</li><li><p><span><span> 
</span></span><i>iDirectoryObject</i> := <i>dirObject</i></p>
</li></ul></li></ul></li></ul></li><li><p><span><span> 
</span></span>The server MAY<a id="Appendix_A_Target_54"></a><a aria-label="Product behavior note 54" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_54" data-linktype="relative-path">&lt;54&gt;</a> contact
other servers to propagate the changes.</p>
</li></ul></div>