<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/862cdc4f-79e3-4973-8fd3-2e7836010eb5" data-linktype="external">msdn link</a></p><p>The LsarQueryTrustedDomainInfo method is invoked to retrieve
information on a <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_f2ceef4e-999b-4276-84cd-2e2829de5fc4" data-linktype="relative-path">trusted
domain object</a>.</p><dl>
<dd>
<div><pre> NTSTATUS LsarQueryTrustedDomainInfo(
   [in] LSAPR_HANDLE PolicyHandle,
   [in] PRPC_SID TrustedDomainSid,
   [in] TRUSTED_INFORMATION_CLASS InformationClass,
   [out, switch_is(InformationClass)] 
     PLSAPR_TRUSTED_DOMAIN_INFO* TrustedDomainInformation
 );
</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>TrustedDomainSid: </b>A <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_e5213722-75a9-44e7-b026-8e4833f0d350" data-linktype="relative-path">security descriptor</a> of the
trusted domain object.</p><p><b>InformationClass: </b>Identifies the type of
information the caller is interested in.</p><p><b>TrustedDomainInformation: </b>Used to return the
information on the trusted domain object to the caller.</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 or more of the supplied parameters was invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC0000002</p>
  <p>STATUS_NOT_IMPLEMENTED</p>
  </td>
  <td>
  <p>The specified information class is not supported.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC0000003</p>
  <p>STATUS_INVALID_INFO_CLASS</p>
  </td>
  <td>
  <p>The <i>InformationClass</i> argument is outside the
  allowed range.</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>0xC00000DF</p>
  <p>STATUS_NO_SUCH_DOMAIN</p>
  </td>
  <td>
  <p>The specified trusted domain object does not exist.</p>
  </td>
 </tr><tr>
  <td>
  <p>0xC00002B1</p>
  <p>STATUS_DIRECTORY_SERVICE_REQUIRED</p>
  </td>
  <td>
  <p>The <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_e467d927-17bf-49c9-98d1-96ddf61ddd90" data-linktype="relative-path">Active
  Directory</a> <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_2dc07ca2-2b40-437e-a5ec-ed28ebfb116a" data-linktype="relative-path">service</a>
  was not available on the server.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Processing:</p><p>If Active Directory is not running on this machine, the
server MUST return STATUS_DIRECTORY_SERVICE_REQUIRED.</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. The server MUST verify that <i>PolicyHandle</i> grants
access as specified in section <a href="d1c2802a-70d5-4f81-843c-6523ab0c5e03" data-linktype="relative-path">3.1.4.2.2</a> with
RequiredAccess set as specified in section <a href="e74460c7-db03-45c3-ac3c-a72a840e4943" data-linktype="relative-path">3.1.4.7.13</a>.</p><p><i>TrustedDomainSid</i>: The <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_83f2020d-0804-4840-a5ac-e06439d50f8d" data-linktype="relative-path">SID</a> of the trusted domain
object to query. The server MUST verify that the caller has supplied a valid <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a> SID for this
parameter and fail the request with STATUS_INVALID_PARAMETER if the check
fails. The server MUST verify that a trusted domain object with this SID exists
in its policy database and fail the request with STATUS_NO_SUCH_DOMAIN
otherwise.</p><p><i>InformationClass</i>: A value from the <a href="36069113-6c38-45e8-920e-17f8ef36f578" data-linktype="relative-path">TRUSTED_INFORMATION_CLASS</a>
enumeration that specifies which type of information the caller is requesting.
Not all values are valid. For values outside the TRUSTED_INFORMATION_CLASS
enumeration range, the server MUST reject the request with
STATUS_INVALID_PARAMETER. For <i>InformationClass</i> values TrustedControllersInformation,
TrustedDomainAuthInformationInternal, TrustedDomainFullInformationInternal, and
for any values that would be rejected by an LsarQueryInfoTrustedDomain call,
the server MUST reject the request with an implementation-specific error. For all
other <i>InformationClass</i> values, the server MUST behave as if it is
processing an LsarQueryInfoTrustedDomain call with a <a href="31ca2a31-0be4-4773-bcef-05ad6cd3ccfb#gt_f2f00d47-6cf2-4b32-b8f7-b63e38e2e9c4" data-linktype="relative-path">trusted domain</a> handle to
the trusted domain identified by the <i>TrustedDomainSid</i> parameter.</p><p><i>TrustedDomainInformation</i>: Used to return the
requested information.</p></div>