ReactOS  0.4.13-dev-242-g611e6d7
samlib.c File Reference
#include "precomp.h"
#include <ndk/rtlfuncs.h>
#include <ntsam.h>
#include <sam_c.h>
#include <wine/debug.h>
Include dependency graph for samlib.c:

Go to the source code of this file.

Macros

#define NTOS_MODE_USER
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (samlib)
 
NTSTATUS WINAPI SystemFunction006 (LPCSTR password, LPSTR hash)
 
NTSTATUS WINAPI SystemFunction007 (PUNICODE_STRING string, LPBYTE hash)
 
NTSTATUS WINAPI SystemFunction012 (const BYTE *in, const BYTE *key, LPBYTE out)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
handle_t __RPC_USER PSAMPR_SERVER_NAME_bind (PSAMPR_SERVER_NAME pszSystemName)
 
void __RPC_USER PSAMPR_SERVER_NAME_unbind (PSAMPR_SERVER_NAME pszSystemName, handle_t hBinding)
 
NTSTATUS SampCheckPassword (IN SAMPR_HANDLE UserHandle, IN PUNICODE_STRING Password)
 
NTSTATUS NTAPI SamAddMemberToAlias (IN SAM_HANDLE AliasHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamAddMemberToGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
 
NTSTATUS NTAPI SamAddMultipleMembersToAlias (IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
 
NTSTATUS NTAPI SamChangePasswordUser (IN SAM_HANDLE UserHandle, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
 
NTSTATUS NTAPI SamChangePasswordUser2 (IN PUNICODE_STRING ServerName, IN PUNICODE_STRING UserName, IN PUNICODE_STRING OldPassword, IN PUNICODE_STRING NewPassword)
 
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)
 
NTSTATUS NTAPI SamCloseHandle (IN SAM_HANDLE SamHandle)
 
NTSTATUS NTAPI SamConnect (IN OUT PUNICODE_STRING ServerName OPTIONAL, OUT PSAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
 
NTSTATUS NTAPI SamCreateAliasInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE AliasHandle, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamCreateGroupInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE GroupHandle, OUT PULONG RelativeId)
 
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)
 
NTSTATUS NTAPI SamCreateUserInDomain (IN SAM_HANDLE DomainHandle, IN PUNICODE_STRING AccountName, IN ACCESS_MASK DesiredAccess, OUT PSAM_HANDLE UserHandle, OUT PULONG RelativeId)
 
NTSTATUS NTAPI SamDeleteAlias (IN SAM_HANDLE AliasHandle)
 
NTSTATUS NTAPI SamDeleteGroup (IN SAM_HANDLE GroupHandle)
 
NTSTATUS NTAPI SamDeleteUser (IN SAM_HANDLE UserHandle)
 
NTSTATUS NTAPI SamEnumerateAliasesInDomain (IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamEnumerateDomainsInSamServer (IN SAM_HANDLE ServerHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, OUT PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
NTSTATUS NTAPI SamEnumerateGroupsInDomain (IN SAM_HANDLE DomainHandle, IN OUT PSAM_ENUMERATE_HANDLE EnumerationContext, IN PVOID *Buffer, IN ULONG PreferedMaximumLength, OUT PULONG CountReturned)
 
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)
 
NTSTATUS NTAPI SamFreeMemory (IN PVOID Buffer)
 
NTSTATUS NTAPI SamGetAliasMembership (IN SAM_HANDLE DomainHandle, IN ULONG PassedCount, IN PSID *Sids, OUT PULONG MembershipCount, OUT PULONG *Aliases)
 
NTSTATUS NTAPI SamGetCompatibilityMode (IN SAM_HANDLE ObjectHandle, OUT PULONG Mode)
 
NTSTATUS NTAPI SamGetDisplayEnumerationIndex (IN SAM_HANDLE DomainHandle, IN DOMAIN_DISPLAY_INFORMATION DisplayInformation, IN PUNICODE_STRING Prefix, OUT PULONG Index)
 
NTSTATUS NTAPI SamGetGroupsForUser (IN SAM_HANDLE UserHandle, OUT PGROUP_MEMBERSHIP *Groups, OUT PULONG MembershipCount)
 
NTSTATUS NTAPI SamGetMembersInAlias (IN SAM_HANDLE AliasHandle, OUT PSID **MemberIds, OUT PULONG MemberCount)
 
NTSTATUS NTAPI SamGetMembersInGroup (IN SAM_HANDLE GroupHandle, OUT PULONG *MemberIds, OUT PULONG *Attributes, OUT PULONG MemberCount)
 
NTSTATUS NTAPI SamLookupDomainInSamServer (IN SAM_HANDLE ServerHandle, IN PUNICODE_STRING Name, OUT PSID *DomainId)
 
NTSTATUS NTAPI SamLookupIdsInDomain (IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PULONG RelativeIds, OUT PUNICODE_STRING *Names, OUT PSID_NAME_USE *Use OPTIONAL)
 
NTSTATUS NTAPI SamLookupNamesInDomain (IN SAM_HANDLE DomainHandle, IN ULONG Count, IN PUNICODE_STRING Names, OUT PULONG *RelativeIds, OUT PSID_NAME_USE *Use)
 
NTSTATUS NTAPI SamOpenAlias (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT PSAM_HANDLE AliasHandle)
 
NTSTATUS NTAPI SamOpenDomain (IN SAM_HANDLE ServerHandle, IN ACCESS_MASK DesiredAccess, IN PSID DomainId, OUT PSAM_HANDLE DomainHandle)
 
NTSTATUS NTAPI SamOpenGroup (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG GroupId, OUT PSAM_HANDLE GroupHandle)
 
NTSTATUS NTAPI SamOpenUser (IN SAM_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT PSAM_HANDLE UserHandle)
 
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)
 
NTSTATUS NTAPI SamQueryInformationAlias (IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationDomain (IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationGroup (IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQueryInformationUser (IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PVOID *Buffer)
 
NTSTATUS NTAPI SamQuerySecurityObject (IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor)
 
NTSTATUS NTAPI SamRemoveMemberFromAlias (IN SAM_HANDLE AliasHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamRemoveMemberFromForeignDomain (IN SAM_HANDLE DomainHandle, IN PSID MemberId)
 
NTSTATUS NTAPI SamRemoveMemberFromGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId)
 
NTSTATUS NTAPI SamRemoveMultipleMembersFromAlias (IN SAM_HANDLE AliasHandle, IN PSID *MemberIds, IN ULONG MemberCount)
 
NTSTATUS NTAPI SamRidToSid (IN SAM_HANDLE ObjectHandle, IN ULONG Rid, OUT PSID *Sid)
 
NTSTATUS NTAPI SamSetInformationAlias (IN SAM_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationDomain (IN SAM_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationGroup (IN SAM_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetInformationUser (IN SAM_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PVOID Buffer)
 
NTSTATUS NTAPI SamSetMemberAttributesOfGroup (IN SAM_HANDLE GroupHandle, IN ULONG MemberId, IN ULONG Attributes)
 
NTSTATUS NTAPI SamSetSecurityObject (IN SAM_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
 
NTSTATUS NTAPI SamShutdownSamServer (IN SAM_HANDLE ServerHandle)
 
NTSTATUS NTAPI SamTestPrivateFunctionsDomain (_In_ SAM_HANDLE DomainHandle)
 
NTSTATUS NTAPI SamTestPrivateFunctionsUser (_In_ SAM_HANDLE UserHandle)
 

Macro Definition Documentation

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 29 of file samlib.c.

Function Documentation

◆ midl_user_allocate()

void __RPC_FAR* __RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 59 of file samlib.c.

60 {
62 }
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by SamLookupIdsInDomain(), SamLookupNamesInDomain(), and SampCheckPassword().

◆ midl_user_free()

◆ PSAMPR_SERVER_NAME_bind()

handle_t __RPC_USER PSAMPR_SERVER_NAME_bind ( PSAMPR_SERVER_NAME  pszSystemName)

Definition at line 72 of file samlib.c.

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 }
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:877
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
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
long RPC_STATUS
Definition: rpc.h:52
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR L[]
Definition: oid.c:1250
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ PSAMPR_SERVER_NAME_unbind()

void __RPC_USER PSAMPR_SERVER_NAME_unbind ( PSAMPR_SERVER_NAME  pszSystemName,
handle_t  hBinding 
)

Definition at line 111 of file samlib.c.

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 }
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
handle_t hBinding
Definition: ctx_c.c:54
long RPC_STATUS
Definition: rpc.h:52
#define TRACE(s)
Definition: solgame.cpp:4
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ SamAddMemberToAlias()

NTSTATUS NTAPI SamAddMemberToAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID  MemberId 
)

Definition at line 214 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS NTAPI SamrAddMemberToAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5374
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupAddMembers().

◆ SamAddMemberToGroup()

NTSTATUS NTAPI SamAddMemberToGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId,
IN ULONG  Attributes 
)

Definition at line 239 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrAddMemberToGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4564
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupAddUser(), and NetGroupSetUsers().

◆ SamAddMultipleMembersToAlias()

NTSTATUS NTAPI SamAddMultipleMembersToAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID MemberIds,
IN ULONG  MemberCount 
)

Definition at line 266 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9423
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:462
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
struct _SAMPR_SID_INFORMATION * PSAMPR_SID_INFORMATION
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamChangePasswordUser()

NTSTATUS NTAPI SamChangePasswordUser ( IN SAM_HANDLE  UserHandle,
IN PUNICODE_STRING  OldPassword,
IN PUNICODE_STRING  NewPassword 
)

Definition at line 299 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define TRUE
Definition: types.h:120
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
#define ZeroMemory
Definition: winbase.h:1635
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 WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
Definition: crypt_lmhash.c:53
NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
STRING OEM_STRING
Definition: umtypes.h:203
char * LPSTR
Definition: xmlstorage.h:182
unsigned char * LPBYTE
Definition: typedefs.h:52
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned char BYTE
Definition: mem.h:68
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI SystemFunction012(const BYTE *in, const BYTE *key, LPBYTE out)
Definition: sysfunc.c:353
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamChangePasswordUser2()

NTSTATUS NTAPI SamChangePasswordUser2 ( IN PUNICODE_STRING  ServerName,
IN PUNICODE_STRING  UserName,
IN PUNICODE_STRING  OldPassword,
IN PUNICODE_STRING  NewPassword 
)

Definition at line 450 of file samlib.c.

454 {
456  return STATUS_NOT_IMPLEMENTED;
457 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ SamChangePasswordUser3()

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 at line 462 of file samlib.c.

468 {
470  return STATUS_NOT_IMPLEMENTED;
471 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ SamCloseHandle()

NTSTATUS NTAPI SamCloseHandle ( IN SAM_HANDLE  SamHandle)

Definition at line 476 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS __stdcall SamrCloseHandle(SAMPR_HANDLE *SamHandle)
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGetDisplayInformationIndex(), NetGroupAdd(), NetGroupAddUser(), NetGroupDel(), NetGroupDelUser(), NetGroupEnum(), NetGroupGetInfo(), NetGroupGetUsers(), NetGroupSetInfo(), NetGroupSetUsers(), NetLocalGroupAdd(), NetLocalGroupAddMembers(), NetLocalGroupDel(), NetLocalGroupDelMembers(), NetLocalGroupEnum(), NetLocalGroupGetInfo(), NetLocalGroupGetMembers(), NetLocalGroupSetInfo(), NetQueryDisplayInformation(), NetUserAdd(), NetUserDel(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), NetUserSetInfo(), SetAccountsDomainSid(), and SetAdministratorPassword().

◆ SamConnect()

NTSTATUS NTAPI SamConnect ( IN OUT PUNICODE_STRING ServerName  OPTIONAL,
OUT PSAM_HANDLE  ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN POBJECT_ATTRIBUTES  ObjectAttributes 
)

Definition at line 498 of file samlib.c.

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 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define RpcEndExcept
Definition: rpc.h:128
wchar_t * PSAMPR_SERVER_NAME
Definition: authpackage.c:112
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
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
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGetDisplayInformationIndex(), NetGroupAdd(), NetGroupAddUser(), NetGroupDel(), NetGroupDelUser(), NetGroupEnum(), NetGroupGetInfo(), NetGroupGetUsers(), NetGroupSetInfo(), NetGroupSetUsers(), NetLocalGroupAdd(), NetLocalGroupAddMembers(), NetLocalGroupDel(), NetLocalGroupDelMembers(), NetLocalGroupEnum(), NetLocalGroupGetInfo(), NetLocalGroupGetMembers(), NetLocalGroupSetInfo(), NetQueryDisplayInformation(), NetUserAdd(), NetUserDel(), NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), NetUserSetInfo(), SetAccountsDomainSid(), and SetAdministratorPassword().

◆ SamCreateAliasInDomain()

NTSTATUS NTAPI SamCreateAliasInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  AliasHandle,
OUT PULONG  RelativeId 
)

Definition at line 526 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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 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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupAdd().

◆ SamCreateGroupInDomain()

NTSTATUS NTAPI SamCreateGroupInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  GroupHandle,
OUT PULONG  RelativeId 
)

Definition at line 560 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
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
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupAdd().

◆ SamCreateUser2InDomain()

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 at line 594 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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 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
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetUserAdd().

◆ SamCreateUserInDomain()

NTSTATUS NTAPI SamCreateUserInDomain ( IN SAM_HANDLE  DomainHandle,
IN PUNICODE_STRING  AccountName,
IN ACCESS_MASK  DesiredAccess,
OUT PSAM_HANDLE  UserHandle,
OUT PULONG  RelativeId 
)

Definition at line 634 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamDeleteAlias()

NTSTATUS NTAPI SamDeleteAlias ( IN SAM_HANDLE  AliasHandle)

Definition at line 668 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI SamrDeleteAlias(IN OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:5316
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
void * SAMPR_HANDLE
Definition: authpackage.c:113
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupAdd(), and NetLocalGroupDel().

◆ SamDeleteGroup()

NTSTATUS NTAPI SamDeleteGroup ( IN SAM_HANDLE  GroupHandle)

Definition at line 696 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrDeleteGroup(IN OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:4628
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
void * SAMPR_HANDLE
Definition: authpackage.c:113
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupAdd(), and NetGroupDel().

◆ SamDeleteUser()

NTSTATUS NTAPI SamDeleteUser ( IN SAM_HANDLE  UserHandle)

Definition at line 724 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
NTSTATUS NTAPI SamrDeleteUser(IN OUT SAMPR_HANDLE *UserHandle)
Definition: samrpc.c:5576
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
void * SAMPR_HANDLE
Definition: authpackage.c:113
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetUserAdd(), and NetUserDel().

◆ SamEnumerateAliasesInDomain()

NTSTATUS NTAPI SamEnumerateAliasesInDomain ( IN SAM_HANDLE  DomainHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 752 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
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
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupEnum().

◆ SamEnumerateDomainsInSamServer()

NTSTATUS NTAPI SamEnumerateDomainsInSamServer ( IN SAM_HANDLE  ServerHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
OUT PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 802 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
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
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamEnumerateGroupsInDomain()

NTSTATUS NTAPI SamEnumerateGroupsInDomain ( IN SAM_HANDLE  DomainHandle,
IN OUT PSAM_ENUMERATE_HANDLE  EnumerationContext,
IN PVOID Buffer,
IN ULONG  PreferedMaximumLength,
OUT PULONG  CountReturned 
)

Definition at line 852 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#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
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupEnum().

◆ SamEnumerateUsersInDomain()

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 at line 897 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PSAMPR_RID_ENUMERATION Buffer
Definition: sam.idl:96
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
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

Referenced by NetUserEnum().

◆ SamFreeMemory()

◆ SamGetAliasMembership()

NTSTATUS NTAPI SamGetAliasMembership ( IN SAM_HANDLE  DomainHandle,
IN ULONG  PassedCount,
IN PSID Sids,
OUT PULONG  MembershipCount,
OUT PULONG Aliases 
)

Definition at line 958 of file samlib.c.

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 }
unsigned long * Element
Definition: lsasrv.h:86
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS __stdcall SamrGetAliasMembership(SAMPR_HANDLE DomainHandle, PSAMPR_PSID_ARRAY SidArray, PSAMPR_ULONG_ARRAY Membership)
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
unsigned long Count
Definition: lsasrv.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
PSAMPR_SID_INFORMATION Sids
Definition: authpackage.c:123
Status
Definition: gdiplustypes.h:24
unsigned long Count
Definition: authpackage.c:122
struct _SAMPR_SID_INFORMATION * PSAMPR_SID_INFORMATION
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by GetUserPrivileges(), and NetUserGetLocalGroups().

◆ SamGetCompatibilityMode()

NTSTATUS NTAPI SamGetCompatibilityMode ( IN SAM_HANDLE  ObjectHandle,
OUT PULONG  Mode 
)

Definition at line 1009 of file samlib.c.

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 }
_In_ ULONG Mode
Definition: hubbusif.h:303
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define SAM_SID_COMPATIBILITY_ALL
Definition: ntsam.h:700
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
return STATUS_SUCCESS
Definition: btrfs.c:2745

◆ SamGetDisplayEnumerationIndex()

NTSTATUS NTAPI SamGetDisplayEnumerationIndex ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_DISPLAY_INFORMATION  DisplayInformation,
IN PUNICODE_STRING  Prefix,
OUT PULONG  Index 
)

Definition at line 1025 of file samlib.c.

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 }
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
#define RpcEndExcept
Definition: rpc.h:128
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1631
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
static const UCHAR Index[8]
Definition: usbohci.c:18
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGetDisplayInformationIndex().

◆ SamGetGroupsForUser()

NTSTATUS NTAPI SamGetGroupsForUser ( IN SAM_HANDLE  UserHandle,
OUT PGROUP_MEMBERSHIP Groups,
OUT PULONG  MembershipCount 
)

Definition at line 1058 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrGetGroupsForUser(IN SAMPR_HANDLE UserHandle, OUT PSAMPR_GET_GROUPS_BUFFER *Groups)
Definition: samrpc.c:8605
TOpcodeData Groups[17][8]
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
PGROUP_MEMBERSHIP Groups
Definition: sam.idl:116
unsigned long MembershipCount
Definition: sam.idl:115
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by GetUserPrivileges(), and NetUserGetGroups().

◆ SamGetMembersInAlias()

NTSTATUS NTAPI SamGetMembersInAlias ( IN SAM_HANDLE  AliasHandle,
OUT PSID **  MemberIds,
OUT PULONG  MemberCount 
)

Definition at line 1102 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS NTAPI SamrGetMembersInAlias(IN SAMPR_HANDLE AliasHandle, OUT PSAMPR_PSID_ARRAY_OUT Members)
Definition: samrpc.c:5454
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long Count
Definition: sam.idl:55
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PSAMPR_SID_INFORMATION Sids
Definition: sam.idl:56
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupGetMembers().

◆ SamGetMembersInGroup()

NTSTATUS NTAPI SamGetMembersInGroup ( IN SAM_HANDLE  GroupHandle,
OUT PULONG MemberIds,
OUT PULONG Attributes,
OUT PULONG  MemberCount 
)

Definition at line 1144 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrGetMembersInGroup(IN SAMPR_HANDLE GroupHandle, OUT PSAMPR_GET_MEMBERS_BUFFER *Members)
Definition: samrpc.c:4758
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
unsigned long * Members
Definition: sam.idl:122
unsigned long * Attributes
Definition: sam.idl:123
unsigned long MemberCount
Definition: sam.idl:121
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupGetUsers(), and NetGroupSetUsers().

◆ SamLookupDomainInSamServer()

NTSTATUS NTAPI SamLookupDomainInSamServer ( IN SAM_HANDLE  ServerHandle,
IN PUNICODE_STRING  Name,
OUT PSID DomainId 
)

Definition at line 1193 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrLookupDomainInSamServer(IN SAMPR_HANDLE ServerHandle, IN PRPC_UNICODE_STRING Name, OUT PRPC_SID *DomainId)
Definition: samrpc.c:497
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamLookupIdsInDomain()

NTSTATUS NTAPI SamLookupIdsInDomain ( IN SAM_HANDLE  DomainHandle,
IN ULONG  Count,
IN PULONG  RelativeIds,
OUT PUNICODE_STRING Names,
OUT PSID_NAME_USE *Use  OPTIONAL 
)

Definition at line 1220 of file samlib.c.

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 }
unsigned long * Element
Definition: lsasrv.h:86
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
enum _SID_NAME_USE SID_NAME_USE
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
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 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
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PRPC_UNICODE_STRING Element
Definition: lookup.c:22
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: samlib.c:59
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
unsigned short Length
Definition: msv1_0.h:53
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
unsigned short MaximumLength
Definition: msv1_0.h:54
#define RpcExcept(expr)
Definition: rpc.h:127
wchar_t * Buffer
Definition: msv1_0.h:55
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupGetUsers(), and NetUserGetLocalGroups().

◆ SamLookupNamesInDomain()

NTSTATUS NTAPI SamLookupNamesInDomain ( IN SAM_HANDLE  DomainHandle,
IN ULONG  Count,
IN PUNICODE_STRING  Names,
OUT PULONG RelativeIds,
OUT PSID_NAME_USE Use 
)

Definition at line 1335 of file samlib.c.

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 }
unsigned long * Element
Definition: lsasrv.h:86
PWSTR Names[NAMES_COUNT]
#define RpcEndExcept
Definition: rpc.h:128
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
enum _SID_NAME_USE SID_NAME_USE
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
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
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: samlib.c:59
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupAddUser(), NetGroupDelUser(), NetGroupSetUsers(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), OpenAliasByName(), OpenGroupByName(), and OpenUserByName().

