<div class="content" name="LsarQueryForestTrustInformation" uuid="fbc7a303-9970-47a1-82cf-0bd635a35bd1"><p>The LsarQueryForestTrustInformation method is invoked to
retrieve information about a <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trust</a></span> relationship
with another <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_fd104241-4fb3-457c-b2c4-e0c18bb20b62" data-linktype="relative-path">forest</a></span>.</p><dl>
<dd>
<div><pre> NTSTATUS LsarQueryForestTrustInformation(
   [in] LSAPR_HANDLE PolicyHandle,
   [in] PLSA_UNICODE_STRING TrustedDomainName,
   [in] LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
   [out] PLSA_FOREST_TRUST_INFORMATION* ForestTrustInfo
 );
</pre></div>
</dd></dl><p><b>PolicyHandle: </b>An <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> context handle
obtained from either <span><a href="2a482ccf-1f89-4693-8594-855ff738ae8a" data-linktype="relative-path">LsarOpenPolicy</a></span> or <span><a href="9456a963-7c21-4710-af77-d0a2f5a72d6b" data-linktype="relative-path">LsarOpenPolicy2</a></span>.</p><p><b>TrustedDomainName: </b>The name of the <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_f2f00d47-6cf2-4b32-b8f7-b63e38e2e9c4" data-linktype="relative-path">trusted
domain</a></span> to query.</p><p><b>HighestRecordType: </b>The highest ordinal number
of <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_035d9ce5-f117-4251-8d4d-127c462ec4a0" data-linktype="relative-path">forest
trust</a></span> record type that the caller understands.</p><p><b>ForestTrustInfo: </b>Used to return the <span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_8c0b82d9-efec-4723-95a9-8564edf9ba44" data-linktype="relative-path">forest
trust information</a></span>.</p><p><b>Return Values: </b>The following is a summary of
the return values that an implementation MUST return, as specified by the
message processing that follows.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 STATUS_SUCCESS</td>
  <td>The request was successfully completed.</td>
 </tr><tr>
  <td>0xC0000022 STATUS_ACCESS_DENIED</td>
  <td>The caller does not have the permissions to perform this operation.</td>
 </tr><tr>
  <td>0xC000000D STATUS_INVALID_PARAMETER</td>
  <td>One of the supplied arguments was invalid.</td>
 </tr><tr>
  <td>0xC00000DD STATUS_INVALID_DOMAIN_STATE</td>
  <td>The domain is in the wrong state of this operation.</td>
 </tr><tr>
  <td>0xC00000DF STATUS_NO_SUCH_DOMAIN</td>
  <td>The TrustedDomainName is not a recognized domain name.</td>
 </tr><tr>
  <td>0xC0000008 STATUS_INVALID_HANDLE</td>
  <td>PolicyHandle is not a valid handle.</td>
 </tr><tr>
  <td>0xC0000225 STATUS_NOT_FOUND</td>
  <td>Forest trust information does not exist for this trusted domain object.</td>
 </tr></tbody></table>
</dd></dl><p>Processing:</p><p>This message takes four arguments:</p><p><i>PolicyHandle</i>: An open handle to the policy object. If
the handle is not a valid context handle to the policy object or <i>PolicyHandle</i>.HandleType
does not equal &#34;Policy&#34;, the server MUST return
STATUS_INVALID_HANDLE. <i>PolicyHandle</i>.GrantedAccess MUST NOT be considered
for this call because the access check MUST happen on the trusted domain
object.</p><p><i>TrustedDomainName</i>: The name of the trusted domain
object to query.</p><p>The server MUST return STATUS_INVALID_DOMAIN_STATE if any of
the following conditions is TRUE:</p><ul><li><p><span><span> 
</span></span>The <b>DnsForestName</b> and <b>DnsDomainName</b> fields in DNS
Domain Information (see section <span><a href="c939c70e-8cf0-4d90-a9cc-1c5002951723" data-linktype="relative-path">3.1.1.1</a></span>) do not
contain the same value.</p>
</li><li><p><span><span> 
</span></span>The forestFunctionality specified in <span><a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a></span>
section <span><a href="../ms-adts/d49624d0-9320-4368-8b0c-a7998ac2abdb" data-linktype="relative-path">3.1.1.3.2.27</a></span>
is not DS_BEHAVIOR_WIN2003 or higher.</p>
</li><li><p><span><span> 
</span></span><span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90" data-linktype="relative-path">Active Directory</a></span> is
not running on this machine.</p>
</li></ul><p>If a trusted domain object by the name TrustedDomainName
does not exist, the server MUST return STATUS_NO_SUCH_DOMAIN.</p><p><i>HighestRecordType</i>: The caller sets this argument to
the highest <span><a href="700a91e8-a1a4-4e1b-9ad6-096b3cf0bef0" data-linktype="relative-path">LSA_FOREST_TRUST_RECORD_TYPE</a></span>
enum value recognized by the caller. This parameter is ignored by the server.</p><p><i>ForestTrustInfo</i>: Used to return the forest trust
information associated with the trusted domain object. This corresponds to the
Forest Trust Information abstract data model specified in section <span><a href="0228f75e-9725-479c-b4cd-1cacd667343c" data-linktype="relative-path">3.1.1.5</a></span>.
Any records of type ForestTrustBinaryInfo and later MUST be returned to the
caller as ForestTrustBinaryInfo type records (sections <span><a href="08cf1a65-ef7c-46d3-aa4d-558f5135df3d" data-linktype="relative-path">2.2.7.21</a></span>
and 2.2.7.22).</p><p>If the trusted domain object is not of the type that
supports a forest trust (as determined by the presence or absence of the
TRUST_ATTRIBUTE_FOREST_TRANSITIVE attribute), the server MUST return
STATUS_INVALID_PARAMETER. If the forest trust information does not exist on a
trusted domain object that otherwise can support a forest trust, the server
MUST return STATUS_NOT_FOUND.</p><p>The server MUST verify that the caller has access to the
trusted domain object as specified in section <span><a href="e5e1e32e-4066-435d-b669-044fe997eaf7" data-linktype="relative-path">3.1.4.2.1</a></span> with <i>DesiredAccess</i>
set to TRUSTED_QUERY_AUTH. There is no method-specific portion of this check.</p></div>