<div class="content"><p> </p><p>The <b>NetrGetJoinInformation</b> method retrieves details
about the workgroup or <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a></span> to which the
specified computer is joined.</p><dl>
<dd>
<div><pre> unsigned long NetrGetJoinInformation(
   [in, string, unique] WKSSVC_IMPERSONATE_HANDLE ServerName,
   [in, out, string] wchar_t** NameBuffer,
   [out] PNETSETUP_JOIN_STATUS BufferType
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>A <b>WKSSVC_IMPERSONATE_HANDLE</b>
structure (section <span><a href="2427e140-22b3-45f8-9e12-1b3593308e46" data-linktype="relative-path">2.2.2.2</a></span>) that
specifies the <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server (2)</a></span>. The <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST map this structure to an <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> binding <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_5044babb-08e3-4bb9-bc12-fe8f542b05ee" data-linktype="relative-path">handle</a></span>
(<span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span> sections
4.3.5 and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>NameBuffer: </b>A pointer to the address of the
buffer that receives the name of the domain or workgroup to which the computer
is joined, and that also specifies the <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_9a7bc8b3-3374-4608-8f73-be20a90b898b" data-linktype="relative-path">computer name</a></span> as
input. The server MUST ignore this parameter on input.</p><p><b>BufferType: </b>A pointer to a value from the <b>NETSETUP_JOIN_STATUS</b>
enumeration (section <span><a href="64c07967-1eb9-4021-a9a9-fe9995c906e1" data-linktype="relative-path">2.2.3.1</a></span>) that
specifies the status of a workstation.</p><p><b>Return Values: </b>When the message processing
result meets the description in column two of the following table, this method
MUST return one of the following values (<span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>).</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>NERR_Success</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The operation completed successfully.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_ACCESS_DENIED</p>
  <p>0x00000005</p>
  </td>
  <td>
  <p>Access is denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>RPC_S_PROTSEQ_NOT_SUPPORTED</p>
  <p>0x000006A7</p>
  </td>
  <td>
  <p>The <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_0c171cc7-e9c4-41b6-95a9-536db0042c7a" data-linktype="relative-path">RPC protocol sequence</a></span>
  is not supported.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Any other return value MUST conform to the error code
requirements in <b>Protocol Details</b> (section <span><a href="aeea622a-ea3e-40cc-a9b1-b4a2a3b2bf6b" data-linktype="relative-path">3</a></span>).</p><p>The following statements define the sequence of
message-processing operations.</p><ol><li><p><span>    </span>The server (2)
MUST retrieve the RPC protocol sequence used for the current call (<span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/0ceefe4c-0d7a-423f-bcd0-54e821767f89" data-linktype="relative-path">3.1.3.4.1</a></span>),
specifying the server binding handle maintained by the RPC runtime ([C706]
section 6.2.1). If that RPC protocol sequence is not <b>NCACN_NP</b>, the
server SHOULD return <b>RPC_S_PROTSEQ_NOT_SUPPORTED</b>.<a id="Appendix_A_Target_56"></a><a aria-label="Product behavior note 56" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_56" data-linktype="relative-path">&lt;56&gt;</a></p>
</li><li><p><span>    </span>The server MUST
check that the caller has been granted access rights using the algorithm in the
<b>Access Control Abstract Data Model</b> (section <span><a href="c5b75090-3de2-404f-8de1-d5ca3fc38a70" data-linktype="relative-path">3.2.1.1</a></span>), with <i>Access
Request mask</i> initialized to <b>WKSTA_NETAPI_QUERY</b>; if not, the server
MUST return ERROR_ACCESS_DENIED.</p>
</li><li><p><span>    </span>The server MUST
impersonate the client by invoking the <b>StartImpersonatingClient</b> task
(section <span><a href="719ae534-d5d7-4c42-9989-d63e0676fad1" data-linktype="relative-path">3.2.4.29.6</a></span>). If
this operation fails, the server MUST return an error.</p>
</li><li><p><span>    </span>The server MUST
compute the response in the following way.</p>
<ul><li><p><span><span>  </span></span>If <b>DomainNameFQDN</b>
(section <span><a href="e0b508bc-764d-48b7-b44b-4f93c3d5cf8c" data-linktype="relative-path">3.2.1.5</a></span>) is set to
NULL, <i>BufferType</i> is set to NetSetupUnjoined, and <i>NameBuffer</i> is
set to NULL.</p>
</li><li><p><span><span>  </span></span>Else
if <b>DomainSid</b> is set to NULL, <i>BufferType</i> is set to <b>NetSetupWorkgroupName</b>
(section 2.2.3.1) and <i>NameBuffer</i> is set to <b>DomainNameNetBIOS</b>
(section 3.2.1.5).</p>
</li><li><p><span><span>  </span></span>Else
<i>BufferType</i> is set to <b>NetSetupDomainName</b> (section 2.2.3.1) and <i>NameBuffer</i>
is set to <b>DomainNameFQDN</b>.</p>
</li></ul></li><li><p><span>    </span>The server MUST
stop impersonating the client by invoking the <b>StopImpersonatingClient</b>
task (section <span><a href="cf258b4a-d66b-4407-85f7-aac7823ec0aa" data-linktype="relative-path">3.2.4.29.7</a></span>).</p>
</li></ol><p>If no errors occur, the server MUST return NERR_Success.</p></div>