◆ SamOpenAlias()

NTSTATUS NTAPI SamOpenAlias ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  AliasId,
OUT PSAM_HANDLE  AliasHandle 
)

Definition at line 1412 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrOpenAlias(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG AliasId, OUT SAMPR_HANDLE *AliasHandle)
Definition: samrpc.c:4915
Status
Definition: gdiplustypes.h:24
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupEnum(), and OpenAliasByName().

◆ SamOpenDomain()

NTSTATUS NTAPI SamOpenDomain ( IN SAM_HANDLE  ServerHandle,
IN ACCESS_MASK  DesiredAccess,
IN PSID  DomainId,
OUT PSAM_HANDLE  DomainHandle 
)

Definition at line 1441 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS __stdcall SamrOpenDomain(SAMPR_HANDLE ServerHandle, ACCESS_MASK DesiredAccess, PRPC_SID DomainId, SAMPR_HANDLE *DomainHandle)
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), NetUserGetLocalGroups(), NetUserModalsGet(), OpenAccountDomain(), OpenBuiltinDomain(), SetAccountsDomainSid(), and SetAdministratorPassword().

◆ SamOpenGroup()

NTSTATUS NTAPI SamOpenGroup ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  GroupId,
OUT PSAM_HANDLE  GroupHandle 
)

