<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/fbc7a303-9970-47a1-82cf-0bd635a35bd1" data-linktype="external">msdn link</a></p><p>The LsarQueryForestTrustInformation method is invoked to
retrieve information about a <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trust</a>
relationship with another <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_fd104241-4fb3-457c-b2c4-e0c18bb20b62" data-linktype="relative-path">forest</a>.</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 <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> context handle obtained
from either <a href="2a482ccf-1f89-4693-8594-855ff738ae8a" data-linktype="relative-path">LsarOpenPolicy</a>
or <a href="9456a963-7c21-4710-af77-d0a2f5a72d6b" data-linktype="relative-path">LsarOpenPolicy2</a>.</p><p><b>TrustedDomainName: </b>The name of the <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_f2f00d47-6cf2-4b32-b8f7-b63e38e2e9c4" data-linktype="relative-path">trusted domain</a> to query.</p><p><b>HighestRecordType: </b>The highest ordinal number
of <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_035d9ce5-f117-4251-8d4d-127c462ec4a0" data-linktype="relative-path">forest trust</a> record
type that the caller understands.</p><p><b>ForestTrustInfo: </b>Used to return the <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_8c0b82d9-efec-4723-95a9-8564edf9ba44" data-linktype="relative-path">forest trust information</a>.</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>
  <p>0x00000000</p>
  <p>STATUS_SUCCESS</p>
  </td>
  <td>
  <p>The request was successfully completed.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC0000022</p>
  <p>STATUS_ACCESS_DENIED</p>
  </td>
  <td>
  <p>The caller does not have the permissions to perform
  this operation.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC000000D</p>
  <p>STATUS_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>One of the supplied arguments was invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC00000DD</p>
  <p>STATUS_INVALID_DOMAIN_STATE</p>
  </td>
  <td>
  <p>The <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a>
  is in the wrong state of this operation.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC00000DF</p>
  <p>STATUS_NO_SUCH_DOMAIN</p>
  </td>
  <td>
  <p>The <i>TrustedDomainName</i> is not a recognized
  domain name.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC0000008</p>
  <p>STATUS_INVALID_HANDLE</p>
  </td>
  <td>
  <p><i>PolicyHandle</i> is not a valid handle.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC0000225</p>
  <p>STATUS_NOT_FOUND</p>
  </td>
  <td>
  <p>Forest trust information does not exist for this <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_f2ceef4e-999b-4276-84cd-2e2829de5fc4" data-linktype="relative-path">trusted domain object</a>.</p>
  </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 <a href="c939c70e-8cf0-4d90-a9cc-1c5002951723" data-linktype="relative-path">3.1.1.1</a>) do not contain
the same value.</p>
</li><li><p><span><span> 
</span></span>The forestFunctionality specified in <a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a>
section <a href="../ms-adts/d49624d0-9320-4368-8b0c-a7998ac2abdb" data-linktype="relative-path">3.1.1.3.2.27</a>
is not DS_BEHAVIOR_WIN2003 or higher.</p>
</li><li><p><span><span> 
</span></span><a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90" data-linktype="relative-path">Active
Directory</a> 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 <a href="700a91e8-a1a4-4e1b-9ad6-096b3cf0bef0" data-linktype="relative-path">LSA_FOREST_TRUST_RECORD_TYPE</a>
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 <a href="0228f75e-9725-479c-b4cd-1cacd667343c" data-linktype="relative-path">3.1.1.5</a>. Any records of
type ForestTrustBinaryInfo and later must be returned to the caller as
ForestTrustBinaryInfo type records (sections <a href="08cf1a65-ef7c-46d3-aa4d-558f5135df3d" data-linktype="relative-path">2.2.7.21</a> 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 <a href="e5e1e32e-4066-435d-b669-044fe997eaf7" data-linktype="relative-path">3.1.4.2.1</a> with <i>DesiredAccess</i>
set to TRUSTED_QUERY_AUTH. There is no method-specific portion of this check.</p></div>