Author: ekohl
Date: Mon Oct 22 20:43:04 2012
New Revision: 57594
URL:
http://svn.reactos.org/svn/reactos?rev=57594&view=rev
Log:
[SAMLIB]
Implement SamRemoveMemberFromAlias, SamRemoveMemberFromForeignDomain,
SamRemoveMemberFromGroup and
SamRemoveMultipleMembersFromAlias.
Modified:
trunk/reactos/dll/win32/samlib/samlib.c
trunk/reactos/dll/win32/samlib/samlib.spec
trunk/reactos/include/ddk/ntsam.h
Modified: trunk/reactos/dll/win32/samlib/samlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.c?…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] Mon Oct 22 20:43:04 2012
@@ -171,7 +171,7 @@
return STATUS_INVALID_PARAMETER_2;
Buffer.Count = MemberCount;
- Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
+ Buffer.Sids = (PSAMPR_SID_INFORMATION)MemberIds;
RpcTryExcept
{
@@ -1332,6 +1332,114 @@
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,
IN ULONG Rid,
OUT PSID *Sid)
Modified: trunk/reactos/dll/win32/samlib/samlib.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.sp…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.spec [iso-8859-1] Mon Oct 22 20:43:04 2012
@@ -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)
Modified: trunk/reactos/include/ddk/ntsam.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntsam.h?rev=57…
==============================================================================
--- trunk/reactos/include/ddk/ntsam.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntsam.h [iso-8859-1] Mon Oct 22 20:43:04 2012
@@ -542,6 +542,22 @@
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);