Definition at line 1470 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrOpenGroup(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN unsigned long GroupId, OUT SAMPR_HANDLE *GroupHandle)
Definition: samrpc.c:4072
Status
Definition: gdiplustypes.h:24
_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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupEnum(), and OpenGroupByName().

◆ SamOpenUser()

NTSTATUS NTAPI SamOpenUser ( IN SAM_HANDLE  DomainHandle,
IN ACCESS_MASK  DesiredAccess,
IN ULONG  UserId,
OUT PSAM_HANDLE  UserHandle 
)

Definition at line 1499 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_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 NTAPI SamrOpenUser(IN SAMPR_HANDLE DomainHandle, IN ACCESS_MASK DesiredAccess, IN ULONG UserId, OUT SAMPR_HANDLE *UserHandle)
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetUserEnum(), NetUserGetGroups(), NetUserGetInfo(), OpenUserByName(), and SetAdministratorPassword().

◆ SampCheckPassword()

NTSTATUS SampCheckPassword ( IN SAMPR_HANDLE  UserHandle,
IN PUNICODE_STRING  Password 
)

Definition at line 127 of file samlib.c.

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 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
#define C1_LOWER
Definition: unicode.h:32
#define STATUS_PASSWORD_RESTRICTION
Definition: ntstatus.h:330
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
#define DOMAIN_PASSWORD_COMPLEX
Definition: ntsam.h:254
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI SamrGetUserDomainPasswordInformation(IN SAMPR_HANDLE UserHandle, OUT PUSER_DOMAIN_PASSWORD_INFORMATION PasswordInformation)
Definition: samrpc.c:8755
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: samlib.c:59
#define TRACE(s)
Definition: solgame.cpp:4
#define C1_ALPHA
Definition: unicode.h:39
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: lang.c:1699
#define C1_DIGIT
Definition: unicode.h:33
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
unsigned short WORD
Definition: ntddk_ex.h:93
#define CT_CTYPE1
Definition: winnls.h:234
#define C1_PUNCT
Definition: unicode.h:35
#define C1_UPPER
Definition: unicode.h:31
Status
Definition: gdiplustypes.h:24
uint16_t * LPWORD
Definition: typedefs.h:54
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by SamSetInformationUser().

