LsaQueryTrustedDomainInfo Function Home
LsaQueryTrustedDomainInfo Function

The LsaQueryTrustedDomainInfo function retrieves information about a trusted domain.

Syntax

NTSTATUS LsaQueryTrustedDomainInfo(
  __in   LSA_HANDLE PolicyHandle,
  __in   PSID TrustedDomainSid,
  __in   TRUSTED_INFORMATION_CLASS InformationClass,
  __out  PVOID *Buffer
);


Parameters

PolicyHandle [in]

A handle to the Policy object of a domain controller that has a trust relationship with the domain identified by the TrustedDomainSid parameter. The handle must have the POLICY_VIEW_LOCAL_INFORMATION access right. For more information, see Opening a Policy Object Handle.

TrustedDomainSid [in]

Pointer to the SID of the trusted domain to query.

InformationClass [in]

Specifies one of the following values from the TRUSTED_INFORMATION_CLASS enumeration type. The value indicates the type of information being requested.

ValueMeaning
TrustedDomainNameInformation

Retrieves the name of the trusted domain. The Buffer parameter receives a pointer to a TRUSTED_DOMAIN_NAME_INFO structure.

TrustedPosixOffsetInformation

Retrieves the value used to generate Posix user and group identifiers for the trusted domain. The Buffer parameter receives a pointer to a TRUSTED_POSIX_OFFSET_INFO structure.

TrustedPasswordInformation

Retrieves the password for the trusted domain. The Buffer parameter receives a pointer to a TRUSTED_PASSWORD_INFO structure. The handle passed in the PolicyHandle parameter must have the POLICY_GET_PRIVATE_INFORMATION access right.

TrustedDomainInformationEx

Retrieves extended information for the trusted domain. The Buffer parameter receives a pointer to a TRUSTED_DOMAIN_INFORMATION_EX structure.

TrustedDomainInformationBasic

This value is not supported.

TrustedDomainFullInformation

Retrieves complete information for the trusted domain. This information includes the Posix offset information, authentication information, and the extended information returned for the TrustedDomainInformationEx value. The Buffer parameter receives a pointer to a TRUSTED_DOMAIN_FULL_INFORMATION structure.

 

Buffer [out]

A pointer to a buffer that receives a pointer to a structure that contains the requested information. The type of structure depends on the value of the InformationClass parameter.

When you have finished using the information, free the returned pointer by passing it to LsaFreeMemory.

Return Value

If the function succeeds, the function returns STATUS_SUCCESS.

If the function fails, it returns an NTSTATUS value that indicates the error. For more information, see LSA Policy Function Return Values.

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

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderNtsecapi.h
LibraryAdvapi32.lib
DLLAdvapi32.dll

See Also

LsaSetTrustedDomainInformation
POLICY_ACCOUNT_DOMAIN_INFO
POLICY_AUDIT_EVENTS_INFO
POLICY_DNS_DOMAIN_INFO
POLICY_LSA_SERVER_ROLE_INFO
POLICY_MODIFICATION_INFO
POLICY_PRIMARY_DOMAIN_INFO
TRUSTED_INFORMATION_CLASS

Send comments about this topic to Microsoft

Build date: 11/19/2009

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View