mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[SAMLIB]
Implement SamAddMemberToGroup, SamAddMultipleMembersToAlias and SamDeleteUser. svn path=/trunk/; revision=57586
This commit is contained in:
parent
0ffc17d4a2
commit
5563b4393e
3 changed files with 101 additions and 3 deletions
|
@ -128,6 +128,66 @@ SamAddMemberToAlias(IN SAM_HANDLE AliasHandle,
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamAddMemberToGroup(IN SAM_HANDLE GroupHandle,
|
||||
IN ULONG MemberId,
|
||||
IN ULONG Attributes)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("SamAddMemberToGroup(%p %lu %lx)",
|
||||
GroupHandle, MemberId, Attributes);
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
Status = SamrAddMemberToGroup((SAMPR_HANDLE)GroupHandle,
|
||||
MemberId,
|
||||
Attributes);
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamAddMultipleMembersToAlias(IN SAM_HANDLE AliasHandle,
|
||||
IN PSID *MemberIds,
|
||||
IN ULONG MemberCount)
|
||||
{
|
||||
SAMPR_PSID_ARRAY Buffer;
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("SamAddMultipleMembersToAlias(%p %p %lu)\n",
|
||||
AliasHandle, MemberIds, MemberCount);
|
||||
|
||||
if (MemberIds == NULL)
|
||||
return STATUS_INVALID_PARAMETER_2;
|
||||
|
||||
Buffer.Count = MemberCount;
|
||||
Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
Status = SamrAddMultipleMembersToAlias((SAMPR_HANDLE)AliasHandle,
|
||||
&Buffer);
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamCloseHandle(IN SAM_HANDLE SamHandle)
|
||||
|
@ -320,6 +380,34 @@ SamCreateUserInDomain(IN SAM_HANDLE DomainHandle,
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamDeleteUser(IN SAM_HANDLE UserHandle)
|
||||
{
|
||||
SAMPR_HANDLE LocalUserHandle;
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("SamDeleteUser(%p)\n", UserHandle);
|
||||
|
||||
LocalUserHandle = (SAMPR_HANDLE)UserHandle;
|
||||
|
||||
if (LocalUserHandle == NULL)
|
||||
return STATUS_INVALID_HANDLE;
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
Status = SamrDeleteUser(&LocalUserHandle);
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamEnumerateAliasesInDomain(IN SAM_HANDLE DomainHandle,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@ stdcall SamAddMemberToAlias(ptr ptr)
|
||||
@ stub SamAddMemberToGroup
|
||||
@ stub SamAddMultipleMembersToAlias
|
||||
@ stdcall SamAddMemberToGroup(ptr long long)
|
||||
@ stdcall SamAddMultipleMembersToAlias(ptr ptr long)
|
||||
@ stub SamChangePasswordUser2
|
||||
@ stub SamChangePasswordUser3
|
||||
@ stub SamChangePasswordUser
|
||||
|
@ -13,7 +13,7 @@
|
|||
@ stdcall SamCreateUserInDomain(ptr ptr long ptr ptr)
|
||||
@ stub SamDeleteAlias
|
||||
@ stub SamDeleteGroup
|
||||
@ stub SamDeleteUser
|
||||
@ stdcall SamDeleteUser(ptr)
|
||||
@ stdcall SamEnumerateAliasesInDomain(ptr ptr ptr long ptr)
|
||||
@ stdcall SamEnumerateDomainsInSamServer(ptr ptr ptr long ptr)
|
||||
@ stdcall SamEnumerateGroupsInDomain(ptr ptr ptr long ptr)
|
||||
|
|
|
@ -322,6 +322,12 @@ 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
|
||||
SamCloseHandle(IN SAM_HANDLE SamHandle);
|
||||
|
@ -367,6 +373,10 @@ SamCreateUserInDomain(IN SAM_HANDLE DomainHandle,
|
|||
OUT PSAM_HANDLE UserHandle,
|
||||
OUT PULONG RelativeId);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamDeleteUser(IN SAM_HANDLE UserHandle);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SamEnumerateAliasesInDomain(IN SAM_HANDLE DomainHandle,
|
||||
|
|
Loading…
Reference in a new issue