◆ SamQueryDisplayInformation()

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 at line 1528 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
SAMPR_DOMAIN_DISPLAY_MACHINE_BUFFER MachineInformation
Definition: sam.idl:366
LONG NTSTATUS
Definition: precomp.h:26
PSAMPR_DOMAIN_DISPLAY_OEM_USER Buffer
Definition: sam.idl:354
SAMPR_DOMAIN_DISPLAY_GROUP_BUFFER GroupInformation
Definition: sam.idl:367
SAMPR_DOMAIN_DISPLAY_OEM_GROUP_BUFFER OemGroupInformation
Definition: sam.idl:369
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
PSAMPR_DOMAIN_DISPLAY_OEM_GROUP Buffer
Definition: sam.idl:360
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const UCHAR Index[8]
Definition: usbohci.c:18
SAMPR_DOMAIN_DISPLAY_OEM_USER_BUFFER OemUserInformation
Definition: sam.idl:368
PSAMPR_DOMAIN_DISPLAY_GROUP Buffer
Definition: sam.idl:348
SAMPR_DOMAIN_DISPLAY_USER_BUFFER UserInformation
Definition: sam.idl:365
Status
Definition: gdiplustypes.h:24
PSAMPR_DOMAIN_DISPLAY_MACHINE Buffer
Definition: sam.idl:342
PSAMPR_DOMAIN_DISPLAY_USER Buffer
Definition: sam.idl:336
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
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetQueryDisplayInformation().

