Implement SamRemoveMemberFromAlias, SamRemoveMemberFromForeignDomain, SamRemoveMemberFromGroup and
SamRemoveMultipleMembersFromAlias.

svn path=/trunk/; revision=57594
This commit is contained in:
Eric Kohl 2012-10-22 20:43:04 +00:00
parent be26053908
commit 77520445a8
3 changed files with 129 additions and 5 deletions

View file

@ -171,7 +171,7 @@ SamAddMultipleMembersToAlias(IN SAM_HANDLE AliasHandle,
return STATUS_INVALID_PARAMETER_2;
Buffer.Count = MemberCount;
Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
RpcTryExcept
{
@ -1330,6 +1330,114 @@ SamQuerySecurityObject(IN SAM_HANDLE ObjectHandle,
}
NTSTATUS
NTAPI
SamRemoveMemberFromAlias(IN SAM_HANDLE AliasHandle,
IN PSID MemberId)
{
NTSTATUS Status;
TRACE("SamRemoveMemberFromAlias(%p %ul)\n",
AliasHandle, MemberId);
RpcTryExcept
{
Status = SamrRemoveMemberFromAlias((SAMPR_HANDLE)AliasHandle,
MemberId);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return Status;
}
NTSTATUS
NTAPI
SamRemoveMemberFromForeignDomain(IN SAM_HANDLE DomainHandle,
IN PSID MemberId)
{
NTSTATUS Status;
TRACE("SamRemoveMemberFromForeignDomain(%p %ul)\n",
DomainHandle, MemberId);
RpcTryExcept
{
Status = SamrRemoveMemberFromForeignDomain((SAMPR_HANDLE)DomainHandle,
MemberId);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return Status;
}
NTSTATUS
NTAPI
SamRemoveMemberFromGroup(IN SAM_HANDLE GroupHandle,
IN ULONG MemberId)
{
NTSTATUS Status;
TRACE("SamRemoveMemberFromGroup(%p %ul)\n",
GroupHandle, MemberId);
RpcTryExcept
{
Status = SamrRemoveMemberFromGroup((SAMPR_HANDLE)GroupHandle,
MemberId);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return Status;
}
NTSTATUS
NTAPI
SamRemoveMultipleMembersFromAlias(IN SAM_HANDLE AliasHandle,
IN PSID *MemberIds,
IN ULONG MemberCount)
{
SAMPR_PSID_ARRAY Buffer;
NTSTATUS Status;
TRACE("SamRemoveMultipleMembersFromAlias(%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 = SamrRemoveMultipleMembersFromAlias((SAMPR_HANDLE)AliasHandle,
&Buffer);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return Status;
}
NTSTATUS
NTAPI
SamRidToSid(IN SAM_HANDLE ObjectHandle,

View file

@ -38,10 +38,10 @@
@ stdcall SamQueryInformationGroup(ptr long ptr)
@ stdcall SamQueryInformationUser(ptr long ptr)
@ stdcall SamQuerySecurityObject(ptr long ptr)
@ stub SamRemoveMemberFromAlias
@ stub SamRemoveMemberFromForeignDomain
@ stub SamRemoveMemberFromGroup
@ stub SamRemoveMultipleMembersFromAlias
@ stdcall SamRemoveMemberFromAlias(ptr long)
@ stdcall SamRemoveMemberFromForeignDomain(ptr long)
@ stdcall SamRemoveMemberFromGroup(ptr long)
@ stdcall SamRemoveMultipleMembersFromAlias(ptr ptr long)
@ stdcall SamRidToSid(ptr long ptr)
@ stdcall SamSetInformationAlias(ptr long ptr)
@ stdcall SamSetInformationDomain(ptr long ptr)

View file

@ -540,6 +540,22 @@ 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,