<div class="content" name="S_DSGetComputerSites" uuid="5d792b1c-e031-40b7-b8b2-d0c594a82069"><p>The <b>S_DSGetComputerSites</b> method returns the site
identifier for every site of which the specified computer is a member.</p><dl>
<dd>
<div><pre> HRESULT S_DSGetComputerSites(
   [in] handle_t hBind,
   [in, unique] const wchar_t* pwcsPathName,
   [out] DWORD* pdwNumberOfSites,
   [out, size_is(,*pdwNumberOfSites), length_is(,*pdwNumberOfSites)] 
     GUID** ppguidSites,
   [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>pwcsPathName: </b> MUST be set by the client to a pointer
to a NULL-terminated 16-bit <a href="993fa29f-3deb-494f-b4b4-492ee945735f#gt_b069acb4-e364-453e-ac83-42d469bb339e" data-linktype="relative-path">Unicode
string</a> that contains the directory service pathname, as specified in
section <a href="6e03fb44-a705-4728-acca-7c6d7b8d7396" data-linktype="relative-path">2.2.9</a>, of the
object in the Directory Service. The pathname MUST be the pathname of an object
of type MQDS_MACHINE.<a id="Appendix_A_Target_154"></a><a aria-label="Product behavior note 154" href="9c868bc8-426a-4e5f-8b45-cee7d49c3d10#Appendix_A_154" data-linktype="relative-path">&lt;154&gt;</a></p><p><b>pdwNumberOfSites: </b>Number of site identifiers returned
in the <i>ppguidSites</i> parameter.</p><p><b>ppguidSites: </b>An array of pointers to the <a href="../ms-dtyp/4926e530-816e-41c2-b251-ec5c7aca018a" data-linktype="relative-path">GUID</a>
site identifiers of the sites of which the computer is a member. Each GUID
referenced by the array MUST be the site identifier for a site that the machine
object specified by <i>pwcsPathName</i> is a member of. These are obtained from
the PROPID_QM_SITE_IDS property of the MQDS_MACHINE object. The array MUST
contain the site identifier for every site to which the object specified by <i>pwcsPathName</i>
is a member.</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 <i>pbServerSignature</i>. See section
3.1.4.2.</p><p><b>pbServerSignature: </b>A buffer that contains a signed
hash over the array of site GUIDs returned in <i>ppguidSites</i>.</p><p><b>pdwServerSignatureSize: </b>Contains the maximum length
of the server signature in bytes to return. </p><p><b>Return Values: </b> If the method succeeds, the return
value is MQ_OK (0x00000000). If the method fails, the return value is an
implementation-specific error code.</p><p><b>MQ_OK</b> (0x00000000)</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>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>
:= MQDS_MACHINE.</p>
</li><li><p><span><span>  </span></span><i>iPathName</i>
:= <i>pwcsPathName</i>.</p>
</li><li><p><span><span>  </span></span><i>iGuid</i>
:= NULL.</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>ppguidSites</i>
to <i>rObject</i>.<b>SiteIdentifierList</b>.</p>
</li><li><p><span><span> 
</span></span>Calculate the <i>pbServerSignature</i> by using the MD5 algorithm
(as specified in <a href="https://go.microsoft.com/fwlink/?LinkId=90275" data-linktype="external">[RFC1321]</a>)
and the GSS security context as specified by the following pseudocode.</p>
<ul><li><p><span><span>  </span></span>Initialize
an MD5 Hash context.</p>
</li><li><p><span><span>  </span></span>Add
to the hash context the DWORD value 0x00000001.</p>
</li><li><p><span><span>  </span></span>Add
to the hash value the DWORD value of VT_BLOB.</p>
</li><li><p><span><span>  </span></span>SET
cbSize to pdwNumberOfSites times the size in bytes of a GUID.</p>
</li><li><p><span><span>  </span></span>Add
to the hash value the DWORD value of cbSize.</p>
</li><li><p><span><span>  </span></span>Add
to the hash context the contents of ppGuidSites where the length for the data
is cbSize.</p>
</li><li><p><span><span>  </span></span>Call
GSS_Wrap using the output context handle from GSS security context and the
computed MD5 hash.</p>
</li><li><p><span><span>  </span></span>SET
pbServerSignature to the wrapped MD5 hash.</p>
</li><li><p><span><span>  </span></span>SET
*pdwServerSignatureSize to the size of the wrapped MD5 hash.</p>
</li></ul></li><li><p><span><span> 
</span></span>Set <i>pdwServerSignatureSize</i> 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>