◆ SamQueryInformationAlias()

NTSTATUS NTAPI SamQueryInformationAlias ( IN SAM_HANDLE  AliasHandle,
IN ALIAS_INFORMATION_CLASS  AliasInformationClass,
OUT PVOID Buffer 
)

Definition at line 1614 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
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
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupEnum(), and NetLocalGroupGetInfo().

◆ SamQueryInformationDomain()

NTSTATUS NTAPI SamQueryInformationDomain ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_INFORMATION_CLASS  DomainInformationClass,
OUT PVOID Buffer 
)

Definition at line 1641 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS NTAPI SamrQueryInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, OUT PSAMPR_DOMAIN_INFO_BUFFER *Buffer)
Definition: samrpc.c:1608
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetUserModalsGet().

◆ SamQueryInformationGroup()

NTSTATUS NTAPI SamQueryInformationGroup ( IN SAM_HANDLE  GroupHandle,
IN GROUP_INFORMATION_CLASS  GroupInformationClass,
OUT PVOID Buffer 
)

Definition at line 1668 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrQueryInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, OUT PSAMPR_GROUP_INFO_BUFFER *Buffer)
Definition: samrpc.c:4346
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupEnum(), and NetGroupGetInfo().

◆ SamQueryInformationUser()

NTSTATUS NTAPI SamQueryInformationUser ( IN SAM_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
OUT PVOID Buffer 
)

