Export (0) Print
Expand All

LsaQueryTrustedDomainInfoByName function

The LsaQueryTrustedDomainInfoByName function returns information about a trusted domain.

Syntax


NTSTATUS LsaQueryTrustedDomainInfoByName(
  _In_  LSA_HANDLE                PolicyHandle,
  _In_  PLSA_UNICODE_STRING       TrustedDomainName,
  _In_  TRUSTED_INFORMATION_CLASS InformationClass,
  _Out_ PVOID                     *Buffer
);

Parameters

PolicyHandle [in]

A handle to a Policy object. This handle must have the POLICY_VIEW_LOCAL_INFORMATION access right. For more information, see Opening a Policy Object Handle.

TrustedDomainName [in]

String that contains the name of the trusted domain. This can either be the domain name or the flat name.

InformationClass [in]

Specifies the type of information to retrieve. This parameter can be one of the following values.

ValueMeaning
TrustedDomainNameInformation

Name of the trusted domain.

TrustedPosixInformation

Posix offset of the trusted domain.

TrustedPasswordInformation

Returns the password on the outbound side of the trust.

TrustedDomainInformationBasic

This value is not supported.

TrustedDomainInformationEx

Extended trust information, including the basic information and DNS domain name, and attributes about the trust.

TrustedDomainFullInformation

Full information, including the Posix offset and the authentication information.

 

Buffer [out]

Receives a pointer to the returned buffer that contains the requested information. The format and content of this buffer depend on the information class. For example, if InformationClass is set to TrustedDomainInformationEx, Buffer receives a pointer to a TRUSTED_DOMAIN_INFORMATION_EX structure. For more information, see TRUSTED_INFORMATION_CLASS.

When you have finished using the buffer, free it by calling the LsaFreeMemory function.

Return value

If the function succeeds, the function returns STATUS_SUCCESS.

If the function fails, it returns an NTSTATUS value, which can be one of the following values or one of the LSA Policy Function Return Values.

ValueDescription
STATUS_ACCESS_DENIED

Caller does not have the appropriate access to complete the operation. For a list of the required access types, see the description of the InformationClass parameter.

STATUS_INSUFFICIENT_ RESOURCES

Insufficient system resources, such as memory, to complete the call.

 

You can use the LsaNtStatusToWinError function to convert the NTSTATUS value to a Windows error code.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecapi.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

LsaFreeMemory
LsaQueryTrustedDomainInfo
LsaSetTrustedDomainInfoByName
TRUSTED_DOMAIN_INFORMATION_EX
TRUSTED_INFORMATION_CLASS

 

 

Community Additions

ADD
Show:
© 2015 Microsoft