31{
36
40
41 SIZE_T DomainNameLength = 0;
43
44 DPRINT(
"SYSSETUP: SetAccountsDomainSid\n");
45
46 if (DomainName !=
NULL)
47 {
48 DomainNameLength =
wcslen(DomainName);
50 {
52 }
53 }
54
57
61 &PolicyHandle);
63 {
64 DPRINT(
"LsaOpenPolicy failed (Status: 0x%08lx)\n",
Status);
66 }
67
72 {
73 if (DomainName ==
NULL)
74 {
78 }
79 else
80 {
82 Info.DomainName.Length = DomainNameLength *
sizeof(
WCHAR);
83 Info.DomainName.MaximumLength =
Info.DomainName.Length +
sizeof(
WCHAR);
84 }
85
86 if (DomainSid ==
NULL)
88 else
89 Info.DomainSid = DomainSid;
90 }
91 else
92 {
94 Info.DomainName.Length = DomainNameLength *
sizeof(
WCHAR);
95 Info.DomainName.MaximumLength =
Info.DomainName.Length +
sizeof(
WCHAR);
96 Info.DomainSid = DomainSid;
97 }
98
103 {
104 DPRINT(
"LsaSetInformationPolicy failed (Status: 0x%08lx)\n",
Status);
105 }
106
107 if (OrigInfo !=
NULL)
109
111
115
117 &ServerHandle,
121 {
125 &DomainHandle);
127 {
130 &DomainNameInfo);
132 {
133 DPRINT1(
"SamSetInformationDomain failed (Status: 0x%08lx)\n",
Status);
134 }
135
137 }
138 else
139 {
141 }
142
144 }
145
147}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
NTSTATUS WINAPI LsaSetInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, IN PVOID Buffer)
NTSTATUS WINAPI LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName OPTIONAL, IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes, IN ACCESS_MASK DesiredAccess, OUT PLSA_HANDLE PolicyHandle)
NTSTATUS WINAPI LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer)
NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
#define UNICODE_STRING_MAX_CHARS
#define DOMAIN_WRITE_OTHER_PARAMETERS
#define SAM_SERVER_LOOKUP_DOMAIN
#define SAM_SERVER_CONNECT
@ PolicyAccountDomainInformation
struct _LSA_OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES
#define POLICY_TRUST_ADMIN
#define POLICY_VIEW_LOCAL_INFORMATION
NTSTATUS NTAPI SamConnect(IN OUT PUNICODE_STRING ServerName OPTIONAL, OUT PSAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSTATUS NTAPI SamCloseHandle(IN SAM_HANDLE SamHandle)
NTSTATUS NTAPI SamOpenDomain(IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
NTSTATUS NTAPI SamSetInformationDomain(IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PVOID Buffer)
UNICODE_STRING DomainName
LSA_UNICODE_STRING DomainName
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info