Definition at line 1695 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, OUT PSAMPR_USER_INFO_BUFFER *Buffer)
Definition: samrpc.c:7328
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by BuildUserInfoBuffer(), and SetAdministratorPassword().

◆ SamQuerySecurityObject()

NTSTATUS NTAPI SamQuerySecurityObject ( IN SAM_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
OUT PSECURITY_DESCRIPTOR SecurityDescriptor 
)

Definition at line 1722 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
_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
LONG NTSTATUS
Definition: precomp.h:26
unsigned long Length
Definition: msv1_0.h:76
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char * SecurityDescriptor
Definition: msv1_0.h:77
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: samlib.c:65
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamrQuerySecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, OUT PSAMPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
Definition: samrpc.c:328
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by GetUserDacl().

◆ SamRemoveMemberFromAlias()

NTSTATUS NTAPI SamRemoveMemberFromAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID  MemberId 
)

Definition at line 1764 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamrRemoveMemberFromAlias(IN SAMPR_HANDLE AliasHandle, IN PRPC_SID MemberId)
Definition: samrpc.c:5414
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupDelMembers().

◆ SamRemoveMemberFromForeignDomain()

NTSTATUS NTAPI SamRemoveMemberFromForeignDomain ( IN SAM_HANDLE  DomainHandle,
IN PSID  MemberId 
)

