Go to the source code of this file.
|
NTSTATUS | SampOpenUserObject (IN PSAM_DB_OBJECT DomainObject, IN ULONG UserId, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *UserObject) |
|
NTSTATUS | SampAddGroupMembershipToUser (IN PSAM_DB_OBJECT UserObject, IN ULONG GroupId, IN ULONG Attributes) |
|
NTSTATUS | SampRemoveGroupMembershipFromUser (IN PSAM_DB_OBJECT UserObject, IN ULONG GroupId) |
|
NTSTATUS | SampGetUserGroupAttributes (IN PSAM_DB_OBJECT DomainObject, IN ULONG UserId, IN ULONG GroupId, OUT PULONG GroupAttributes) |
|
NTSTATUS | SampSetUserGroupAttributes (IN PSAM_DB_OBJECT DomainObject, IN ULONG UserId, IN ULONG GroupId, IN ULONG GroupAttributes) |
|
NTSTATUS | SampRemoveUserFromAllGroups (IN PSAM_DB_OBJECT UserObject) |
|
NTSTATUS | SampRemoveUserFromAllAliases (IN PSAM_DB_OBJECT UserObject) |
|
NTSTATUS | SampSetUserPassword (IN PSAM_DB_OBJECT UserObject, IN PENCRYPTED_NT_OWF_PASSWORD NtPassword, IN BOOLEAN NtPasswordPresent, IN PENCRYPTED_LM_OWF_PASSWORD LmPassword, IN BOOLEAN LmPasswordPresent) |
|
NTSTATUS | SampGetLogonHoursAttribute (IN PSAM_DB_OBJECT UserObject, IN OUT PSAMPR_LOGON_HOURS LogonHours) |
|
NTSTATUS | SampSetLogonHoursAttribute (IN PSAM_DB_OBJECT UserObject, IN PSAMPR_LOGON_HOURS LogonHours) |
|
◆ SampAddGroupMembershipToUser()
Definition at line 39 of file user.c.
42{
44 ULONG GroupsCount = 0;
48
49 TRACE(
"(%p %lu %lx)\n",
51
58 goto done;
59
61 if (GroupsBuffer ==
NULL)
62 {
64 goto done;
65 }
66
68 {
72 GroupsBuffer,
75 goto done;
76
78 }
79
80 for (
i = 0;
i < GroupsCount;
i++)
81 {
82 if (GroupsBuffer[
i].RelativeId == GroupId)
83 {
85 goto done;
86 }
87 }
88
89 GroupsBuffer[GroupsCount].
RelativeId = GroupId;
92
96 GroupsBuffer,
98
99done:
100 if (GroupsBuffer !=
NULL)
102
104}
#define NT_SUCCESS(StatCode)
NTSTATUS SampGetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, PULONG AttributeType, LPVOID AttributeData, PULONG AttributeSize)
NTSTATUS SampSetObjectAttribute(PSAM_DB_OBJECT DbObject, LPWSTR AttributeName, ULONG AttributeType, LPVOID AttributeData, ULONG AttributeSize)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_In_ ULONG _In_ ULONG _In_ ULONG Length
struct _GROUP_MEMBERSHIP GROUP_MEMBERSHIP
#define STATUS_MEMBER_IN_GROUP
#define midl_user_allocate
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
Referenced by SamrAddMemberToGroup().
◆ SampGetLogonHoursAttribute()
Definition at line 619 of file user.c.
621{
626
633 {
634 TRACE(
"SampGetObjectAttribute failed (Status 0x%08lx)\n",
Status);
636 }
637
639
641 {
642 LogonHours->UnitsPerWeek = 0;
643 LogonHours->LogonHours =
NULL;
644 }
645 else
646 {
648 if (RawBuffer ==
NULL)
649 {
651 goto done;
652 }
653
660 goto done;
661
662 LogonHours->UnitsPerWeek = *((
PUSHORT)RawBuffer);
663
665
667 if (LogonHours->LogonHours ==
NULL)
668 {
669 TRACE(
"Failed to allocate LogonHours buffer!\n");
671 goto done;
672 }
673
674 memcpy(LogonHours->LogonHours,
675 &(RawBuffer[2]),
677 }
678
679done:
680
681 if (RawBuffer !=
NULL)
683
685}
#define memcpy(s1, s2, n)
#define STATUS_BUFFER_OVERFLOW
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Referenced by SampQueryUserAccount(), SampQueryUserAll(), SampQueryUserLogon(), and SampQueryUserLogonHours().
◆ SampGetUserGroupAttributes()
Definition at line 183 of file user.c.
187{
193
195 UserId,
196 0,
197 &UserObject);
199 {
201 }
202
208
211
213 if (GroupsBuffer ==
NULL)
214 {
216 goto done;
217 }
218
222 GroupsBuffer,
225 goto done;
226
228 {
229 if (GroupsBuffer[
i].RelativeId == GroupId)
230 {
232 goto done;
233 }
234 }
235
236done:
237 if (GroupsBuffer !=
NULL)
239
240 if (UserObject !=
NULL)
242
244}
NTSTATUS SampCloseDbObject(PSAM_DB_OBJECT DbObject)
NTSTATUS SampOpenUserObject(IN PSAM_DB_OBJECT DomainObject, IN ULONG UserId, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *UserObject)
#define STATUS_UNSUCCESSFUL
Referenced by SamrGetMembersInGroup().
◆ SampOpenUserObject()
Definition at line 14 of file user.c.
18{
20
21 TRACE(
"(%p %lu %lx %p)\n",
23
24
26
27
30 szRid,
31 UserId,
34 UserObject);
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
Referenced by SampGetUserGroupAttributes(), SampSetUserGroupAttributes(), SamrAddMemberToGroup(), and SamrRemoveMemberFromGroup().
◆ SampRemoveGroupMembershipFromUser()
Definition at line 108 of file user.c.
110{
112 ULONG GroupsCount = 0;
116
118 UserObject, GroupId);
119
125
128
130 if (GroupsBuffer ==
NULL)
131 {
133 goto done;
134 }
135
139 GroupsBuffer,
142 goto done;
143
145
147 for (
i = 0;
i < GroupsCount;
i++)
148 {
149 if (GroupsBuffer[
i].RelativeId == GroupId)
150 {
153
154 if (GroupsCount -
i - 1 > 0)
155 {
157 &GroupsBuffer[
i + 1],
159 }
160
161 break;
162 }
163 }
164
166 goto done;
167
171 GroupsBuffer,
173
174done:
175 if (GroupsBuffer !=
NULL)
177
179}
#define STATUS_MEMBER_NOT_IN_GROUP
Referenced by SamrRemoveMemberFromGroup().
◆ SampRemoveUserFromAllAliases()
◆ SampRemoveUserFromAllGroups()
Definition at line 319 of file user.c.
320{
326
332
335
337 if (GroupsBuffer ==
NULL)
338 {
340 goto done;
341 }
342
346 GroupsBuffer,
349 goto done;
350
352 {
354 GroupsBuffer[
i].RelativeId,
355 0,
356 &GroupObject);
358 {
359 goto done;
360 }
361
363 UserObject->RelativeId);
366
368
370 {
371 goto done;
372 }
373 }
374
375
380 0);
381
382done:
383 if (GroupsBuffer !=
NULL)
385
387}
NTSTATUS SampRemoveMemberFromGroup(IN PSAM_DB_OBJECT GroupObject, IN ULONG MemberId)
NTSTATUS SampOpenGroupObject(IN PSAM_DB_OBJECT DomainObject, IN ULONG GroupId, IN ACCESS_MASK DesiredAccess, OUT PSAM_DB_OBJECT *GroupObject)
Referenced by SamrDeleteUser().
◆ SampSetLogonHoursAttribute()
Definition at line 689 of file user.c.
691{
696
697 if (LogonHours->UnitsPerWeek > 0)
698 {
700
702
704 if (RawBuffer ==
NULL)
705 {
707 goto done;
708 }
709
710 *((
PUSHORT)RawBuffer) = LogonHours->UnitsPerWeek;
711
713 LogonHours->LogonHours,
715 }
716
720 RawBuffer,
722
723done:
724 if (RawBuffer !=
NULL)
726
728}
Referenced by SampSetUserAll(), and SamrSetInformationUser2().
◆ SampSetUserGroupAttributes()
Definition at line 248 of file user.c.
252{
258
260 UserId,
261 0,
262 &UserObject);
264 {
266 }
267
273
276
278 if (GroupsBuffer ==
NULL)
279 {
281 goto done;
282 }
283
287 GroupsBuffer,
290 goto done;
291
293 {
294 if (GroupsBuffer[
i].RelativeId == GroupId)
295 {
297 break;
298 }
299 }
300
304 GroupsBuffer,
306
307done:
308 if (GroupsBuffer !=
NULL)
310
311 if (UserObject !=
NULL)
313
315}
Referenced by SamrSetMemberAttributesOfGroup().
◆ SampSetUserPassword()
Definition at line 399 of file user.c.
404{
407 ULONG NtHistoryLength = 0;
408 ULONG LmHistoryLength = 0;
409 ULONG CurrentHistoryLength;
410 ULONG MaxHistoryLength = 3;
415
416 UseNtPassword =
417 ((NtPasswordPresent !=
FALSE) &&
418 (NtPassword !=
NULL) &&
420
421 UseLmPassword =
422 ((LmPasswordPresent !=
FALSE) &&
423 (LmPassword !=
NULL) &&
425
426
427 if (UseNtPassword)
428 {
429
435
437 if (CurrentHistoryLength < MaxHistoryLength)
438 {
440 }
441 else
442 {
444 }
445
446
448 if (NtHistory ==
NULL)
450
452 {
453
457 NtHistory,
460 goto done;
461 }
462
463
465 {
467 &(NtHistory[0]),
469 }
470
471
472 if (NtPasswordPresent)
473 {
475 NtPassword,
477 }
478 else
479 {
482 }
483
484
489 NtHistoryLength);
491 goto done;
492 }
493
494
495 if (UseLmPassword)
496 {
497
504
506 if (CurrentHistoryLength < MaxHistoryLength)
507 {
509 }
510 else
511 {
513 }
514
515
517 if (LmHistory ==
NULL)
519
521 {
522
526 LmHistory,
529 goto done;
530 }
531
532
534 {
536 &(LmHistory[0]),
538 }
539
540
541 if (LmPasswordPresent)
542 {
544 LmPassword,
546 }
547 else
548 {
551 }
552
553
558 LmHistoryLength);
560 goto done;
561 }
562
563
564 if (UseNtPassword)
565 {
572 goto done;
573 }
574 else
575 {
582 goto done;
583 }
584
585
586 if (UseLmPassword)
587 {
594 goto done;
595 }
596 else
597 {
604 goto done;
605 }
606
607done:
608 if (NtHistory !=
NULL)
610
611 if (LmHistory !=
NULL)
613
615}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
ENCRYPTED_LM_OWF_PASSWORD EmptyLmHash
ENCRYPTED_NT_OWF_PASSWORD EmptyNtHash
Referenced by SampSetUserAll(), SampSetUserInternal1(), and SamrChangePasswordUser().