Go to the source code of this file.
◆ SampAddMemberToAlias()
Definition at line 39 of file alias.c.
41{
47
49 AliasObject, MemberId);
50
52 TRACE(
"Member SID: %S\n", MemberIdString);
53
55
59 &MembersKeyHandle);
61 {
62 TRACE(
"SampRegCreateKey failed with status 0x%08lx\n",
Status);
63 goto done;
64 }
65
67 MemberIdString,
69 MemberId,
70 MemberIdLength);
72 {
73 TRACE(
"SampRegSetValue failed with status 0x%08lx\n",
Status);
74 goto done;
75 }
76
78 MemberIdString,
80 &MemberKeyHandle);
82 {
83 TRACE(
"SampRegCreateKey failed with status 0x%08lx\n",
Status);
84 goto done;
85 }
86
88 AliasObject->Name,
90 MemberId,
91 MemberIdLength);
93 {
94 TRACE(
"SampRegSetValue failed with status 0x%08lx\n",
Status);
95 goto done;
96 }
97
98done:
101
102 if (MemberIdString !=
NULL)
104
106}
#define NT_SUCCESS(StatCode)
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
NTSTATUS SampRegCloseKey(IN OUT PHANDLE KeyHandle)
NTSTATUS SampRegSetValue(HANDLE KeyHandle, LPCWSTR ValueName, ULONG Type, LPVOID Data, ULONG DataLength)
NTSTATUS SampRegCreateKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Referenced by SamrAddMemberToAlias().
◆ SampGetMembersInAlias()
Definition at line 218 of file alias.c.
221{
228
229
233 &MembersKeyHandle);
235 {
236 ERR(
"SampRegOpenKey failed with status 0x%08lx\n",
Status);
237 goto done;
238 }
239
240
245 {
246 ERR(
"SampRegQueryKeyInfo failed with status 0x%08lx\n",
Status);
247 goto done;
248 }
249
250
253 {
255 goto done;
256 }
257
258
261 {
262
272 {
275 break;
276 }
277
278
281 {
283 goto done;
284 }
285
286
295 {
296 goto done;
297 }
298
300 }
301
303 {
304 *MemberCount =
Count;
305 *MemberArray = Members;
306 }
307
308done:
310}
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
NTSTATUS SampRegEnumerateValue(IN HANDLE KeyHandle, IN ULONG Index, OUT LPWSTR Name, IN OUT PULONG NameLength, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL)
NTSTATUS SampRegQueryKeyInfo(IN HANDLE KeyHandle, OUT PULONG SubKeyCount, OUT PULONG ValueCount)
NTSTATUS SampRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle)
#define STATUS_NO_MORE_ENTRIES
#define midl_user_allocate
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCOLLECTION _In_ ULONG Index
Referenced by SampRemoveAllMembersFromAlias(), and SamrGetMembersInAlias().
◆ SampOpenAliasObject()
Definition at line 14 of file alias.c.
18{
20
21 TRACE(
"(%p %lu %lx %p)\n",
23
24
26
27
30 szRid,
31 AliasId,
34 AliasObject);
35}
NTSTATUS SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject, IN LPWSTR ContainerName, IN LPWSTR ObjectName, IN ULONG RelativeId, IN SAM_DB_OBJECT_TYPE ObjectType, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *DbObject)
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
◆ SampRemoveAllMembersFromAlias()
Definition at line 314 of file alias.c.
315{
318 ULONG MemberCount = 0;
321
322 TRACE(
"(%p)\n", AliasObject);
323
324
328 &MembersKeyHandle);
330 {
331 ERR(
"SampRegOpenKey failed (Status 0x%08lx)\n",
Status);
332 goto done;
333 }
334
335
337 &MemberCount,
338 &MemberArray);
340 {
341 ERR(
"SampGetMembersInAlias failed (Status 0x%08lx)\n",
Status);
342 goto done;
343 }
344
345
347 {
349 MemberArray[
Index].SidPointer);
351 goto done;
352 }
353
354done:
355 if (MemberArray !=
NULL)
356 {
358 {
359 if (MemberArray[
Index].SidPointer !=
NULL)
361 }
362
364 }
365
367
369}
NTSTATUS SampGetMembersInAlias(IN PSAM_DB_OBJECT AliasObject, OUT PULONG MemberCount, OUT PSAMPR_SID_INFORMATION *MemberArray)
NTSTATUS NTAPI SampRemoveMemberFromAlias(IN PSAM_DB_OBJECT AliasObject, IN PRPC_SID MemberId)
Referenced by SamrDeleteAlias().
◆ SampRemoveMemberFromAlias()
Definition at line 111 of file alias.c.
113{
119
121 AliasObject, MemberId);
122
124 TRACE(
"Member SID: %S\n", MemberIdString);
125
127 MemberIdString,
129 &MemberKeyHandle);
131 {
132 TRACE(
"SampRegOpenKey failed with status 0x%08lx\n",
Status);
133 goto done;
134 }
135
137 AliasObject->Name);
139 {
140 TRACE(
"SampRegDeleteValue failed with status 0x%08lx\n",
Status);
141 goto done;
142 }
143
146 &ulValueCount);
148 {
149 TRACE(
"SampRegQueryKeyInfo failed with status 0x%08lx\n",
Status);
150 goto done;
151 }
152
153 if (ulValueCount == 0)
154 {
156
158 MemberIdString);
160 {
161 TRACE(
"SampRegDeleteKey failed with status 0x%08lx\n",
Status);
162 goto done;
163 }
164 }
165
169 &MembersKeyHandle);
171 {
172 TRACE(
"SampRegOpenKey failed with status 0x%08lx\n",
Status);
173 goto done;
174 }
175
177 MemberIdString);
179 {
180 TRACE(
"SampRegDeleteValue failed with status 0x%08lx\n",
Status);
181 goto done;
182 }
183
186 &ulValueCount);
188 {
189 TRACE(
"SampRegQueryKeyInfo failed with status 0x%08lx\n",
Status);
190 goto done;
191 }
192
193 if (ulValueCount == 0)
194 {
196
200 {
201 TRACE(
"SampRegDeleteKey failed with status 0x%08lx\n",
Status);
202 goto done;
203 }
204 }
205
206done:
209
210 if (MemberIdString !=
NULL)
212
214}
NTSTATUS SampRegDeleteKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName)
NTSTATUS SampRegDeleteValue(IN HANDLE KeyHandle, IN LPCWSTR ValueName)
Referenced by SampRemoveAllMembersFromAlias(), and SamrRemoveMemberFromAlias().