Definition at line 1789 of file samlib.c.

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 }
NTSTATUS NTAPI SamrRemoveMemberFromForeignDomain(IN SAMPR_HANDLE DomainHandle, IN PRPC_SID MemberSid)
Definition: samrpc.c:8843
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamRemoveMemberFromGroup()

NTSTATUS NTAPI SamRemoveMemberFromGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId 
)

Definition at line 1814 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrRemoveMemberFromGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId)
Definition: samrpc.c:4696
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupDelUser(), and NetGroupSetUsers().

◆ SamRemoveMultipleMembersFromAlias()

NTSTATUS NTAPI SamRemoveMultipleMembersFromAlias ( IN SAM_HANDLE  AliasHandle,
IN PSID MemberIds,
IN ULONG  MemberCount 
)

Definition at line 1839 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:462
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrRemoveMultipleMembersFromAlias(IN SAMPR_HANDLE AliasHandle, IN PSAMPR_PSID_ARRAY MembersBuffer)
Definition: samrpc.c:9451
Status
Definition: gdiplustypes.h:24
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
struct _SAMPR_SID_INFORMATION * PSAMPR_SID_INFORMATION
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamRidToSid()

NTSTATUS NTAPI SamRidToSid ( IN SAM_HANDLE  ObjectHandle,
IN ULONG  Rid,
OUT PSID Sid 
)

Definition at line 1872 of file samlib.c.

