ReactOS  0.4.13-dev-455-g28ed234
samlib.c
Go to the documentation of this file.
1 /*
2  * ReactOS kernel
3  * Copyright (C) 2004 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * COPYRIGHT: See COPYING in the top level directory
21  * PROJECT: ReactOS system libraries
22  * PURPOSE: SAM interface library
23  * FILE: lib/samlib/samlib.c
24  * PROGRAMER: Eric Kohl
25  */
26 
27 #include "precomp.h"
28 
29 #define NTOS_MODE_USER
30 #include <ndk/rtlfuncs.h>
31 #include <ntsam.h>
32 #include <sam_c.h>
33 
34 #include <wine/debug.h>
35 
37 
39 WINAPI
41  LPSTR hash);
42 
44 WINAPI
46  LPBYTE hash);
47 
49 WINAPI
51  const BYTE *key,
52  LPBYTE out);
53 
54 /* GLOBALS *******************************************************************/
55 
56 
57 /* FUNCTIONS *****************************************************************/
58 
60 {
62 }
63 
64 
66 {
68 }
69 
70 
73 {
75  LPWSTR pszStringBinding;
77 
78  TRACE("PSAMPR_SERVER_NAME_bind() called\n");
79 
81  L"ncacn_np",
82  pszSystemName,
83  L"\\pipe\\samr",
84  NULL,
85  &pszStringBinding);
86  if (status)
87  {
88  TRACE("RpcStringBindingCompose returned 0x%x\n", status);
89  return NULL;
90  }
91 
92  /* Set the binding handle that will be used to bind to the server. */
93  status = RpcBindingFromStringBindingW(pszStringBinding,
94  &hBinding);
95  if (status)
96  {
97  TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
98  }
99 
100  status = RpcStringFreeW(&pszStringBinding);
101  if (status)
102  {
103 // TRACE("RpcStringFree returned 0x%x\n", status);
104  }
105 
106  return hBinding;
107 }
108 
109 
110 void __RPC_USER
113 {
115 
116  TRACE("PSAMPR_SERVER_NAME_unbind() called\n");
117 
119  if (status)
120  {
121  TRACE("RpcBindingFree returned 0x%x\n", status);
122  }
123 }
124 
125 
126 NTSTATUS
129 {
131  LPWORD CharTypeBuffer = NULL;
132  ULONG PasswordLength;
133  ULONG i;
134  ULONG Upper = 0, Lower = 0, Digit = 0, Punct = 0, Alpha = 0;
136 
137  TRACE("(%p %p)\n", UserHandle, Password);
138 
139  /* Get the domain password information */
142  if (!NT_SUCCESS(Status))
143  {
144  TRACE("SamrGetUserDomainPasswordInformation failed (Status 0x%08lx)\n", Status);
145  return Status;
146  }
147 
148  PasswordLength = (ULONG)(Password->Length / sizeof(WCHAR));
149 
150  /* Fail if the password is too short or too long */
151  if ((PasswordLength < DomainPasswordInformation.MinPasswordLength) ||
152  (PasswordLength > 256))
154 
155  /* Check the password complexity */
156  if (DomainPasswordInformation.PasswordProperties & DOMAIN_PASSWORD_COMPLEX)
157  {
158  CharTypeBuffer = midl_user_allocate(PasswordLength * sizeof(WORD));
159  if (CharTypeBuffer == NULL)
161 
163  Password->Buffer,
164  PasswordLength,
165  CharTypeBuffer);
166 
167  for (i = 0; i < PasswordLength; i++)
168  {
169  TRACE("%lu: %C %s %s %s %s\n", i, Password->Buffer[i],
170  (CharTypeBuffer[i] & C1_UPPER) ? "C1_UPPER" : " ",
171  (CharTypeBuffer[i] & C1_LOWER) ? "C1_LOWER" : " ",
172  (CharTypeBuffer[i] & C1_DIGIT) ? "C1_DIGIT" : " ",
173  (CharTypeBuffer[i] & C1_PUNCT) ? "C1_PUNCT" : " ",
174  (CharTypeBuffer[i] & C1_ALPHA) ? "C1_ALPHA" : " ");
175 
176  if (CharTypeBuffer[i] & C1_UPPER)
177  Upper = 1;
178 
179  if (CharTypeBuffer[i] & C1_LOWER)
180  Lower = 1;
181 
182  if (CharTypeBuffer[i] & C1_DIGIT)
183  Digit = 1;
184 
185  if (CharTypeBuffer[i] & C1_PUNCT)
186  Punct = 1;
187 
188  if ((CharTypeBuffer[i] & C1_ALPHA) &&
189  !(CharTypeBuffer[i] & C1_UPPER) &&
190  !(CharTypeBuffer[i] & C1_LOWER))
191  Alpha = 1;
192  }
193 
194  TRACE("Upper: %lu\n", Upper);
195  TRACE("Lower: %lu\n", Lower);
196  TRACE("Digit: %lu\n", Digit);
197  TRACE("Punct: %lu\n", Punct);
198  TRACE("Alpha: %lu\n", Alpha);
199 
200  TRACE("Total: %lu\n", Upper + Lower + Digit + Punct + Alpha);
201  if (Upper + Lower + Digit + Punct + Alpha < 3)
203  }
204 
205  if (CharTypeBuffer != NULL)
206  midl_user_free(CharTypeBuffer);
207 
208  return Status;
209 }
210 
211 
212 NTSTATUS
213 NTAPI
215  IN PSID MemberId)
216 {
218 
219  TRACE("SamAddMemberToAlias(%p %p)\n",
220  AliasHandle, MemberId);
221 
223  {
225  (PRPC_SID)MemberId);
226  }
228  {
230  }
231  RpcEndExcept;
232 
233  return Status;
234 }
235 
236 
237 NTSTATUS
238 NTAPI
240  IN ULONG MemberId,
242 {
244 
245  TRACE("SamAddMemberToGroup(%p %lu %lx)\n",
246  GroupHandle, MemberId, Attributes);
247 
249  {
251  MemberId,
252  Attributes);
253  }
255  {
257  }
258  RpcEndExcept;
259 
260  return Status;
261 }
262 
263 
264 NTSTATUS
265 NTAPI
267  IN PSID *MemberIds,
268  IN ULONG MemberCount)
269 {
272 
273  TRACE("SamAddMultipleMembersToAlias(%p %p %lu)\n",
274  AliasHandle, MemberIds, MemberCount);
275 
276  if (MemberIds == NULL)
278 
279  Buffer.Count = MemberCount;
280  Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
281 
283  {
285  &Buffer);
286  }
288  {
290  }
291  RpcEndExcept;
292 
293  return Status;
294 }
295 
296 
297 NTSTATUS
298 NTAPI
300  IN PUNICODE_STRING OldPassword,
301  IN PUNICODE_STRING NewPassword)
302 {
303  NT_OWF_PASSWORD OldNtPassword;
304  NT_OWF_PASSWORD NewNtPassword;
305  LM_OWF_PASSWORD OldLmPassword;
306  LM_OWF_PASSWORD NewLmPassword;
307  OEM_STRING LmPwdString;
308  CHAR LmPwdBuffer[15];
309  BOOLEAN OldLmPasswordPresent = FALSE;
310  BOOLEAN NewLmPasswordPresent = FALSE;
312 
313  ENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm;
314  ENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm;
315  ENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt;
316  ENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt;
317  PENCRYPTED_LM_OWF_PASSWORD pOldLmEncryptedWithNewLm = NULL;
318  PENCRYPTED_LM_OWF_PASSWORD pNewLmEncryptedWithOldLm = NULL;
319 
320  /* Calculate the NT hash for the old password */
321  Status = SystemFunction007(OldPassword,
322  (LPBYTE)&OldNtPassword);
323  if (!NT_SUCCESS(Status))
324  {
325  TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
326  return Status;
327  }
328 
329  /* Calculate the NT hash for the new password */
330  Status = SystemFunction007(NewPassword,
331  (LPBYTE)&NewNtPassword);
332  if (!NT_SUCCESS(Status))
333  {
334  TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
335  return Status;
336  }
337 
338  /* Calculate the LM password and hash for the old password */
339  LmPwdString.Length = 15;
340  LmPwdString.MaximumLength = 15;
341  LmPwdString.Buffer = LmPwdBuffer;
342  ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
343 
345  OldPassword,
346  FALSE);
347  if (NT_SUCCESS(Status))
348  {
349  /* Calculate the LM hash value of the password */
350  Status = SystemFunction006(LmPwdString.Buffer,
351  (LPSTR)&OldLmPassword);
352  if (NT_SUCCESS(Status))
353  {
354  OldLmPasswordPresent = TRUE;
355  }
356  }
357 
358  /* Calculate the LM password and hash for the new password */
359  LmPwdString.Length = 15;
360  LmPwdString.MaximumLength = 15;
361  LmPwdString.Buffer = LmPwdBuffer;
362  ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
363 
365  NewPassword,
366  FALSE);
367  if (NT_SUCCESS(Status))
368  {
369  /* Calculate the LM hash value of the password */
370  Status = SystemFunction006(LmPwdString.Buffer,
371  (LPSTR)&NewLmPassword);
372  if (NT_SUCCESS(Status))
373  {
374  NewLmPasswordPresent = TRUE;
375  }
376  }
377 
378  if (OldLmPasswordPresent && NewLmPasswordPresent)
379  {
380  /* Encrypt the old LM hash with the new LM hash */
381  Status = SystemFunction012((const BYTE *)&OldLmPassword,
382  (const BYTE *)&NewLmPassword,
383  (LPBYTE)&OldLmEncryptedWithNewLm);
384  if (!NT_SUCCESS(Status))
385  {
386  TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
387  return Status;
388  }
389 
390  /* Encrypt the new LM hash with the old LM hash */
391  Status = SystemFunction012((const BYTE *)&NewLmPassword,
392  (const BYTE *)&OldLmPassword,
393  (LPBYTE)&NewLmEncryptedWithOldLm);
394  if (!NT_SUCCESS(Status))
395  {
396  TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
397  return Status;
398  }
399 
400  pOldLmEncryptedWithNewLm = &OldLmEncryptedWithNewLm;
401  pNewLmEncryptedWithOldLm = &NewLmEncryptedWithOldLm;
402  }
403 
404  /* Encrypt the old NT hash with the new NT hash */
405  Status = SystemFunction012((const BYTE *)&OldNtPassword,
406  (const BYTE *)&NewNtPassword,
407  (LPBYTE)&OldNtEncryptedWithNewNt);
408  if (!NT_SUCCESS(Status))
409  {
410  TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
411  return Status;
412  }
413 
414  /* Encrypt the new NT hash with the old NT hash */
415  Status = SystemFunction012((const BYTE *)&NewNtPassword,
416  (const BYTE *)&OldNtPassword,
417  (LPBYTE)&NewNtEncryptedWithOldNt);
418  if (!NT_SUCCESS(Status))
419  {
420  TRACE("SystemFunction012 failed (Status 0x%08lx)\n", Status);
421  return Status;
422  }
423 
425  {
427  OldLmPasswordPresent && NewLmPasswordPresent,
428  pOldLmEncryptedWithNewLm,
429  pNewLmEncryptedWithOldLm,
430  TRUE,
431  &OldNtEncryptedWithNewNt,
432  &NewNtEncryptedWithOldNt,
433  FALSE,
434  NULL,
435  FALSE,
436  NULL);
437  }
439  {
441  }
442  RpcEndExcept;
443 
444  return Status;
445 }
446 
447 
448 NTSTATUS
449 NTAPI
451  IN PUNICODE_STRING UserName,
452  IN PUNICODE_STRING OldPassword,
453  IN PUNICODE_STRING NewPassword)
454 {
456  return STATUS_NOT_IMPLEMENTED;
457 }
458 
459 
460 NTSTATUS
461 NTAPI
463  IN PUNICODE_STRING UserName,
464  IN PUNICODE_STRING OldPassword,
465  IN PUNICODE_STRING NewPassword,
466  OUT PDOMAIN_PASSWORD_INFORMATION *EffectivePasswordPolicy,
467  OUT PUSER_PWD_CHANGE_FAILURE_INFORMATION *PasswordChangeFailureInfo)
468 {
470  return STATUS_NOT_IMPLEMENTED;
471 }
472 
473 
474 NTSTATUS
475 NTAPI
477 {
479 
480  TRACE("SamCloseHandle(%p)\n", SamHandle);
481 
483  {
484  Status = SamrCloseHandle((SAMPR_HANDLE *)&SamHandle);
485  }
487  {
489  }
490  RpcEndExcept;
491 
492  return Status;
493 }
494 
495 
496 NTSTATUS
497 NTAPI
499  OUT PSAM_HANDLE ServerHandle,
502 {
504 
505  TRACE("SamConnect(%p %p 0x%08x %p)\n",
506  ServerName, ServerHandle, DesiredAccess, ObjectAttributes);
507 
509  {
510  Status = SamrConnect((PSAMPR_SERVER_NAME)ServerName,
511  (SAMPR_HANDLE *)ServerHandle,
512  DesiredAccess);
513  }
515  {
517  }
518  RpcEndExcept;
519 
520  return Status;
521 }
522 
523 
524 NTSTATUS
525 NTAPI
527  IN PUNICODE_STRING AccountName,
529  OUT PSAM_HANDLE AliasHandle,
530  OUT PULONG RelativeId)
531 {
533 
534  TRACE("SamCreateAliasInDomain(%p %p 0x%08x %p %p)\n",
535  DomainHandle, AccountName, DesiredAccess, AliasHandle, RelativeId);
536 
537  *AliasHandle = NULL;
538  *RelativeId = 0;
539 
541  {
543  (PRPC_UNICODE_STRING)AccountName,
545  (SAMPR_HANDLE *)AliasHandle,
546  RelativeId);
547  }
549  {
551  }
552  RpcEndExcept;
553 
554  return Status;
555 }
556 
557 
558 NTSTATUS
559 NTAPI
561  IN PUNICODE_STRING AccountName,
563  OUT PSAM_HANDLE GroupHandle,
564  OUT PULONG RelativeId)
565 {
567 
568  TRACE("SamCreateGroupInDomain(%p %p 0x%08x %p %p)\n",
569  DomainHandle, AccountName, DesiredAccess, GroupHandle, RelativeId);
570 
571  *GroupHandle = NULL;
572  *RelativeId = 0;
573 
575  {
577  (PRPC_UNICODE_STRING)AccountName,
579  (SAMPR_HANDLE *)GroupHandle,
580  RelativeId);
581  }
583  {
585  }
586  RpcEndExcept;
587 
588  return Status;
589 }
590 
591 
592 NTSTATUS
593 NTAPI
595  IN PUNICODE_STRING AccountName,
596  IN ULONG AccountType,
598  OUT PSAM_HANDLE UserHandle,
600  OUT PULONG RelativeId)
601 {
603 
604  TRACE("SamCreateUser2InDomain(%p %p %lu 0x%08x %p %p %p)\n",
605  DomainHandle, AccountName, AccountType, DesiredAccess,
606  UserHandle, GrantedAccess, RelativeId);
607 
608  *UserHandle = NULL;
609  *RelativeId = 0;
610 
612  {
614  (PRPC_UNICODE_STRING)AccountName,
615  AccountType,
617  (SAMPR_HANDLE *)UserHandle,
619  RelativeId);
620 
621  }
623  {
625  }
626  RpcEndExcept;
627 
628  return Status;
629 }
630 
631 
632 NTSTATUS
633 NTAPI
635  IN PUNICODE_STRING AccountName,
637  OUT PSAM_HANDLE UserHandle,
638  OUT PULONG RelativeId)
639 {
641 
642  TRACE("SamCreateUserInDomain(%p %p 0x%08x %p %p)\n",
643  DomainHandle, AccountName, DesiredAccess, UserHandle, RelativeId);
644 
645  *UserHandle = NULL;
646  *RelativeId = 0;
647 
649  {
651  (PRPC_UNICODE_STRING)AccountName,
653  (SAMPR_HANDLE *)UserHandle,
654  RelativeId);
655  }
657  {
659  }
660  RpcEndExcept;
661 
662  return Status;
663 }
664 
665 
666 NTSTATUS
667 NTAPI
669 {
670  SAMPR_HANDLE LocalAliasHandle;
672 
673  TRACE("SamDeleteAlias(%p)\n", AliasHandle);
674 
675  LocalAliasHandle = (SAMPR_HANDLE)AliasHandle;
676 
677  if (LocalAliasHandle == NULL)
678  return STATUS_INVALID_HANDLE;
679 
681  {
682  Status = SamrDeleteAlias(&LocalAliasHandle);
683  }
685  {
687  }
688  RpcEndExcept;
689 
690  return Status;
691 }
692 
693 
694 NTSTATUS
695 NTAPI
697 {
698  SAMPR_HANDLE LocalGroupHandle;
700 
701  TRACE("SamDeleteGroup(%p)\n", GroupHandle);
702 
703  LocalGroupHandle = (SAMPR_HANDLE)GroupHandle;
704 
705  if (LocalGroupHandle == NULL)
706  return STATUS_INVALID_HANDLE;
707 
709  {
710  Status = SamrDeleteGroup(&LocalGroupHandle);
711  }
713  {
715  }
716  RpcEndExcept;
717 
718  return Status;
719 }
720 
721 
722 NTSTATUS
723 NTAPI
725 {
726  SAMPR_HANDLE LocalUserHandle;
728 
729  TRACE("SamDeleteUser(%p)\n", UserHandle);
730 
731  LocalUserHandle = (SAMPR_HANDLE)UserHandle;
732 
733  if (LocalUserHandle == NULL)
734  return STATUS_INVALID_HANDLE;
735 
737  {
738  Status = SamrDeleteUser(&LocalUserHandle);
739  }
741  {
743  }
744  RpcEndExcept;
745 
746  return Status;
747 }
748 
749 
750 NTSTATUS
751 NTAPI
753  IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
754  OUT PVOID *Buffer,
755  IN ULONG PreferedMaximumLength,
756  OUT PULONG CountReturned)
757 {
758  PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
760 
761  TRACE("SamEnumerateAliasesInDomain(%p %p %p %lu %p)\n",
762  DomainHandle, EnumerationContext, Buffer, PreferedMaximumLength,
763  CountReturned);
764 
765  if ((EnumerationContext == NULL) ||
766  (Buffer == NULL) ||
767  (CountReturned == NULL))
769 
770  *Buffer = NULL;
771 
773  {
775  EnumerationContext,
776  &EnumBuffer,
777  PreferedMaximumLength,
778  CountReturned);
779 
780  if (EnumBuffer != NULL)
781  {
782  if (EnumBuffer->Buffer != NULL)
783  {
784  *Buffer = EnumBuffer->Buffer;
785  }
786 
787  midl_user_free(EnumBuffer);
788  }
789  }
791  {
793  }
794  RpcEndExcept;
795 
796  return Status;
797 }
798 
799 
800 NTSTATUS
801 NTAPI
803  IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
804  OUT PVOID *Buffer,
805  IN ULONG PreferedMaximumLength,
806  OUT PULONG CountReturned)
807 {
808  PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
810 
811  TRACE("SamEnumerateDomainsInSamServer(%p %p %p %lu %p)\n",
812  ServerHandle, EnumerationContext, Buffer, PreferedMaximumLength,
813  CountReturned);
814 
815  if ((EnumerationContext == NULL) ||
816  (Buffer == NULL) ||
817  (CountReturned == NULL))
819 
820  *Buffer = NULL;
821 
823  {
825  EnumerationContext,
826  &EnumBuffer,
827  PreferedMaximumLength,
828  CountReturned);
829 
830  if (EnumBuffer != NULL)
831  {
832  if (EnumBuffer->Buffer != NULL)
833  {
834  *Buffer = EnumBuffer->Buffer;
835  }
836 
837  midl_user_free(EnumBuffer);
838  }
839  }
841  {
843  }
844  RpcEndExcept;
845 
846  return Status;
847 }
848 
849 
850 NTSTATUS
851 NTAPI
853  IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
854  IN PVOID *Buffer,
855  IN ULONG PreferedMaximumLength,
856  OUT PULONG CountReturned)
857 {
858  PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
860 
861  TRACE("SamEnumerateGroupsInDomain(%p %p %p %lu %p)\n",
862  DomainHandle, EnumerationContext, Buffer,
863  PreferedMaximumLength, CountReturned);
864 
865  if (EnumerationContext == NULL || Buffer == NULL || CountReturned == NULL)
867 
868  *Buffer = NULL;
869 
871  {
873  EnumerationContext,
874  &EnumBuffer,
875  PreferedMaximumLength,
876  CountReturned);
877  if (EnumBuffer != NULL)
878  {
879  if (EnumBuffer->Buffer != NULL)
880  *Buffer = EnumBuffer->Buffer;
881 
882  midl_user_free(EnumBuffer);
883  }
884  }
886  {
888  }
889  RpcEndExcept;
890 
891  return Status;
892 }
893 
894 
895 NTSTATUS
896 NTAPI
898  IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext,
899  IN ULONG UserAccountControl,
900  OUT PVOID *Buffer,
901  IN ULONG PreferedMaximumLength,
902  OUT PULONG CountReturned)
903 {
904  PSAMPR_ENUMERATION_BUFFER EnumBuffer = NULL;
906 
907  TRACE("SamEnumerateUsersInDomain(%p %p %lx %p %lu %p)\n",
908  DomainHandle, EnumerationContext, UserAccountControl, Buffer,
909  PreferedMaximumLength, CountReturned);
910 
911  if (EnumerationContext == NULL || Buffer == NULL || CountReturned == NULL)
913 
914  *Buffer = NULL;
915 
917  {
919  EnumerationContext,
920  UserAccountControl,
921  &EnumBuffer,
922  PreferedMaximumLength,
923  CountReturned);
924  if (EnumBuffer != NULL)
925  {
926  if (EnumBuffer->Buffer != NULL)
927  {
928  *Buffer = EnumBuffer->Buffer;
929  }
930 
931  midl_user_free(EnumBuffer);
932  }
933 
934  }
936  {
938  }
939  RpcEndExcept;
940 
941  return Status;
942 }
943 
944 
945 NTSTATUS
946 NTAPI
948 {
949  if (Buffer != NULL)
951 
952  return STATUS_SUCCESS;
953 }
954 
955 
956 NTSTATUS
957 NTAPI
959  IN ULONG PassedCount,
960  IN PSID *Sids,
961  OUT PULONG MembershipCount,
962  OUT PULONG *Aliases)
963 {
964  SAMPR_PSID_ARRAY SidArray;
965  SAMPR_ULONG_ARRAY Membership;
967 
968  TRACE("SamAliasMembership(%p %lu %p %p %p)\n",
969  DomainHandle, PassedCount, Sids, MembershipCount, Aliases);
970 
971  if (Sids == NULL ||
972  MembershipCount == NULL ||
973  Aliases == NULL)
975 
976  Membership.Element = NULL;
977 
979  {
980  SidArray.Count = PassedCount;
981  SidArray.Sids = (PSAMPR_SID_INFORMATION)Sids;
982 
984  &SidArray,
985  &Membership);
986  if (NT_SUCCESS(Status))
987  {
988  *MembershipCount = Membership.Count;
989  *Aliases = Membership.Element;
990  }
991  else
992  {
993  if (Membership.Element != NULL)
994  midl_user_free(Membership.Element);
995  }
996  }
998  {
1000  }
1001  RpcEndExcept;
1002 
1003  return Status;
1004 }
1005 
1006 
1007 NTSTATUS
1008 NTAPI
1010  OUT PULONG Mode)
1011 {
1012  TRACE("(%p %p)\n", ObjectHandle, Mode);
1013 
1014  if (Mode == NULL)
1015  return STATUS_INVALID_PARAMETER;
1016 
1018 
1019  return STATUS_SUCCESS;
1020 }
1021 
1022 
1023 NTSTATUS
1024 NTAPI
1026  IN DOMAIN_DISPLAY_INFORMATION DisplayInformation,
1028  OUT PULONG Index)
1029 {
1030  NTSTATUS Status;
1031 
1032  TRACE("(%p %lu %wZ %p)\n",
1033  DomainHandle, DisplayInformation, Prefix, Index);
1034 
1035  if ((Prefix == NULL) ||
1036  (Index == NULL))
1037  return STATUS_INVALID_PARAMETER;
1038 
1039  RpcTryExcept
1040  {
1042  DisplayInformation,
1044  Index);
1045  }
1047  {
1049  }
1050  RpcEndExcept;
1051 
1052  return Status;
1053 }
1054 
1055 
1056 NTSTATUS
1057 NTAPI
1060  OUT PULONG MembershipCount)
1061 {
1062  PSAMPR_GET_GROUPS_BUFFER GroupsBuffer = NULL;
1063  NTSTATUS Status;
1064 
1065  TRACE("SamGetGroupsForUser(%p %p %p)\n",
1066  UserHandle, Groups, MembershipCount);
1067 
1068  RpcTryExcept
1069  {
1071  &GroupsBuffer);
1072  if (NT_SUCCESS(Status))
1073  {
1074  *Groups = GroupsBuffer->Groups;
1075  *MembershipCount = GroupsBuffer->MembershipCount;
1076 
1077  MIDL_user_free(GroupsBuffer);
1078  }
1079  else
1080  {
1081  if (GroupsBuffer != NULL)
1082  {
1083  if (GroupsBuffer->Groups != NULL)
1084  MIDL_user_free(GroupsBuffer->Groups);
1085 
1086  MIDL_user_free(GroupsBuffer);
1087  }
1088  }
1089  }
1091  {
1093  }
1094  RpcEndExcept;
1095 
1096  return Status;
1097 }
1098 
1099 
1100 NTSTATUS
1101 NTAPI
1103  OUT PSID **MemberIds,
1104  OUT PULONG MemberCount)
1105 {
1106  SAMPR_PSID_ARRAY_OUT SidArray;
1107  NTSTATUS Status;
1108 
1109  TRACE("SamGetMembersInAlias(%p %p %p)\n",
1110  AliasHandle, MemberIds, MemberCount);
1111 
1112  if ((MemberIds == NULL) ||
1113  (MemberCount == NULL))
1114  return STATUS_INVALID_PARAMETER;
1115 
1116  *MemberIds = NULL;
1117  *MemberCount = 0;
1118 
1119  SidArray.Sids = NULL;
1120 
1121  RpcTryExcept
1122  {
1123  Status = SamrGetMembersInAlias((SAMPR_HANDLE)AliasHandle,
1124  &SidArray);
1125  if (NT_SUCCESS(Status))
1126  {
1127  *MemberCount = SidArray.Count;
1128  *MemberIds = (PSID *)SidArray.Sids;
1129  }
1130 
1131  }
1133  {
1135  }
1136  RpcEndExcept;
1137 
1138  return Status;
1139 }
1140 
1141 
1142 NTSTATUS
1143 NTAPI
1145  OUT PULONG *MemberIds,
1147  OUT PULONG MemberCount)
1148 {
1149  PSAMPR_GET_MEMBERS_BUFFER MembersBuffer = NULL;
1150  NTSTATUS Status;
1151 
1152  TRACE("SamGetMembersInGroup(%p %p %p %p)\n",
1153  GroupHandle, MemberIds, Attributes, MemberCount);
1154 
1155  RpcTryExcept
1156  {
1157  Status = SamrGetMembersInGroup((SAMPR_HANDLE)GroupHandle,
1158  &MembersBuffer);
1159  if (NT_SUCCESS(Status))
1160  {
1161  *MemberIds = MembersBuffer->Members;
1162  *Attributes = MembersBuffer->Attributes;
1163  *MemberCount = MembersBuffer->MemberCount;
1164 
1165  MIDL_user_free(MembersBuffer);
1166  }
1167  else
1168  {
1169  if (MembersBuffer != NULL)
1170  {
1171  if (MembersBuffer->Members != NULL)
1172  MIDL_user_free(MembersBuffer->Members);
1173 
1174  if (MembersBuffer->Attributes != NULL)
1175  MIDL_user_free(MembersBuffer->Attributes);
1176 
1177  MIDL_user_free(MembersBuffer);
1178  }
1179  }
1180  }
1182  {
1184  }
1185  RpcEndExcept;
1186 
1187  return Status;
1188 }
1189 
1190 
1191 NTSTATUS
1192 NTAPI
1195  OUT PSID *DomainId)
1196 {
1197  NTSTATUS Status;
1198 
1199  TRACE("SamLookupDomainInSamServer(%p %p %p)\n",
1200  ServerHandle, Name, DomainId);
1201 
1202  RpcTryExcept
1203  {
1206  (PRPC_SID *)DomainId);
1207  }
1209  {
1211  }
1212  RpcEndExcept;
1213 
1214  return Status;
1215 }
1216 
1217 
1218 NTSTATUS
1219 NTAPI
1221  IN ULONG Count,
1222  IN PULONG RelativeIds,
1224  OUT PSID_NAME_USE *Use OPTIONAL)
1225 {
1226  SAMPR_RETURNED_USTRING_ARRAY NamesBuffer = {0, NULL};
1227  SAMPR_ULONG_ARRAY UseBuffer = {0, NULL};
1228  ULONG i;
1229  NTSTATUS Status;
1230 
1231  TRACE("SamLookupIdsInDomain(%p %lu %p %p %p)\n",
1232  DomainHandle, Count, RelativeIds, Names, Use);
1233 
1234  *Names = NULL;
1235 
1236  if (Use != NULL)
1237  *Use = NULL;
1238 
1239  RpcTryExcept
1240  {
1241  Status = SamrLookupIdsInDomain((SAMPR_HANDLE)DomainHandle,
1242  Count,
1243  RelativeIds,
1244  &NamesBuffer,
1245  &UseBuffer);
1246  }
1248  {
1250  }
1251  RpcEndExcept;
1252 
1253  if (NT_SUCCESS(Status))
1254  {
1256  if (*Names == NULL)
1257  {
1259  goto done;
1260  }
1261 
1262  for (i = 0; i < Count; i++)
1263  {
1264  (*Names)[i].Buffer = midl_user_allocate(NamesBuffer.Element[i].MaximumLength);
1265  if ((*Names)[i].Buffer == NULL)
1266  {
1268  goto done;
1269  }
1270  }
1271 
1272  for (i = 0; i < Count; i++)
1273  {
1274  (*Names)[i].Length = NamesBuffer.Element[i].Length;
1275  (*Names)[i].MaximumLength = NamesBuffer.Element[i].MaximumLength;
1276 
1278  NamesBuffer.Element[i].Buffer,
1279  NamesBuffer.Element[i].Length);
1280  }
1281 
1282  if (Use != NULL)
1283  {
1284  *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
1285  if (*Use == NULL)
1286  {
1288  goto done;
1289  }
1290 
1291  RtlCopyMemory(*Use,
1292  UseBuffer.Element,
1293  Count * sizeof(SID_NAME_USE));
1294  }
1295  }
1296 
1297 done:
1298  if (!NT_SUCCESS(Status))
1299  {
1300  if (*Names != NULL)
1301  {
1302  for (i = 0; i < Count; i++)
1303  {
1304  if ((*Names)[i].Buffer != NULL)
1306  }
1307 
1309  }
1310 
1311  if (Use != NULL && *Use != NULL)
1312  midl_user_free(*Use);
1313  }
1314 
1315  if (NamesBuffer.Element != NULL)
1316  {
1317  for (i = 0; i < NamesBuffer.Count; i++)
1318  {
1319  if (NamesBuffer.Element[i].Buffer != NULL)
1320  midl_user_free(NamesBuffer.Element[i].Buffer);
1321  }
1322 
1323  midl_user_free(NamesBuffer.Element);
1324  }
1325 
1326  if (UseBuffer.Element != NULL)
1327  midl_user_free(UseBuffer.Element);
1328 
1329  return 0;
1330 }
1331 
1332 
1333 NTSTATUS
1334 NTAPI
1336  IN ULONG Count,
1338  OUT PULONG *RelativeIds,
1339  OUT PSID_NAME_USE *Use)
1340 {
1341  SAMPR_ULONG_ARRAY RidBuffer = {0, NULL};
1342  SAMPR_ULONG_ARRAY UseBuffer = {0, NULL};
1343  NTSTATUS Status;
1344 
1345  TRACE("SamLookupNamesInDomain(%p %lu %p %p %p)\n",
1346  DomainHandle, Count, Names, RelativeIds, Use);
1347 
1348  *RelativeIds = NULL;
1349  *Use = NULL;
1350 
1351  RpcTryExcept
1352  {
1354  Count,
1356  &RidBuffer,
1357  &UseBuffer);
1358  }
1360  {
1362  }
1363  RpcEndExcept;
1364 
1365  if (NT_SUCCESS(Status))
1366  {
1367  *RelativeIds = midl_user_allocate(Count * sizeof(ULONG));
1368  if (*RelativeIds == NULL)
1369  {
1371  goto done;
1372  }
1373 
1374  *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
1375  if (*Use == NULL)
1376  {
1378  goto done;
1379  }
1380 
1381  RtlCopyMemory(*RelativeIds,
1382  RidBuffer.Element,
1383  Count * sizeof(ULONG));
1384 
1385  RtlCopyMemory(*Use,
1386  UseBuffer.Element,
1387  Count * sizeof(SID_NAME_USE));
1388  }
1389 
1390 done:
1391  if (!NT_SUCCESS(Status))
1392  {
1393  if (*RelativeIds != NULL)
1394  midl_user_free(*RelativeIds);
1395 
1396  if (*Use != NULL)
1397  midl_user_free(*Use);
1398  }
1399 
1400  if (RidBuffer.Element != NULL)
1401  midl_user_free(RidBuffer.Element);
1402 
1403  if (UseBuffer.Element != NULL)
1404  midl_user_free(UseBuffer.Element);
1405 
1406  return Status;
1407 }
1408 
1409 
1410 NTSTATUS
1411 NTAPI
1414  IN ULONG AliasId,
1415  OUT PSAM_HANDLE AliasHandle)
1416 {
1417  NTSTATUS Status;
1418 
1419  TRACE("SamOpenAlias(%p 0x%08x %lx %p)\n",
1420  DomainHandle, DesiredAccess, AliasId, AliasHandle);
1421 
1422  RpcTryExcept
1423  {
1424  Status = SamrOpenAlias((SAMPR_HANDLE)DomainHandle,
1425  DesiredAccess,
1426  AliasId,
1427  (SAMPR_HANDLE *)AliasHandle);
1428  }
1430  {
1432  }
1433  RpcEndExcept;
1434 
1435  return Status;
1436 }
1437 
1438 
1439 NTSTATUS
1440 NTAPI
1443  IN PSID DomainId,
1444  OUT PSAM_HANDLE DomainHandle)
1445 {
1446  NTSTATUS Status;
1447 
1448  TRACE("SamOpenDomain(%p 0x%08x %p %p)\n",
1449  ServerHandle, DesiredAccess, DomainId, DomainHandle);
1450 
1451  RpcTryExcept
1452  {
1453  Status = SamrOpenDomain((SAMPR_HANDLE)ServerHandle,
1454  DesiredAccess,
1455  (PRPC_SID)DomainId,
1456  (SAMPR_HANDLE *)DomainHandle);
1457  }
1459  {
1461  }
1462  RpcEndExcept;
1463 
1464  return Status;
1465 }
1466 
1467 
1468 NTSTATUS
1469 NTAPI
1472  IN ULONG GroupId,
1473  OUT PSAM_HANDLE GroupHandle)
1474 {
1475  NTSTATUS Status;
1476 
1477  TRACE("SamOpenGroup(%p 0x%08x %p %p)\n",
1478  DomainHandle, DesiredAccess, GroupId, GroupHandle);
1479 
1480  RpcTryExcept
1481  {
1482  Status = SamrOpenGroup((SAMPR_HANDLE)DomainHandle,
1483  DesiredAccess,
1484  GroupId,
1485  (SAMPR_HANDLE *)GroupHandle);
1486  }
1488  {
1490  }
1491  RpcEndExcept;
1492 
1493  return Status;
1494 }
1495 
1496 
1497 NTSTATUS
1498 NTAPI
1501  IN ULONG UserId,
1502  OUT PSAM_HANDLE UserHandle)
1503 {
1504  NTSTATUS Status;
1505 
1506  TRACE("SamOpenUser(%p 0x%08x %lx %p)\n",
1507  DomainHandle, DesiredAccess, UserId, UserHandle);
1508 
1509  RpcTryExcept
1510  {
1511  Status = SamrOpenUser((SAMPR_HANDLE)DomainHandle,
1512  DesiredAccess,
1513  UserId,
1514  (SAMPR_HANDLE *)UserHandle);
1515  }
1517  {
1519  }
1520  RpcEndExcept;
1521 
1522  return Status;
1523 }
1524 
1525 
1526 NTSTATUS
1527 NTAPI
1529  IN DOMAIN_DISPLAY_INFORMATION DisplayInformation,
1530  IN ULONG Index,
1531  IN ULONG EntryCount,
1532  IN ULONG PreferredMaximumLength,
1533  OUT PULONG TotalAvailable,
1534  OUT PULONG TotalReturned,
1535  OUT PULONG ReturnedEntryCount,
1536  OUT PVOID *SortedBuffer)
1537 {
1538  SAMPR_DISPLAY_INFO_BUFFER LocalBuffer;
1539  NTSTATUS Status;
1540 
1541  TRACE("(%p %lu %lu %lu %lu %p %p %p %p)\n",
1542  DomainHandle, DisplayInformation, Index, EntryCount,
1543  PreferredMaximumLength, TotalAvailable, TotalReturned,
1544  ReturnedEntryCount, SortedBuffer);
1545 
1546  if ((TotalAvailable == NULL) ||
1547  (TotalReturned == NULL) ||
1548  (ReturnedEntryCount == NULL) ||
1549  (SortedBuffer == NULL))
1550  return STATUS_INVALID_PARAMETER;
1551 
1552  RpcTryExcept
1553  {
1555  DisplayInformation,
1556  Index,
1557  EntryCount,
1558  PreferredMaximumLength,
1559  TotalAvailable,
1560  TotalReturned,
1561  &LocalBuffer);
1562  if (NT_SUCCESS(Status))
1563  {
1564  switch (DisplayInformation)
1565  {
1566  case DomainDisplayUser:
1567  *ReturnedEntryCount = LocalBuffer.UserInformation.EntriesRead;
1568  *SortedBuffer = LocalBuffer.UserInformation.Buffer;
1569  break;
1570 
1571  case DomainDisplayMachine:
1572  *ReturnedEntryCount = LocalBuffer.MachineInformation.EntriesRead;
1573  *SortedBuffer = LocalBuffer.MachineInformation.Buffer;
1574  break;
1575 
1576  case DomainDisplayGroup:
1577  *ReturnedEntryCount = LocalBuffer.GroupInformation.EntriesRead;
1578  *SortedBuffer = LocalBuffer.GroupInformation.Buffer;
1579  break;
1580 
1581  case DomainDisplayOemUser:
1582  *ReturnedEntryCount = LocalBuffer.OemUserInformation.EntriesRead;
1583  *SortedBuffer = LocalBuffer.OemUserInformation.Buffer;
1584  break;
1585 
1586  case DomainDisplayOemGroup:
1587  *ReturnedEntryCount = LocalBuffer.OemGroupInformation.EntriesRead;
1588  *SortedBuffer = LocalBuffer.OemGroupInformation.Buffer;
1589  break;
1590 
1591  case DomainDisplayServer:
1592  /* FIXME */
1593  break;
1594  }
1595  }
1596  else
1597  {
1598  *ReturnedEntryCount = 0;
1599  *SortedBuffer = NULL;
1600  }
1601  }
1603  {
1605  }
1606  RpcEndExcept;
1607 
1608  return Status;
1609 }
1610 
1611 
1612 NTSTATUS
1613 NTAPI
1615  IN ALIAS_INFORMATION_CLASS AliasInformationClass,
1616  OUT PVOID *Buffer)
1617 {
1618  NTSTATUS Status;
1619 
1620  TRACE("SamQueryInformationAlias(%p %lu %p)\n",
1621  AliasHandle, AliasInformationClass, Buffer);
1622 
1623  RpcTryExcept
1624  {
1626  AliasInformationClass,
1628  }
1630  {
1632  }
1633  RpcEndExcept;
1634 
1635  return Status;
1636 }
1637 
1638 
1639 NTSTATUS
1640 NTAPI
1642  IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
1643  OUT PVOID *Buffer)
1644 {
1645  NTSTATUS Status;
1646 
1647  TRACE("SamQueryInformationDomain(%p %lu %p)\n",
1648  DomainHandle, DomainInformationClass, Buffer);
1649 
1650  RpcTryExcept
1651  {
1653  DomainInformationClass,
1655  }
1657  {
1659  }
1660  RpcEndExcept;
1661 
1662  return Status;
1663 }
1664 
1665 
1666 NTSTATUS
1667 NTAPI
1669  IN GROUP_INFORMATION_CLASS GroupInformationClass,
1670  OUT PVOID *Buffer)
1671 {
1672  NTSTATUS Status;
1673 
1674  TRACE("SamQueryInformationGroup(%p %lu %p)\n",
1675  GroupHandle, GroupInformationClass, Buffer);
1676 
1677  RpcTryExcept
1678  {
1680  GroupInformationClass,
1682  }
1684  {
1686  }
1687  RpcEndExcept;
1688 
1689  return Status;
1690 }
1691 
1692 
1693 NTSTATUS
1694 NTAPI
1696  IN USER_INFORMATION_CLASS UserInformationClass,
1697  OUT PVOID *Buffer)
1698 {
1699  NTSTATUS Status;
1700 
1701  TRACE("SamQueryInformationUser(%p %lu %p)\n",
1702  UserHandle, UserInformationClass, Buffer);
1703 
1704  RpcTryExcept
1705  {
1707  UserInformationClass,
1709  }
1711  {
1713  }
1714  RpcEndExcept;
1715 
1716  return Status;
1717 }
1718 
1719 
1720 NTSTATUS
1721 NTAPI
1725 {
1726  PSAMPR_SR_SECURITY_DESCRIPTOR SamSecurityDescriptor = NULL;
1727  NTSTATUS Status;
1728 
1729  TRACE("SamQuerySecurityObject(%p %lu %p)\n",
1730  ObjectHandle, SecurityInformation, SecurityDescriptor);
1731 
1733 
1734  RpcTryExcept
1735  {
1738  &SamSecurityDescriptor);
1739  }
1741  {
1743  }
1744  RpcEndExcept;
1745 
1746  TRACE("SamSecurityDescriptor: %p\n", SamSecurityDescriptor);
1747 
1748  if (SamSecurityDescriptor != NULL)
1749  {
1750  TRACE("SamSecurityDescriptor->Length: %lu\n", SamSecurityDescriptor->Length);
1751  TRACE("SamSecurityDescriptor->SecurityDescriptor: %p\n", SamSecurityDescriptor->SecurityDescriptor);
1752 
1753  *SecurityDescriptor = SamSecurityDescriptor->SecurityDescriptor;
1754 
1755  midl_user_free(SamSecurityDescriptor);
1756  }
1757 
1758  return Status;
1759 }
1760 
1761 
1762 NTSTATUS
1763 NTAPI
1765  IN PSID MemberId)
1766 {
1767  NTSTATUS Status;
1768 
1769  TRACE("SamRemoveMemberFromAlias(%p %ul)\n",
1770  AliasHandle, MemberId);
1771 
1772  RpcTryExcept
1773  {
1775  MemberId);
1776  }
1778  {
1780  }
1781  RpcEndExcept;
1782 
1783  return Status;
1784 }
1785 
1786 
1787 NTSTATUS
1788 NTAPI
1790  IN PSID MemberId)
1791 {
1792  NTSTATUS Status;
1793 
1794  TRACE("SamRemoveMemberFromForeignDomain(%p %ul)\n",
1795  DomainHandle, MemberId);
1796 
1797  RpcTryExcept
1798  {
1800  MemberId);
1801  }
1803  {
1805  }
1806  RpcEndExcept;
1807 
1808  return Status;
1809 }
1810 
1811 
1812 NTSTATUS
1813 NTAPI
1815  IN ULONG MemberId)
1816 {
1817  NTSTATUS Status;
1818 
1819  TRACE("SamRemoveMemberFromGroup(%p %ul)\n",
1820  GroupHandle, MemberId);
1821 
1822  RpcTryExcept
1823  {
1825  MemberId);
1826  }
1828  {
1830  }
1831  RpcEndExcept;
1832 
1833  return Status;
1834 }
1835 
1836 
1837 NTSTATUS
1838 NTAPI
1840  IN PSID *MemberIds,
1841  IN ULONG MemberCount)
1842 {
1844  NTSTATUS Status;
1845 
1846  TRACE("SamRemoveMultipleMembersFromAlias(%p %p %lu)\n",
1847  AliasHandle, MemberIds, MemberCount);
1848 
1849  if (MemberIds == NULL)
1851 
1852  Buffer.Count = MemberCount;
1853  Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
1854 
1855  RpcTryExcept
1856  {
1858  &Buffer);
1859  }
1861  {
1863  }
1864  RpcEndExcept;
1865 
1866  return Status;
1867 }
1868 
1869 
1870 NTSTATUS
1871 NTAPI
1873  IN ULONG Rid,
1874  OUT PSID *Sid)
1875 {
1876  UNIMPLEMENTED;
1877  return STATUS_NOT_IMPLEMENTED;
1878 }
1879 
1880 
1881 NTSTATUS
1882 NTAPI
1884  IN ALIAS_INFORMATION_CLASS AliasInformationClass,
1885  IN PVOID Buffer)
1886 {
1887  NTSTATUS Status;
1888 
1889  TRACE("SamSetInformationAlias(%p %lu %p)\n",
1890  AliasHandle, AliasInformationClass, Buffer);
1891 
1892  RpcTryExcept
1893  {
1895  AliasInformationClass,
1896  Buffer);
1897  }
1899  {
1901  }
1902  RpcEndExcept;
1903 
1904  return Status;
1905 }
1906 
1907 
1908 NTSTATUS
1909 NTAPI
1911  IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
1912  IN PVOID Buffer)
1913 {
1914  NTSTATUS Status;
1915 
1916  TRACE("SamSetInformationDomain(%p %lu %p)\n",
1917  DomainHandle, DomainInformationClass, Buffer);
1918 
1919  RpcTryExcept
1920  {
1922  DomainInformationClass,
1923  Buffer);
1924  }
1926  {
1928  }
1929  RpcEndExcept;
1930 
1931  return Status;
1932 }
1933 
1934 
1935 NTSTATUS
1936 NTAPI
1938  IN GROUP_INFORMATION_CLASS GroupInformationClass,
1939  IN PVOID Buffer)
1940 {
1941  NTSTATUS Status;
1942 
1943  TRACE("SamSetInformationGroup(%p %lu %p)\n",
1944  GroupHandle, GroupInformationClass, Buffer);
1945 
1946  RpcTryExcept
1947  {
1949  GroupInformationClass,
1950  Buffer);
1951  }
1953  {
1955  }
1956  RpcEndExcept;
1957 
1958  return Status;
1959 }
1960 
1961 
1962 NTSTATUS
1963 NTAPI
1965  IN USER_INFORMATION_CLASS UserInformationClass,
1966  IN PVOID Buffer)
1967 {
1968  PSAMPR_USER_SET_PASSWORD_INFORMATION PasswordBuffer;
1969  SAMPR_USER_INTERNAL1_INFORMATION Internal1Buffer;
1970  USER_ALL_INFORMATION InternalAllBuffer;
1971  OEM_STRING LmPwdString;
1972  CHAR LmPwdBuffer[15];
1973  NTSTATUS Status;
1974 
1975  TRACE("SamSetInformationUser(%p %lu %p)\n",
1976  UserHandle, UserInformationClass, Buffer);
1977 
1978  if (UserInformationClass == UserSetPasswordInformation)
1979  {
1980  PasswordBuffer = (PSAMPR_USER_SET_PASSWORD_INFORMATION)Buffer;
1981 
1982  Status = SampCheckPassword(UserHandle,
1983  (PUNICODE_STRING)&PasswordBuffer->Password);
1984  if (!NT_SUCCESS(Status))
1985  {
1986  TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
1987  return Status;
1988  }
1989 
1990  /* Calculate the NT hash value of the password */
1991  Status = SystemFunction007((PUNICODE_STRING)&PasswordBuffer->Password,
1992  (LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
1993  if (!NT_SUCCESS(Status))
1994  {
1995  TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
1996  return Status;
1997  }
1998 
1999  Internal1Buffer.NtPasswordPresent = TRUE;
2000  Internal1Buffer.LmPasswordPresent = FALSE;
2001 
2002  /* Build the LM password */
2003  LmPwdString.Length = 15;
2004  LmPwdString.MaximumLength = 15;
2005  LmPwdString.Buffer = LmPwdBuffer;
2006  ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
2007 
2009  (PUNICODE_STRING)&PasswordBuffer->Password,
2010  FALSE);
2011  if (NT_SUCCESS(Status))
2012  {
2013  /* Calculate the LM hash value of the password */
2014  Status = SystemFunction006(LmPwdString.Buffer,
2015  (LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
2016  if (NT_SUCCESS(Status))
2017  Internal1Buffer.LmPasswordPresent = TRUE;
2018  }
2019 
2020  Internal1Buffer.PasswordExpired = PasswordBuffer->PasswordExpired;
2021 
2022  RpcTryExcept
2023  {
2026  (PVOID)&Internal1Buffer);
2027  }
2029  {
2031  }
2032  RpcEndExcept;
2033 
2034  if (!NT_SUCCESS(Status))
2035  {
2036  TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
2037  }
2038 
2039  return Status;
2040  }
2041  else if (UserInformationClass == UserAllInformation)
2042  {
2043  RtlCopyMemory(&InternalAllBuffer,
2044  Buffer,
2045  sizeof(USER_ALL_INFORMATION));
2046 
2048  {
2049  if (InternalAllBuffer.WhichFields & USER_ALL_OWFPASSWORD)
2050  {
2051  /* Check NT password hash */
2052  if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
2053  {
2054  if (InternalAllBuffer.NtPassword.Length != sizeof(ENCRYPTED_NT_OWF_PASSWORD))
2055  return STATUS_INVALID_PARAMETER;
2056  }
2057 
2058  /* Check LM password hash */
2059  if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
2060  {
2061  if (InternalAllBuffer.LmPassword.Length != sizeof(ENCRYPTED_LM_OWF_PASSWORD))
2062  return STATUS_INVALID_PARAMETER;
2063  }
2064  }
2065  else
2066  {
2067  /*
2068  * Only allow the NT password to be set.
2069  * The LM password will be created here.
2070  */
2071  if (InternalAllBuffer.WhichFields & USER_ALL_LMPASSWORDPRESENT)
2072  {
2073  TRACE("Do not try to set a clear text LM password!\n");
2074  return STATUS_INVALID_PARAMETER;
2075  }
2076 
2077  if (InternalAllBuffer.WhichFields & USER_ALL_NTPASSWORDPRESENT)
2078  {
2079  Status = SampCheckPassword(UserHandle,
2080  &InternalAllBuffer.NtPassword);
2081  if (!NT_SUCCESS(Status))
2082  {
2083  TRACE("SampCheckPassword failed (Status 0x%08lx)\n", Status);
2084  return Status;
2085  }
2086 
2087  /* Calculate the NT password hash */
2088  Status = SystemFunction007((PUNICODE_STRING)&InternalAllBuffer.NtPassword,
2089  (LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
2090  if (!NT_SUCCESS(Status))
2091  {
2092  TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
2093  return Status;
2094  }
2095 
2096  InternalAllBuffer.NtPasswordPresent = TRUE;
2097  InternalAllBuffer.LmPasswordPresent = FALSE;
2098 
2099  InternalAllBuffer.NtPassword.Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
2100  InternalAllBuffer.NtPassword.MaximumLength = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
2101  InternalAllBuffer.NtPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedNtOwfPassword;
2102 
2103  /* Build the LM password */
2104  LmPwdString.Length = 15;
2105  LmPwdString.MaximumLength = 15;
2106  LmPwdString.Buffer = LmPwdBuffer;
2107  ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
2108 
2110  (PUNICODE_STRING)&InternalAllBuffer.NtPassword,
2111  FALSE);
2112  if (NT_SUCCESS(Status))
2113  {
2114  /* Calculate the LM password hash */
2115  Status = SystemFunction006(LmPwdString.Buffer,
2116  (LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
2117  if (NT_SUCCESS(Status))
2118  {
2119  InternalAllBuffer.WhichFields |= USER_ALL_LMPASSWORDPRESENT;
2120  InternalAllBuffer.LmPasswordPresent = TRUE;
2121 
2122  InternalAllBuffer.LmPassword.Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
2123  InternalAllBuffer.LmPassword.MaximumLength = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
2124  InternalAllBuffer.LmPassword.Buffer = (LPWSTR)&Internal1Buffer.EncryptedLmOwfPassword;
2125  }
2126  }
2127  }
2128  }
2129  }
2130 
2131  RpcTryExcept
2132  {
2135  (PVOID)&InternalAllBuffer);
2136  }
2138  {
2140  }
2141  RpcEndExcept;
2142 
2143  if (!NT_SUCCESS(Status))
2144  {
2145  TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
2146  }
2147 
2148  return Status;
2149  }
2150 
2151  RpcTryExcept
2152  {
2154  UserInformationClass,
2155  Buffer);
2156  }
2158  {
2160  }
2161  RpcEndExcept;
2162 
2163  return Status;
2164 }
2165 
2166 
2167 NTSTATUS
2168 NTAPI
2170  IN ULONG MemberId,
2172 {
2173  NTSTATUS Status;
2174 
2175  TRACE("SamSetMemberAttributesOfGroup(%p %lu 0x%lx)\n",
2176  GroupHandle, MemberId, Attributes);
2177 
2178  RpcTryExcept
2179  {
2181  MemberId,
2182  Attributes);
2183  }
2185  {
2187  }
2188  RpcEndExcept;
2189 
2190  return Status;
2191 }
2192 
2193 
2194 NTSTATUS
2195 NTAPI
2199 {
2200  SAMPR_SR_SECURITY_DESCRIPTOR DescriptorToPass;
2201  ULONG Length;
2202  NTSTATUS Status;
2203 
2204  TRACE("SamSetSecurityObject(%p %lu %p)\n",
2205  ObjectHandle, SecurityInformation, SecurityDescriptor);
2206 
2207  /* Retrieve the length of the relative security descriptor */
2208  Length = 0;
2210  NULL,
2211  &Length);
2213  return STATUS_INVALID_PARAMETER;
2214 
2215 
2216  /* Allocate a buffer for the security descriptor */
2217  DescriptorToPass.Length = Length;
2218  DescriptorToPass.SecurityDescriptor = MIDL_user_allocate(Length);
2219  if (DescriptorToPass.SecurityDescriptor == NULL)
2221 
2222  /* Convert the given security descriptor to a relative security descriptor */
2224  (PSECURITY_DESCRIPTOR)DescriptorToPass.SecurityDescriptor,
2225  &Length);
2226  if (!NT_SUCCESS(Status))
2227  goto done;
2228 
2229  RpcTryExcept
2230  {
2231  Status = SamrSetSecurityObject((SAMPR_HANDLE)ObjectHandle,
2233  &DescriptorToPass);
2234  }
2236  {
2238  }
2239  RpcEndExcept;
2240 
2241 done:
2242  if (DescriptorToPass.SecurityDescriptor != NULL)
2243  MIDL_user_free(DescriptorToPass.SecurityDescriptor);
2244 
2245  return Status;
2246 }
2247 
2248 
2249 NTSTATUS
2250 NTAPI
2252 {
2253  NTSTATUS Status;
2254 
2255  TRACE("(%p)\n", ServerHandle);
2256 
2257  RpcTryExcept
2258  {
2259  Status = SamrShutdownSamServer((SAMPR_HANDLE)ServerHandle);
2260  }
2262  {
2264  }
2265  RpcEndExcept;
2266 
2267  return Status;
2268 }
2269 
2270 
2271 NTSTATUS
2272 NTAPI
2274  _In_ SAM_HANDLE DomainHandle)
2275 {
2276  TRACE("SamTestPrivateFunctionsDomain(%p)\n",
2277  DomainHandle);
2278  return STATUS_NOT_IMPLEMENTED;
2279 }
2280 
2281 
2282 NTSTATUS
2283 NTAPI
2285  _In_ SAM_HANDLE UserHandle)
2286 {
2287  TRACE("SamTestPrivateFunctionsUser(%p)\n",
2288  UserHandle);
2289  return STATUS_NOT_IMPLEMENTED;
2290 }
2291 
2292 /* EOF */
NTSTATUS NTAPI SamRemoveMemberFromGroup(IN SAM_HANDLE GroupHandle, IN ULONG MemberId)
Definition: samlib.c:1814
NTSTATUS NTAPI SamrRemoveMemberFromForeignDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_SID MemberSid)
Definition: samrpc.c:8843
NTSTATUS NTAPI SamCloseHandle(IN SAM_HANDLE SamHandle)
Definition: samlib.c:476
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:877
unsigned long * Element
Definition: lsasrv.h:86
NTSTATUS NTAPI SamrGetDisplayEnumerationIndex2(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN PRPC_UNICODE_STRING Prefix, OUT unsigned long *Index)
Definition: samrpc.c:8962
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
NTSTATUS NTAPI SamGetGroupsForUser(IN SAM_HANDLE UserHandle, OUT PGROUP_MEMBERSHIP *Groups, OUT PULONG MembershipCount)
Definition: samlib.c:1058
#define IN
Definition: typedefs.h:38
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS NTAPI SamCreateGroupInDomain(IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE GroupHandle, OUT PULONG RelativeId)
Definition: samlib.c:560
enum _DOMAIN_DISPLAY_INFORMATION DOMAIN_DISPLAY_INFORMATION
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
NTSTATUS __stdcall SamrGetAliasMembership(SAMPR_HANDLE DomainHandle, PSAMPR_PSID_ARRAY SidArray, PSAMPR_ULONG_ARRAY Membership)
#define TRUE
Definition: types.h:120
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1631
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
NTSTATUS NTAPI SamSetMemberAttributesOfGroup(IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
Definition: samlib.c:2169
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSTATUS NTAPI SamrShutdownSamServer(IN SAMPR_HANDLE ServerHandle)
Definition: samrpc.c:465
enum _SID_NAME_USE SID_NAME_USE
NTSTATUS NTAPI SamGetMembersInAlias(IN SAM_HANDLE AliasHandle, OUT PSID **MemberIds, OUT PULONG MemberCount)
Definition: samlib.c:1102
NTSTATUS NTAPI SamAddMemberToAlias(IN SAM_HANDLE AliasHandle, IN PSID MemberId)
Definition: samlib.c:214
NTSTATUS NTAPI SamTestPrivateFunctionsUser(_In_ SAM_HANDLE UserHandle)
Definition: samlib.c:2284
NTSTATUS NTAPI SamGetDisplayEnumerationIndex(IN SAM_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformation, IN PUNICODE_STRING Prefix, OUT PULONG Index)
Definition: samlib.c:1025
_In_ ULONG Mode
Definition: hubbusif.h:303
NTSTATUS __stdcall SamrOpenDomain(SAMPR_HANDLE ServerHandle, ACCESS_MASK DesiredAccess, PRPC_SID DomainId, SAMPR_HANDLE *DomainHandle)
NTSTATUS NTAPI SamDeleteGroup(IN SAM_HANDLE GroupHandle)
Definition: samlib.c:696
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
handle_t hBinding
Definition: ctx_c.c:54
NTSTATUS NTAPI SamrGetMembersInAlias(IN SAMPR_HANDLE AliasHandle, OUT PSAMPR_PSID_ARRAY_OUT Members)
Definition: samrpc.c:5454
USHORT MaximumLength
Definition: env_spec_w32.h:370
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
NTSTATUS NTAPI SamRidToSid(IN SAM_HANDLE ObjectHandle, IN ULONG Rid, OUT PSID *Sid)
Definition: samlib.c:1872
NTSTATUS NTAPI SamrSetMemberAttributesOfGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4872
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
NTSTATUS NTAPI SamrEnumerateGroupsInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:2191
SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER MachineInformation
Definition: sam.idl:366
NTSTATUS NTAPI SamQueryDisplayInformation(IN SAM_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformation, IN ULONG Index, IN ULONG EntryCount, IN ULONG PreferredMaximumLength, OUT PULONG TotalAvailable, OUT PULONG TotalReturned, OUT PULONG ReturnedEntryCount, OUT PVOID *SortedBuffer)
Definition: samlib.c:1528
wchar_t * PSAMPR_SERVER_NAME
Definition: authpackage.c:112
NTSTATUS NTAPI SamrQueryInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
Definition: samrpc.c:1608
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
char CHAR
Definition: xmlstorage.h:175
NTSTATUS NTAPI SamOpenDomain(IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
Definition: samlib.c:1441
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamQueryInformationAlias(IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1614
BOOLEAN LmPasswordPresent
Definition: ntsam.h:687
NTSTATUS NTAPI SamCreateUserInDomain(IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE UserHandle, OUT PULONG RelativeId)
Definition: samlib.c:634
NTSTATUS NTAPI SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PSAMPR_GROUP_INFO_BUFFER Buffer)
Definition: samrpc.c:4510
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define ZeroMemory
Definition: winbase.h:1635
NTSTATUS NTAPI SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle, IN ULONG Count, IN RPC_UNICODE_STRING Names[], OUT PSAMPR_ULONG_ARRAY RelativeIds, OUT PSAMPR_ULONG_ARRAY Use)
Definition: samrpc.c:3558
NTSTATUS NTAPI SamrQueryInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PSAMPR_GROUP_INFO_BUFFER *Buffer)
Definition: samrpc.c:4346
NTSTATUS NTAPI SamQueryInformationDomain(IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1641
NTSTATUS NTAPI SamOpenAlias(IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT PSAM_HANDLE AliasHandle)
Definition: samlib.c:1412
PSAMPR_DOMAIN_DISPLAY_OEM_USER Buffer
Definition: sam.idl:354
SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER GroupInformation
Definition: sam.idl:367
NTSTATUS NTAPI SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle, IN unsigned char LmPresent, IN PENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm, IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm, IN unsigned char NtPresent, IN PENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt, IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt, IN unsigned char NtCrossEncryptionPresent, IN PENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithNewLm, IN unsigned char LmCrossEncryptionPresent, IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt)
Definition: samrpc.c:8324
NTSTATUS NTAPI SamEnumerateUsersInDomain(IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, IN ULONG UserAccountControl, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samlib.c:897
NTSTATUS WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
Definition: crypt_lmhash.c:53
NTSTATUS NTAPI SamrGetGroupsForUser(IN SAMPR_HANDLE UserHandle, OUT PSAMPR_GET_GROUPS_BUFFER *Groups)
Definition: samrpc.c:8605
NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
STRING OEM_STRING
Definition: umtypes.h:203
NTSTATUS NTAPI SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *GroupHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:1997
TOpcodeData Groups[17][8]
char * LPSTR
Definition: xmlstorage.h:182
NTSTATUS NTAPI SamrLookupDomainInSamServer(IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
Definition: samrpc.c:497
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:511
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
UNICODE_STRING LmPassword
Definition: ntsam.h:674
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
#define C1_LOWER
Definition: unicode.h:32
#define USER_ALL_OWFPASSWORD
Definition: ntsam.h:225
#define STATUS_PASSWORD_RESTRICTION
Definition: ntstatus.h:330
unsigned long Length
Definition: msv1_0.h:76
NTSTATUS NTAPI SamSetInformationGroup(IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PVOID Buffer)
Definition: samlib.c:1937
long RPC_STATUS
Definition: rpc.h:52
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
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
Definition: glfuncs.h:248
NTSTATUS NTAPI SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle)
Definition: samrpc.c:5576
#define DOMAIN_PASSWORD_COMPLEX
Definition: ntsam.h:254
NTSTATUS NTAPI SamChangePasswordUser3(IN PUNICODE_STRING ServerName, IN PUNICODE_STRING UserName, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword, OUT PDOMAIN_PASSWORD_INFORMATION *EffectivePasswordPolicy, OUT PUSER_PWD_CHANGE_FAILURE_INFORMATION *PasswordChangeFailureInfo)
Definition: samlib.c:462
NTSTATUS NTAPI SamrGetMembersInGroup(IN SAMPR_HANDLE GroupHandle, OUT PSAMPR_GET_MEMBERS_BUFFER *Members)
Definition: samrpc.c:4758
unsigned char * LPBYTE
Definition: typedefs.h:52
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER OemGroupInformation
Definition: sam.idl:369
NTSTATUS NTAPI SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9423
enum _GROUP_INFORMATION_CLASS GROUP_INFORMATION_CLASS
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
NTSTATUS NTAPI SamCreateUser2InDomain(IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ULONG AccountType, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE UserHandle, OUT PULONG GrantedAccess, OUT PULONG RelativeId)
Definition: samlib.c:594
NTSTATUS NTAPI SamGetMembersInGroup(IN SAM_HANDLE GroupHandle, OUT PULONG *MemberIds, OUT PULONG *Attributes, OUT PULONG MemberCount)
Definition: samlib.c:1144
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSTATUS NTAPI SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle, IN ULONG Count, IN ULONG *RelativeIds, OUT PSAMPR_RETURNED_USTRING_ARRAY Names, OUT PSAMPR_ULONG_ARRAY Use)
Definition: samrpc.c:3787
NTSTATUS NTAPI SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PULONG RelativeIds, OUT PUNICODE_STRING *Names, OUT PSID_NAME_USE *Use OPTIONAL)
Definition: samlib.c:1220
static PVOID ptr
Definition: dispmode.c:27
#define RpcTryExcept
Definition: rpc.h:126
#define SAM_SID_COMPATIBILITY_ALL
Definition: ntsam.h:700
NTSTATUS NTAPI SamLookupNamesInDomain(IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PUNICODE_STRING Names, OUT PULONG *RelativeIds, OUT PSID_NAME_USE *Use)
Definition: samlib.c:1335
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS NTAPI SamChangePasswordUser(IN SAM_HANDLE UserHandle, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
Definition: samlib.c:299
PRPC_UNICODE_STRING Element
Definition: lookup.c:22
unsigned char BOOLEAN
unsigned char * SecurityDescriptor
Definition: msv1_0.h:77
smooth NULL
Definition: ftsmooth.c:416
enum _DOMAIN_INFORMATION_CLASS DOMAIN_INFORMATION_CLASS
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:462
NTSTATUS NTAPI SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *UserHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:2396
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
NTSTATUS NTAPI SamrAddMemberToAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5374
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
Definition: bufpool.h:45
NTSTATUS NTAPI SamrQueryInformationAlias(IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PSAMPR_ALIAS_INFO_BUFFER *Buffer)
Definition: samrpc.c:5138
NTSTATUS NTAPI SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:5316
NTSTATUS NTAPI SamSetInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PVOID Buffer)
Definition: samlib.c:1964
#define __RPC_FAR
Definition: rpc.h:56
const char * LPCSTR
Definition: xmlstorage.h:183
unsigned long Count
Definition: lsasrv.h:85
NTSTATUS NTAPI SamrGetUserDomainPasswordInformation(IN SAMPR_HANDLE UserHandle, OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation)
Definition: samrpc.c:8755
#define __RPC_USER
Definition: rpc.h:65
NTSTATUS NTAPI SamRemoveMultipleMembersFromAlias(IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
Definition: samlib.c:1839
PSAMPR_DOMAIN_DISPLAY_OEM_GROUP Buffer
Definition: sam.idl:360
RPC_UNICODE_STRING Password
Definition: sam.idl:629
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: samlib.c:59
NTSTATUS NTAPI SamCreateAliasInDomain(IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE AliasHandle, OUT PULONG RelativeId)
Definition: samlib.c:526
#define RpcExceptionCode()
Definition: rpc.h:132
enum _SID_NAME_USE * PSID_NAME_USE
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamDeleteUser(IN SAM_HANDLE UserHandle)
Definition: samlib.c:724
NTSTATUS NTAPI SamEnumerateDomainsInSamServer(IN SAM_HANDLE ServerHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samlib.c:802
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSTATUS NTAPI SamDeleteAlias(IN SAM_HANDLE AliasHandle)
Definition: samlib.c:668
NTSTATUS NTAPI SamrEnumerateAliasesInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:3182
#define C1_ALPHA
Definition: unicode.h:39
NTSTATUS NTAPI SamSetInformationDomain(IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PVOID Buffer)
Definition: samlib.c:1910
NTSTATUS NTAPI SamrEnumerateDomainsInSamServer(IN SAMPR_HANDLE ServerHandle, IN OUT unsigned long *EnumerationContext, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samrpc.c:614
unsigned long Count
Definition: sam.idl:55
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI SamrRemoveMemberFromGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId)
Definition: samrpc.c:4696
ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword
Definition: sam.idl:640
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: lang.c:1699
NTSTATUS NTAPI SamEnumerateGroupsInDomain(IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, IN PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samlib.c:852
#define C1_DIGIT
Definition: unicode.h:33
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
#define WINAPI
Definition: msvc.h:8
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned short WORD
Definition: ntddk_ex.h:93
static FILE * out
Definition: regtests2xml.c:44
NTSTATUS NTAPI SamLookupDomainInSamServer(IN SAM_HANDLE ServerHandle, IN PUNICODE_STRING Name, OUT PSID *DomainId)
Definition: samlib.c:1193
PSAMPR_SID_INFORMATION Sids
Definition: authpackage.c:123
NTSTATUS NTAPI SamrDeleteGroup(IN OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:4628
SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER OemUserInformation
Definition: sam.idl:368
NTSTATUS NTAPI SamGetCompatibilityMode(IN SAM_HANDLE ObjectHandle, OUT PULONG Mode)
Definition: samlib.c:1009
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
enum _ALIAS_INFORMATION_CLASS ALIAS_INFORMATION_CLASS
#define CT_CTYPE1
Definition: winnls.h:234
handle_t __RPC_USER PSAMPR_SERVER_NAME_bind(PSAMPR_SERVER_NAME pszSystemName)
Definition: samlib.c:72
#define C1_PUNCT
Definition: unicode.h:35
NTSTATUS NTAPI SamrSetInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PSAMPR_DOMAIN_INFO_BUFFER DomainInformation)
Definition: samrpc.c:1893
static const WCHAR L[]
Definition: oid.c:1250
PSAMPR_SID_INFORMATION Sids
Definition: sam.idl:56
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
NTSTATUS NTAPI SamFreeMemory(IN PVOID Buffer)
Definition: samlib.c:947
#define C1_UPPER
Definition: unicode.h:31
#define USER_ALL_NTPASSWORDPRESENT
Definition: ntsam.h:220
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
NTSTATUS NTAPI SamrOpenGroup(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN unsigned long GroupId, OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:4072
NTSTATUS NTAPI SamAddMemberToGroup(IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
Definition: samlib.c:239
NTSTATUS NTAPI SamrAddMemberToGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4564
NTSTATUS NTAPI SamrOpenAlias(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:4915
unsigned short Length
Definition: msv1_0.h:53
PSAMPR_DOMAIN_DISPLAY_GROUP Buffer
Definition: sam.idl:348
NTSTATUS NTAPI SamShutdownSamServer(IN SAM_HANDLE ServerHandle)
Definition: samlib.c:2251
SAMPR_DOMAIN_DISPLAY_USER_BUFFER UserInformation
Definition: sam.idl:365
NTSTATUS NTAPI SamrRemoveMultipleMembersFromAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9451
BOOLEAN NtPasswordPresent
Definition: ntsam.h:688
NTSTATUS NTAPI SamSetSecurityObject(IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: samlib.c:2196
NTSTATUS NTAPI SamrConnect(IN PSAMPR_SERVER_NAME ServerName, OUT SAMPR_HANDLE *ServerHandle, IN ACCESS_MASK DesiredAccess)
Definition: samrpc.c:134
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamTestPrivateFunctionsDomain(_In_ SAM_HANDLE DomainHandle)
Definition: samlib.c:2273
uint16_t * LPWORD
Definition: typedefs.h:54
#define _In_
Definition: no_sal2.h:204
NTSTATUS NTAPI SamrRemoveMemberFromAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5414
NTSTATUS NTAPI SamSetInformationAlias(IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PVOID Buffer)
Definition: samlib.c:1883
unsigned long Count
Definition: authpackage.c:122
ULONG_PTR SIZE_T
Definition: typedefs.h:78
PSAMPR_DOMAIN_DISPLAY_MACHINE Buffer
Definition: sam.idl:342
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
struct _SAMPR_USER_SET_PASSWORD_INFORMATION * PSAMPR_USER_SET_PASSWORD_INFORMATION
ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword
Definition: sam.idl:641
GLuint in
Definition: glext.h:9616
PGROUP_MEMBERSHIP Groups
Definition: sam.idl:116
NTSTATUS NTAPI SamQuerySecurityObject(IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: samlib.c:1722
NTSTATUS WINAPI SystemFunction012(const BYTE *in, const BYTE *key, LPBYTE out)
Definition: sysfunc.c:353
NTSTATUS NTAPI SamrSetInformationAlias(IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PSAMPR_ALIAS_INFO_BUFFER Buffer)
Definition: samrpc.c:5267
NTSTATUS NTAPI SamrSetInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
Definition: samrpc.c:8119
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
NTSTATUS __stdcall SamrCloseHandle(SAMPR_HANDLE *SamHandle)
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS NTAPI SamEnumerateAliasesInDomain(IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
Definition: samlib.c:752
unsigned long * Members
Definition: sam.idl:122
NTSTATUS NTAPI SamrSetSecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
Definition: samrpc.c:191
unsigned long * Attributes
Definition: sam.idl:123
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define USER_ALL_LMPASSWORDPRESENT
Definition: ntsam.h:221
NTSTATUS NTAPI SamrOpenUser(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT SAMPR_HANDLE *UserHandle)
NTSTATUS NTAPI SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *AliasHandle, OUT unsigned long *RelativeId)
Definition: samrpc.c:3006
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
NTSTATUS NTAPI SamRemoveMemberFromForeignDomain(IN SAM_HANDLE DomainHandle, IN PSID MemberId)
Definition: samlib.c:1789
unsigned long MemberCount
Definition: sam.idl:121
NTSTATUS SampCheckPassword(IN SAMPR_HANDLE UserHandle, IN PUNICODE_STRING Password)
Definition: samlib.c:127
unsigned long MembershipCount
Definition: sam.idl:115
#define OUT
Definition: typedefs.h:39
NTSTATUS NTAPI SamRemoveMemberFromAlias(IN SAM_HANDLE AliasHandle, IN PSID MemberId)
Definition: samlib.c:1764
NTSTATUS NTAPI SamGetAliasMembership(IN SAM_HANDLE DomainHandle, IN ULONG PassedCount, IN PSID *Sids, OUT PULONG MembershipCount, OUT PULONG *Aliases)
Definition: samlib.c:958
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI SamrQuerySecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: samrpc.c:328
#define UNIMPLEMENTED
Definition: debug.h:114
void __RPC_USER PSAMPR_SERVER_NAME_unbind(PSAMPR_SERVER_NAME pszSystemName, handle_t hBinding)
Definition: samlib.c:111
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
NTSTATUS NTAPI SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_UNICODE_STRING Name, IN unsigned long AccountType, IN ACCESS_MASK DesiredAccess, OUT SAMPR_HANDLE *UserHandle, OUT unsigned long *GrantedAccess, OUT unsigned long *RelativeId)
Definition: samrpc.c:8980
NTSTATUS NTAPI SamOpenGroup(IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG GroupId, OUT PSAM_HANDLE GroupHandle)
Definition: samlib.c:1470
NTSTATUS NTAPI SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
Definition: samrpc.c:7328
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UNICODE_STRING NtPassword
Definition: ntsam.h:675
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:13
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
NTSTATUS NTAPI SamQueryInformationUser(IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1695
return STATUS_SUCCESS
Definition: btrfs.c:2777
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
PSAMPR_DOMAIN_DISPLAY_USER Buffer
Definition: sam.idl:336
Definition: _hash_fun.h:40
NTSYSAPI NTSTATUS NTAPI RtlMakeSelfRelativeSD(_In_ PSECURITY_DESCRIPTOR AbsoluteSD, _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Inout_ PULONG BufferLength)
static SERVICE_STATUS status
Definition: service.c:31
NTSTATUS NTAPI SamConnect(IN OUT PUNICODE_STRING ServerName OPTIONAL, OUT PSAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: samlib.c:498
NTSTATUS NTAPI SamrQueryDisplayInformation3(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformationClass, IN unsigned long Index, IN unsigned long EntryCount, IN unsigned long PreferredMaximumLength, OUT unsigned long *TotalAvailable, OUT unsigned long *TotalReturned, OUT PSAMPR_DISPLAY_INFO_BUFFER Buffer)
Definition: samrpc.c:9395
NTSTATUS NTAPI SamChangePasswordUser2(IN PUNICODE_STRING ServerName, IN PUNICODE_STRING UserName, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
Definition: samlib.c:450
NTSTATUS NTAPI SamQueryInformationGroup(IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PVOID *Buffer)
Definition: samlib.c:1668
#define HeapFree(x, y, z)
Definition: compat.h:394
ULONG ACCESS_MASK
Definition: nt_native.h:40
ULONG * PSAM_ENUMERATE_HANDLE
Definition: ntsam.h:263
WINE_DEFAULT_DEBUG_CHANNEL(samlib)
NTSTATUS NTAPI SamAddMultipleMembersToAlias(IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
Definition: samlib.c:266
unsigned short MaximumLength
Definition: msv1_0.h:54
struct _SAMPR_SID_INFORMATION * PSAMPR_SID_INFORMATION
#define RpcExcept(expr)
Definition: rpc.h:127
enum _USER_INFORMATION_CLASS USER_INFORMATION_CLASS
Definition: path.c:42
wchar_t * Buffer
Definition: msv1_0.h:55
void * SAMPR_HANDLE
Definition: authpackage.c:113
NTSTATUS NTAPI SamOpenUser(IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT PSAM_HANDLE UserHandle)
Definition: samlib.c:1499
NTSTATUS NTAPI SamrEnumerateUsersInDomain(IN SAMPR_HANDLE DomainHandle, IN OUT unsigned long *EnumerationContext, IN unsigned long UserAccountControl, OUT PSAMPR_ENUMERATION_BUFFER *Buffer, IN unsigned long PreferedMaximumLength, OUT unsigned long *CountReturned)
Definition: samrpc.c:2800
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741
Definition: ps.c:97
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68