<div class="content" name="S_DSGetPropsGuid" uuid="0e4d0095-54ef-4b30-9599-3b8613b7d8ea"><p>This method returns properties associated with a directory
object specified by an object identifier.</p><dl>
<dd>
<div><pre> HRESULT S_DSGetPropsGuid(
   [in] handle_t hBind,
   [in, range(1,58)] unsigned long dwObjectType,
   [in, unique] const GUID* pGuid,
   [in, range(1,128)] unsigned long cp,
   [in, size_is(cp)] unsigned long aProp[],
   [in, out, size_is(cp)] PROPVARIANT apVar[],
   [in] PCONTEXT_HANDLE_SERVER_AUTH_TYPE phServerAuth,
   [out, size_is(*pdwServerSignatureSize)] 
     unsigned char* pbServerSignature,
   [in, out] LPBOUNDED_SIGNATURE_SIZE pdwServerSignatureSize
 );
</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 retrieved. MUST be set to 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> MUST be set by the client to a 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 retrieved.</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
retrieve from the object designated by pGuid. 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 (defined 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>On input, each element MUST be initialized to
the appropriate <b>VARTYPE</b> (<a href="../ms-mqmq/b7cc2590-a617-45df-b6a3-1f31102b36fb" data-linktype="relative-path">[MS-MQMQ]</a>
section <a href="../ms-mqmq/7ebd137c-ce66-49d6-b90e-22560f9155e5" data-linktype="relative-path">2.2.12.1</a>)
for the associated property specified by the same element in <i>aProp</i>, or
VT_NULL. On success, the server MUST populate the elements of this array with
property values for the properties identified by the corresponding elements of <i>aProp</i>.
The array MUST contain at least one element.</p><p><b>phServerAuth: </b> A <a href="c28a1e6b-4092-4443-b69f-5814d5c4f9e4" data-linktype="relative-path">PCONTEXT_HANDLE_SERVER_AUTH_TYPE</a>
RPC context handle acquired from the <i>pphServerAuth</i> parameter in a
previous call to <a href="0e3ad7d0-6a64-480a-9f13-e94dd608d79d" data-linktype="relative-path">S_DSValidateServer</a>.
The server MUST use this parameter as a key to locate the GSS security context
used to compute the signature returned in the <i>pbServerSignature</i>
parameter. See section 3.1.4.2.</p><p><b>pbServerSignature: </b> See the <i>pbServerSignature</i>
parameter description, as specified in section <a href="f9f1a376-c436-4a27-815d-7d1e27a151e5" data-linktype="relative-path">3.1.4.7</a>.</p><p><b>pdwServerSignatureSize: </b> Contains the maximum length
in bytes of the server signature to return.</p><p><b>Return Values: </b> On success, this method MUST return
MQ_OK (0x00000000); otherwise, the server MUST return a failure <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>.
Additionally, if a failure HRESULT is returned, the client MUST disregard all
out-parameter values.</p><p><b>MQ_OK</b> (0x00000000)</p><p><b>MQ_ERROR_USER_BUFFER_TOO_SMALL</b> (0xC00E0028)</p><p><b>MQ_ERROR_INVALID_PARAMETER</b> (0xC00E0006)</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 each of the <i>aProp</i> and <i>apVar</i> arrays
contains at least one element. If not, the server SHOULD<a id="Appendix_A_Target_41"></a><a aria-label="Product behavior note 41" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_41" data-linktype="relative-path">&lt;41&gt;</a> return an error.</p>
</li><li><p><span><span> 
</span></span>Verify for each property identifier in <i>aProp</i>, that the
property identifier is valid for the object type specified in <i>dwObjectType</i>
as specified in the tables in section 2.2.10.1. </p>
</li><li><p><span><span> 
</span></span>Determine if each element of <i>apVar</i> is set to VT_NULL or to
the appropriate <b>VARTYPE</b> for the corresponding property identifier at the
same element index in <i>aProp</i>. If not, return an error code.</p>
</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 a <a href="5c5b8c07-fef2-4e03-ba2d-7e6fc6527d6e" data-linktype="relative-path">Get
Directory Object (section 3.1.6.12)</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>For each element in the <i>aProp</i> array, populate the
corresponding element of the <i>apVar</i> array from <i>dirObject</i> according
to the rules defined in the following table. If any of the <i>aProp</i>
elements is not present in the rules, return an error HRESULT.<a id="Appendix_A_Target_42"></a><a aria-label="Product behavior note 42" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_42" data-linktype="relative-path">&lt;42&gt;</a> If no properties are specified
in <i>aProp</i>, the server SHOULD<a id="Appendix_A_Target_43"></a><a aria-label="Product behavior note 43" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_43" data-linktype="relative-path">&lt;43&gt;</a> return
MQ_ERROR_INVALID_PARAMETER (0xC00E0006). If any property in <i>aProp</i> is a <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_c7c52d99-72e6-42b7-9b8f-84276d320cee" data-linktype="relative-path">private property</a>, the
server MUST return MQ_ERROR_ILLEGAL_PROPID (0xC00E0039).</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="8cad50a9-0727-446f-983e-526b1c39488c" data-linktype="relative-path">3.1.4.21.8.1.4</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_MACHINE</p>
  </td>
  <td>
  <p>See section <a href="9cadc21b-4380-4ca4-88cc-9675e5b8de52" data-linktype="relative-path">3.1.4.21.8.1.1</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_SITE</p>
  </td>
  <td>
  <p>See section <a href="a0c26666-8fe4-4857-be84-0148244205d0" data-linktype="relative-path">3.1.4.21.8.1.8</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_CN</p>
  </td>
  <td>
  <p>See section <a href="019fd145-2b1e-4384-bc4e-a56291af3757" data-linktype="relative-path">3.1.4.21.8.1.10</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ENTERPRISE</p>
  </td>
  <td>
  <p>See section <a href="9f43e08c-b5b8-4946-99bb-b0b74bb3e553" data-linktype="relative-path">3.1.4.21.8.1.6</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_ROUTINGLINK</p>
  </td>
  <td>
  <p>See section <a href="93678d5f-bb0e-4af6-8dfa-4e066dcbe639" data-linktype="relative-path">3.1.4.21.8.1.9</a></p>
  </td>
 </tr><tr>
  <td>
  <p>MQDS_USER</p>
  </td>
  <td>
  <p>See section <a href="3b00c62b-8c57-4fba-a6af-f6482b373285" data-linktype="relative-path">3.1.4.21.8.1.11</a></p>
  </td>
 </tr></tbody></table>
</li><li><p><span><span> 
</span></span>Construct the <i>pbServerSignature</i> parameter by creating a
hash by using the <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_1535fdac-8d46-4605-96af-252907c4a593" data-linktype="relative-path">MD5</a>
algorithm, as specified in <a href="https://go.microsoft.com/fwlink/?LinkId=90275" data-linktype="external">[RFC1321]</a>, and sealing
it, as specified by the following pseudocode:</p>
<div><pre> Initialize an MD5 hash context
  
 Add to the hash context the DWORD data value representing the count 
 of properties to be returned (from parameter cp).
  
 FOR each property returned in apVar
  
 Add to the hash context the DWORD value of the property 
  identifier (from aProp[])
  
 Add to the hash context the type-specific data value of the 
  property (from apVar[]). The data value and length are 
  defined by the variant type of the property (apVar[].vt)
 ENDFOR
  
 Call GSS_Wrap using the token from output context handle from the 
 GSS security context and the computed MD5 hash
  
 Set pbServerSignature to the wrapped MD5 hash
  
 Set *pdwServerSignatureSize to the size of the wrapped MD5 hash
  
</pre></div>
</li><li><p><span><span> 
</span></span>MUST set the <i>pdwServerSignatureSize</i> parameter to the
actual length in bytes of the server signature on output. If the server
signature is larger than the supplied buffer, the server MUST return
MQ_ERROR_USER_BUFFER_TOO_SMALL (0xC00E0028).</p>
</li></ul></div>