1875 {
1876  UNIMPLEMENTED;
1877  return STATUS_NOT_IMPLEMENTED;
1878 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ SamSetInformationAlias()

NTSTATUS NTAPI SamSetInformationAlias ( IN SAM_HANDLE  AliasHandle,
IN ALIAS_INFORMATION_CLASS  AliasInformationClass,
IN PVOID  Buffer 
)

Definition at line 1883 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamrSetInformationAlias(IN SAMPR_HANDLE AliasHandle, IN ALIAS_INFORMATION_CLASS AliasInformationClass, IN PSAMPR_ALIAS_INFO_BUFFER Buffer)
Definition: samrpc.c:5267
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetLocalGroupAdd(), and NetLocalGroupSetInfo().

◆ SamSetInformationDomain()

NTSTATUS NTAPI SamSetInformationDomain ( IN SAM_HANDLE  DomainHandle,
IN DOMAIN_INFORMATION_CLASS  DomainInformationClass,
IN PVOID  Buffer 
)

Definition at line 1910 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI SamrSetInformationDomain(IN SAMPR_HANDLE DomainHandle, IN DOMAIN_INFORMATION_CLASS DomainInformationClass, IN PSAMPR_DOMAIN_INFO_BUFFER DomainInformation)
Definition: samrpc.c:1893
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by SetAccountsDomainSid().

◆ SamSetInformationGroup()

NTSTATUS NTAPI SamSetInformationGroup ( IN SAM_HANDLE  GroupHandle,
IN GROUP_INFORMATION_CLASS  GroupInformationClass,
IN PVOID  Buffer 
)

Definition at line 1937 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SamrSetInformationGroup(IN SAMPR_HANDLE GroupHandle, IN GROUP_INFORMATION_CLASS GroupInformationClass, IN PSAMPR_GROUP_INFO_BUFFER Buffer)
Definition: samrpc.c:4510
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupAdd(), and NetGroupSetInfo().

◆ SamSetInformationUser()

NTSTATUS NTAPI SamSetInformationUser ( IN SAM_HANDLE  UserHandle,
IN USER_INFORMATION_CLASS  UserInformationClass,
IN PVOID  Buffer 
)

Definition at line 1964 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN LmPasswordPresent
Definition: ntsam.h:687
#define ZeroMemory
Definition: winbase.h:1635
NTSTATUS WINAPI SystemFunction006(LPCSTR password, LPSTR hash)
Definition: crypt_lmhash.c:53
NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
STRING OEM_STRING
Definition: umtypes.h:203
char * LPSTR
Definition: xmlstorage.h:182
UNICODE_STRING LmPassword
Definition: ntsam.h:674
#define USER_ALL_OWFPASSWORD
Definition: ntsam.h:225
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_LM_OWF_PASSWORD
unsigned char * LPBYTE
Definition: typedefs.h:52
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
RPC_UNICODE_STRING Password
Definition: sam.idl:629
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword
Definition: sam.idl:640
#define USER_ALL_NTPASSWORDPRESENT
Definition: ntsam.h:220
BOOLEAN NtPasswordPresent
Definition: ntsam.h:688
Status
Definition: gdiplustypes.h:24
struct _SAMPR_USER_SET_PASSWORD_INFORMATION * PSAMPR_USER_SET_PASSWORD_INFORMATION
ENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword
Definition: sam.idl:641
NTSTATUS NTAPI SamrSetInformationUser(IN SAMPR_HANDLE UserHandle, IN USER_INFORMATION_CLASS UserInformationClass, IN PSAMPR_USER_INFO_BUFFER Buffer)
Definition: samrpc.c:8119
#define USER_ALL_LMPASSWORDPRESENT
Definition: ntsam.h:221
struct _ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD
NTSTATUS SampCheckPassword(IN SAMPR_HANDLE UserHandle, IN PUNICODE_STRING Password)
Definition: samlib.c:127
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UNICODE_STRING NtPassword
Definition: ntsam.h:675
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by SetAdministratorPassword(), and SetUserInfo().

◆ SamSetMemberAttributesOfGroup()

NTSTATUS NTAPI SamSetMemberAttributesOfGroup ( IN SAM_HANDLE  GroupHandle,
IN ULONG  MemberId,
IN ULONG  Attributes 
)

Definition at line 2169 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS NTAPI SamrSetMemberAttributesOfGroup(IN SAMPR_HANDLE GroupHandle, IN unsigned long MemberId, IN unsigned long Attributes)
Definition: samrpc.c:4872
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

Referenced by NetGroupSetUsers().

◆ SamSetSecurityObject()

NTSTATUS NTAPI SamSetSecurityObject ( IN SAM_HANDLE  ObjectHandle,
IN SECURITY_INFORMATION  SecurityInformation,
IN PSECURITY_DESCRIPTOR  SecurityDescriptor 
)

Definition at line 2196 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_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
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
unsigned long Length
Definition: msv1_0.h:76
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char * SecurityDescriptor
Definition: msv1_0.h:77
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI SamrSetSecurityObject(IN SAMPR_HANDLE ObjectHandle, IN SECURITY_INFORMATION SecurityInformation, IN PSAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
Definition: samrpc.c:191
unsigned int ULONG
Definition: retypes.h:1
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
NTSYSAPI NTSTATUS NTAPI RtlMakeSelfRelativeSD(_In_ PSECURITY_DESCRIPTOR AbsoluteSD, _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Inout_ PULONG BufferLength)
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamShutdownSamServer()

NTSTATUS NTAPI SamShutdownSamServer ( IN SAM_HANDLE  ServerHandle)

Definition at line 2251 of file samlib.c.

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 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS NTAPI SamrShutdownSamServer(IN SAMPR_HANDLE ServerHandle)
Definition: samrpc.c:465
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:741

◆ SamTestPrivateFunctionsDomain()

NTSTATUS NTAPI SamTestPrivateFunctionsDomain ( _In_ SAM_HANDLE  DomainHandle)

Definition at line 2273 of file samlib.c.

2275 {
2276  TRACE("SamTestPrivateFunctionsDomain(%p)\n",
2277  DomainHandle);
2278  return STATUS_NOT_IMPLEMENTED;
2279 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define TRACE(s)
Definition: solgame.cpp:4

◆ SamTestPrivateFunctionsUser()

NTSTATUS NTAPI SamTestPrivateFunctionsUser ( _In_ SAM_HANDLE  UserHandle)

Definition at line 2284 of file samlib.c.

2286 {
2287  TRACE("SamTestPrivateFunctionsUser(%p)\n",
2288  UserHandle);
2289  return STATUS_NOT_IMPLEMENTED;
2290 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define TRACE(s)
Definition: solgame.cpp:4

◆ SystemFunction006()

NTSTATUS WINAPI SystemFunction006 ( LPCSTR  password,
LPSTR  hash 
)

Definition at line 53 of file crypt_lmhash.c.

54 {
55  CRYPT_LMhash( (unsigned char*)hash, (const unsigned char*)password, strlen(password) );
56 
57  return STATUS_SUCCESS;
58 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void CRYPT_LMhash(unsigned char *dst, const unsigned char *pwd, const int len)
Definition: crypt_lmhash.c:39
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
return STATUS_SUCCESS
Definition: btrfs.c:2745
Definition: _hash_fun.h:40

Referenced by SamChangePasswordUser(), and SamSetInformationUser().

◆ SystemFunction007()

NTSTATUS WINAPI SystemFunction007 ( PUNICODE_STRING  string,
LPBYTE  hash 
)

◆ SystemFunction012()

NTSTATUS WINAPI SystemFunction012 ( const BYTE in,
const BYTE key,
LPBYTE  out 
)

Definition at line 353 of file sysfunc.c.

354 {
355  if (!in || !out)
356  return STATUS_UNSUCCESSFUL;
357 
358  CRYPT_DEShash(out, key, in);
359  CRYPT_DEShash(out+8, key+7, in+8);
360  return STATUS_SUCCESS;
361 }
static FILE * out
Definition: regtests2xml.c:44
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
GLuint in
Definition: glext.h:9616
unsigned char * CRYPT_DEShash(unsigned char *dst, const unsigned char *key, const unsigned char *src) DECLSPEC_HIDDEN
Definition: crypt_des.c:259
return STATUS_SUCCESS
Definition: btrfs.c:2745
Definition: path.c:42

Referenced by MsvpChangePassword(), and SamChangePasswordUser().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( samlib  )