LsaSetTrustedDomainInfoByName function (ntsecapi.h)

The LsaSetTrustedDomainInfoByName function sets values for a TrustedDomain object.

Syntax

NTSTATUS LsaSetTrustedDomainInfoByName(
  [in] LSA_HANDLE                PolicyHandle,
  [in] PLSA_UNICODE_STRING       TrustedDomainName,
  [in] TRUSTED_INFORMATION_CLASS InformationClass,
  [in] PVOID                     Buffer
);

Parameters

[in] PolicyHandle

A handle to a Policy object. The security descriptor of the trusted domain object determines whether the caller's changes are accepted. For information about policy object handles, see Opening a Policy Object Handle.

[in] TrustedDomainName

Name of the trusted domain to set values for. This can either be the domain name or the flat name.

[in] InformationClass

Specifies the type of information to set. Specify one of the following values.

Value Meaning
TrustedPosixInformation
Posix offset of the trusted domain.
TrustedDomainInformationEx
Extended trust information, including the basic information and DNS domain name, and attributes about the trust.
TrustedDomainAuthInformation
Authentication information for the trust, including authentication information for both the inbound and outbound side of the trust (if it exists).
TrustedDomainFullInformation
Full information, including the Posix offset and the authentication information.

[in] Buffer

Pointer to a structure that contains the information to set. The type of structure depends on the value of the InformationClass parameter.

Return value

If the function succeeds, the return value is STATUS_SUCCESS.

If the function fails, the return value is an NTSTATUS code. For more information, see the "LSA Policy Function Return Values" section of Security Management Return Values.

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

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntsecapi.h
Library Advapi32.lib
DLL Advapi32.dll

See also

LsaQueryTrustedDomainInfoByName

TRUSTED_DOMAIN_INFORMATION_EX

TRUSTED_INFORMATION_CLASS