Author: ekohl
Date: Sat Jun 23 10:23:08 2012
New Revision: 56785
URL:
http://svn.reactos.org/svn/reactos?rev=56785&view=rev
Log:
[SAMLIB]
- Implement SamGetAliasMembership, SamQueryInformationAlias and SamSetInformationAlias.
- Add stub SamLookupNamesInDomain.
[SAMSRV]
- Implement SamrGetAliasMembership and SamrSetInformationAlias.
- Add stub for SamrQueryInformationAlias.
- SamrCreateAliasInDomain and SAM setup code: Set the description attribute for aliases.
Modified:
trunk/reactos/dll/win32/samlib/samlib.c
trunk/reactos/dll/win32/samlib/samlib.spec
trunk/reactos/dll/win32/samsrv/samrpc.c
trunk/reactos/dll/win32/samsrv/setup.c
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] Sat Jun 23 10:23:08 2012
@@ -353,6 +353,57 @@
NTSTATUS
NTAPI
+SamGetAliasMembership(IN SAM_HANDLE DomainHandle,
+ IN ULONG PassedCount,
+ IN PSID *Sids,
+ OUT PULONG MembershipCount,
+ OUT PULONG *Aliases)
+{
+ SAMPR_PSID_ARRAY SidArray;
+ SAMPR_ULONG_ARRAY Membership;
+ NTSTATUS Status;
+
+ TRACE("SamAliasMembership(%p %ul %p %p %p)\n",
+ DomainHandle, PassedCount, Sids, MembershipCount, Aliases);
+
+ if (Sids == NULL ||
+ MembershipCount == NULL ||
+ Aliases == NULL)
+ return STATUS_INVALID_PARAMETER;
+
+ Membership.Element = NULL;
+
+ RpcTryExcept
+ {
+ SidArray.Count = PassedCount;
+ SidArray.Sids = (PSAMPR_SID_INFORMATION)Sids;
+
+ Status = SamrGetAliasMembership((SAMPR_HANDLE)DomainHandle,
+ &SidArray,
+ &Membership);
+ if (NT_SUCCESS(Status))
+ {
+ *MembershipCount = Membership.Count;
+ *Aliases = Membership.Element;
+ }
+ else
+ {
+ if (Membership.Element != NULL)
+ midl_user_free(Membership.Element);
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
SamGetMembersInAlias(IN SAM_HANDLE AliasHandle,
OUT PSID **MemberIds,
OUT PULONG MemberCount)
@@ -379,7 +430,7 @@
if (NT_SUCCESS(Status))
{
*MemberCount = SidArray.Count;
- *MemberIds = (PSID *)(SidArray.Sids);
+ *MemberIds = (PSID *)SidArray.Sids;
}
}
@@ -417,6 +468,19 @@
RpcEndExcept;
return Status;
+}
+
+
+NTSTATUS
+NTAPI
+SamLookupNamesInDomain(IN SAM_HANDLE DomainHandle,
+ IN ULONG Count,
+ IN PUNICODE_STRING Names,
+ OUT PULONG *RelativeIds,
+ OUT PSID_NAME_USE *Use)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
}
@@ -509,6 +573,33 @@
NTSTATUS
NTAPI
+SamQueryInformationAlias(IN SAM_HANDLE AliasHandle,
+ IN ALIAS_INFORMATION_CLASS AliasInformationClass,
+ OUT PVOID *Buffer)
+{
+ NTSTATUS Status;
+
+ TRACE("SamQueryInformationAlias(%p %lu %p)\n",
+ AliasHandle, AliasInformationClass, Buffer);
+
+ RpcTryExcept
+ {
+ Status = SamrQueryInformationAlias((SAMPR_HANDLE)AliasHandle,
+ AliasInformationClass,
+ (PSAMPR_ALIAS_INFO_BUFFER *)Buffer);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
SamQueryInformationDomain(IN SAM_HANDLE DomainHandle,
IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
OUT PVOID *Buffer)
@@ -563,6 +654,33 @@
NTSTATUS
NTAPI
+SamSetInformationAlias(IN SAM_HANDLE AliasHandle,
+ IN ALIAS_INFORMATION_CLASS AliasInformationClass,
+ IN PVOID Buffer)
+{
+ NTSTATUS Status;
+
+ TRACE("SamSetInformationAlias(%p %lu %p)\n",
+ AliasHandle, AliasInformationClass, Buffer);
+
+ RpcTryExcept
+ {
+ Status = SamrSetInformationAlias((SAMPR_HANDLE)AliasHandle,
+ AliasInformationClass,
+ Buffer);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
SamSetInformationDomain(IN SAM_HANDLE DomainHandle,
IN DOMAIN_INFORMATION_CLASS DomainInformationClass,
IN PVOID DomainInformation)
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] Sat Jun 23 10:23:08 2012
@@ -19,7 +19,7 @@
@ stub SamEnumerateGroupsInDomain
@ stub SamEnumerateUsersInDomain
@ stdcall SamFreeMemory(ptr)
-@ stub SamGetAliasMembership
+@ stdcall SamGetAliasMembership(ptr long ptr ptr ptr)
@ stub SamGetCompatibilityMode
@ stub SamGetDisplayEnumerationIndex
@ stub SamGetGroupsForUser
@@ -27,13 +27,13 @@
@ stub SamGetMembersInGroup
@ stdcall SamLookupDomainInSamServer(ptr ptr ptr)
@ stub SamLookupIdsInDomain
-@ stub SamLookupNamesInDomain
+@ stdcall SamLookupNamesInDomain(ptr long ptr ptr ptr)
@ stdcall SamOpenAlias(ptr long long ptr)
@ stdcall SamOpenDomain(ptr long ptr ptr)
@ stub SamOpenGroup
@ stdcall SamOpenUser(ptr long long ptr)
@ stub SamQueryDisplayInformation
-@ stub SamQueryInformationAlias
+@ stdcall SamQueryInformationAlias(ptr long ptr)
@ stdcall SamQueryInformationDomain(ptr long ptr)
@ stub SamQueryInformationGroup
@ stdcall SamQueryInformationUser(ptr long ptr)
@@ -43,7 +43,7 @@
@ stub SamRemoveMemberFromGroup
@ stub SamRemoveMultipleMembersFromAlias
@ stub SamRidToSid
-@ stub SamSetInformationAlias
+@ stdcall SamSetInformationAlias(ptr long ptr)
@ stdcall SamSetInformationDomain(ptr long ptr)
@ stub SamSetInformationGroup
@ stdcall SamSetInformationUser(ptr long ptr)
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sat Jun 23 10:23:08 2012
@@ -853,6 +853,7 @@
{
PSAM_DB_OBJECT DomainObject;
PSAM_DB_OBJECT AliasObject;
+ UNICODE_STRING EmptyString = RTL_CONSTANT_STRING(L"");
ULONG ulSize;
ULONG ulRid;
WCHAR szRid[9];
@@ -941,7 +942,17 @@
return Status;
}
- /* FIXME: Set default alias attributes */
+ /* Set the Description attribute */
+ Status = SampSetObjectAttribute(AliasObject,
+ L"Description",
+ REG_SZ,
+ EmptyString.Buffer,
+ EmptyString.MaximumLength);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("failed with status 0x%08lx\n", Status);
+ return Status;
+ }
if (NT_SUCCESS(Status))
{
@@ -1198,8 +1209,142 @@
IN PSAMPR_PSID_ARRAY SidArray,
OUT PSAMPR_ULONG_ARRAY Membership)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PSAM_DB_OBJECT DomainObject;
+ HANDLE AliasesKeyHandle = NULL;
+ HANDLE MembersKeyHandle = NULL;
+ HANDLE MemberKeyHandle = NULL;
+ LPWSTR MemberSidString = NULL;
+ PULONG RidArray = NULL;
+ ULONG MaxSidCount = 0;
+ ULONG ValueCount;
+ ULONG DataLength;
+ ULONG i, j;
+ NTSTATUS Status;
+
+ TRACE("SamrGetAliasMembership(%p %p %p)\n",
+ DomainHandle, SidArray, Membership);
+
+ /* Validate the domain handle */
+ Status = SampValidateDbObject(DomainHandle,
+ SamDbDomainObject,
+ DOMAIN_LOOKUP,
+ &DomainObject);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ Status = SampRegOpenKey(DomainObject->KeyHandle,
+ L"Aliases",
+ KEY_READ,
+ &AliasesKeyHandle);
+ TRACE("SampRegOpenKey returned %08lX\n", Status);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+ Status = SampRegOpenKey(AliasesKeyHandle,
+ L"Members",
+ KEY_READ,
+ &MembersKeyHandle);
+ TRACE("SampRegOpenKey returned %08lX\n", Status);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+ for (i = 0; i < SidArray->Count; i++)
+ {
+ ConvertSidToStringSid(SidArray->Sids[i].SidPointer, &MemberSidString);
+TRACE("Open %S\n", MemberSidString);
+
+ Status = SampRegOpenKey(MembersKeyHandle,
+ MemberSidString,
+ KEY_READ,
+ &MemberKeyHandle);
+ TRACE("SampRegOpenKey returned %08lX\n", Status);
+ if (NT_SUCCESS(Status))
+ {
+ Status = SampRegQueryKeyInfo(MemberKeyHandle,
+ NULL,
+ &ValueCount);
+ if (NT_SUCCESS(Status))
+ {
+ TRACE("Found %lu values\n", ValueCount);
+ MaxSidCount += ValueCount;
+ }
+
+
+ NtClose(MemberKeyHandle);
+ }
+
+ LocalFree(MemberSidString);
+ }
+
+ TRACE("Maximum sid count: %lu\n", MaxSidCount);
+ RidArray = midl_user_allocate(MaxSidCount * sizeof(ULONG));
+ if (RidArray == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto done;
+ }
+
+ for (i = 0; i < SidArray->Count; i++)
+ {
+ ConvertSidToStringSid(SidArray->Sids[i].SidPointer, &MemberSidString);
+TRACE("Open %S\n", MemberSidString);
+
+ Status = SampRegOpenKey(MembersKeyHandle,
+ MemberSidString,
+ KEY_READ,
+ &MemberKeyHandle);
+ TRACE("SampRegOpenKey returned %08lX\n", Status);
+ if (NT_SUCCESS(Status))
+ {
+ Status = SampRegQueryKeyInfo(MemberKeyHandle,
+ NULL,
+ &ValueCount);
+ if (NT_SUCCESS(Status))
+ {
+ TRACE("Found %lu values\n", ValueCount);
+
+ for (j = 0; j < ValueCount; j++)
+ {
+ DataLength = sizeof(ULONG);
+ Status = SampRegEnumerateValue(MemberKeyHandle,
+ j,
+ NULL,
+ NULL,
+ NULL,
+ (PVOID)&RidArray[j],
+ &DataLength);
+ }
+ }
+
+ NtClose(MemberKeyHandle);
+ }
+
+ LocalFree(MemberSidString);
+ }
+
+
+done:
+ if (NT_SUCCESS(Status))
+ {
+ Membership->Count = MaxSidCount;
+ Membership->Element = RidArray;
+ }
+ else
+ {
+ if (RidArray != NULL)
+ midl_user_free(RidArray);
+ }
+
+ if (MembersKeyHandle != NULL)
+ NtClose(MembersKeyHandle);
+
+ if (MembersKeyHandle != NULL)
+ NtClose(MembersKeyHandle);
+
+ if (AliasesKeyHandle != NULL)
+ NtClose(AliasesKeyHandle);
+
+ return Status;
}
/* Function 17 */
@@ -1368,8 +1513,76 @@
IN ALIAS_INFORMATION_CLASS AliasInformationClass,
OUT PSAMPR_ALIAS_INFO_BUFFER *Buffer)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PSAM_DB_OBJECT AliasObject;
+ NTSTATUS Status;
+
+ TRACE("SamrQueryInformationAlias(%p %lu %p)\n",
+ AliasHandle, AliasInformationClass, Buffer);
+
+ /* Validate the alias handle */
+ Status = SampValidateDbObject(AliasHandle,
+ SamDbAliasObject,
+ ALIAS_READ_INFORMATION,
+ &AliasObject);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ switch (AliasInformationClass)
+ {
+#if 0
+ case AliasGeneralInformation:
+ Status = SampQueryAliasGeneral(AliasObject,
+ &Buffer->General);
+ break;
+
+ case AliasNameInformation:
+ Status = SampQueryAliasName(AliasObject,
+ &Buffer->Name);
+ break;
+
+ case AliasAdminCommentInformation:
+ Status = SampQueryAliasAdminComment(AliasObject,
+ &Buffer->AdminComment);
+ break;
+#endif
+
+ default:
+ Status = STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
+ return Status;
+}
+
+
+static NTSTATUS
+SampSetAliasName(PSAM_DB_OBJECT AliasObject,
+ PSAMPR_ALIAS_NAME_INFORMATION AliasNameInfo)
+{
+ NTSTATUS Status;
+
+ Status = SampSetObjectAttribute(AliasObject,
+ L"Name",
+ REG_SZ,
+ AliasNameInfo->Name.Buffer,
+ AliasNameInfo->Name.Length + sizeof(WCHAR));
+
+ return Status;
+}
+
+static NTSTATUS
+SampSetAliasAdminComment(PSAM_DB_OBJECT AliasObject,
+ PSAMPR_ALIAS_ADM_COMMENT_INFORMATION AliasAdminCommentInfo)
+{
+ NTSTATUS Status;
+
+ Status = SampSetObjectAttribute(AliasObject,
+ L"Description",
+ REG_SZ,
+ AliasAdminCommentInfo->AdminComment.Buffer,
+ AliasAdminCommentInfo->AdminComment.Length +
sizeof(WCHAR));
+
+ return Status;
}
/* Function 29 */
@@ -1379,8 +1592,38 @@
IN ALIAS_INFORMATION_CLASS AliasInformationClass,
IN PSAMPR_ALIAS_INFO_BUFFER Buffer)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PSAM_DB_OBJECT AliasObject;
+ NTSTATUS Status;
+
+ TRACE("SamrSetInformationAlias(%p %lu %p)\n",
+ AliasHandle, AliasInformationClass, Buffer);
+
+ /* Validate the alias handle */
+ Status = SampValidateDbObject(AliasHandle,
+ SamDbAliasObject,
+ ALIAS_WRITE_ACCOUNT,
+ &AliasObject);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ switch (AliasInformationClass)
+ {
+ case AliasNameInformation:
+ Status = SampSetAliasName(AliasObject,
+ &Buffer->Name);
+ break;
+
+ case AliasAdminCommentInformation:
+ Status = SampSetAliasAdminComment(AliasObject,
+ &Buffer->AdminComment);
+ break;
+
+ default:
+ Status = STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
+ return Status;
}
/* Function 30 */
Modified: trunk/reactos/dll/win32/samsrv/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Sat Jun 23 10:23:08 2012
@@ -58,9 +58,110 @@
}
+static PSID
+AppendRidToSid(PSID SrcSid,
+ ULONG Rid)
+{
+ ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+ UCHAR RidCount;
+ PSID DstSid;
+ ULONG i;
+
+ RidCount = *RtlSubAuthorityCountSid(SrcSid);
+ if (RidCount >= 8)
+ return NULL;
+
+ for (i = 0; i < RidCount; i++)
+ Rids[i] = *RtlSubAuthoritySid(SrcSid, i);
+
+ Rids[RidCount] = Rid;
+ RidCount++;
+
+ RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid),
+ RidCount,
+ Rids[0],
+ Rids[1],
+ Rids[2],
+ Rids[3],
+ Rids[4],
+ Rids[5],
+ Rids[6],
+ Rids[7],
+ &DstSid);
+
+ return DstSid;
+}
+
+
+static BOOL
+SampAddMemberToAlias(HKEY hDomainKey,
+ ULONG AliasId,
+ PSID MemberSid)
+{
+ DWORD dwDisposition;
+ LPWSTR MemberSidString = NULL;
+ WCHAR szKeyName[256];
+ HKEY hMembersKey;
+
+ ConvertSidToStringSidW(MemberSid, &MemberSidString);
+
+ swprintf(szKeyName, L"Aliases\\%08lX\\Members", AliasId);
+
+ if (!RegCreateKeyExW(hDomainKey,
+ szKeyName,
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS,
+ NULL,
+ &hMembersKey,
+ &dwDisposition))
+ {
+ RegSetValueEx(hMembersKey,
+ MemberSidString,
+ 0,
+ REG_BINARY,
+ (LPVOID)MemberSid,
+ RtlLengthSid(MemberSid));
+
+ RegCloseKey(hMembersKey);
+ }
+
+ swprintf(szKeyName, L"Aliases\\Members\\%s", MemberSidString);
+
+ if (!RegCreateKeyExW(hDomainKey,
+ szKeyName,
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS,
+ NULL,
+ &hMembersKey,
+ &dwDisposition))
+ {
+ swprintf(szKeyName, L"%08lX", AliasId);
+
+ RegSetValueEx(hMembersKey,
+ szKeyName,
+ 0,
+ REG_BINARY,
+ (LPVOID)MemberSid,
+ RtlLengthSid(MemberSid));
+
+ RegCloseKey(hMembersKey);
+ }
+
+ if (MemberSidString != NULL)
+ LocalFree(MemberSidString);
+
+ return TRUE;
+}
+
+
static BOOL
SampCreateAliasAccount(HKEY hDomainKey,
LPCWSTR lpAccountName,
+ LPCWSTR lpDescription,
ULONG ulRelativeId)
{
DWORD dwDisposition;
@@ -86,6 +187,13 @@
REG_SZ,
(LPVOID)lpAccountName,
(wcslen(lpAccountName) + 1) * sizeof(WCHAR));
+
+ RegSetValueEx(hAccountKey,
+ L"Description",
+ 0,
+ REG_SZ,
+ (LPVOID)lpDescription,
+ (wcslen(lpDescription) + 1) * sizeof(WCHAR));
RegCloseKey(hAccountKey);
}
@@ -332,6 +440,7 @@
HKEY hDomainKey = NULL;
PSID pBuiltinSid = NULL;
BOOL bResult = TRUE;
+ PSID pSid;
NTSTATUS Status;
TRACE("SampInitializeSAM() called\n");
@@ -398,19 +507,36 @@
{
SampCreateAliasAccount(hDomainKey,
L"Administrators",
+ L"",
DOMAIN_ALIAS_RID_ADMINS);
SampCreateAliasAccount(hDomainKey,
L"Users",
+ L"",
DOMAIN_ALIAS_RID_USERS);
SampCreateAliasAccount(hDomainKey,
L"Guests",
+ L"",
DOMAIN_ALIAS_RID_GUESTS);
SampCreateAliasAccount(hDomainKey,
L"Power Users",
+ L"",
DOMAIN_ALIAS_RID_POWER_USERS);
+
+
+ pSid = AppendRidToSid(AccountDomainInfo->DomainSid,
+ DOMAIN_USER_RID_ADMIN);
+ if (pSid != NULL)
+ {
+ SampAddMemberToAlias(hDomainKey,
+ DOMAIN_ALIAS_RID_ADMINS,
+ pSid);
+
+ RtlFreeHeap(RtlGetProcessHeap(), 0, pSid);
+ }
+
RegCloseKey(hDomainKey);
}
Modified: trunk/reactos/include/ddk/ntsam.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntsam.h?rev=56…
==============================================================================
--- trunk/reactos/include/ddk/ntsam.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntsam.h [iso-8859-1] Sat Jun 23 10:23:08 2012
@@ -57,6 +57,31 @@
PSID Sid;
UNICODE_STRING Name;
} SAM_SID_ENUMERATION, *PSAM_SID_ENUMERATION;
+
+typedef enum _ALIAS_INFORMATION_CLASS
+{
+ AliasGeneralInformation = 1,
+ AliasNameInformation,
+ AliasAdminCommentInformation
+} ALIAS_INFORMATION_CLASS, *PALIAS_INFORMATION_CLASS;
+
+typedef struct _SAMPR_ALIAS_GENERAL_INFORMATION
+{
+ UNICODE_STRING Name;
+ ULONG MemberCount;
+ UNICODE_STRING AdminComment;
+} SAMPR_ALIAS_GENERAL_INFORMATION, *PSAMPR_ALIAS_GENERAL_INFORMATION;
+
+typedef struct _SAMPR_ALIAS_NAME_INFORMATION
+{
+ UNICODE_STRING Name;
+} SAMPR_ALIAS_NAME_INFORMATION, *PSAMPR_ALIAS_NAME_INFORMATION;
+
+typedef struct _SAMPR_ALIAS_ADM_COMMENT_INFORMATION
+{
+ UNICODE_STRING AdminComment;
+} SAMPR_ALIAS_ADM_COMMENT_INFORMATION, *PSAMPR_ALIAS_ADM_COMMENT_INFORMATION;
+
typedef enum _DOMAIN_INFORMATION_CLASS
{
@@ -174,6 +199,14 @@
NTSTATUS
NTAPI
+SamGetAliasMembership(IN SAM_HANDLE DomainHandle,
+ IN ULONG PassedCount,
+ IN PSID *Sids,
+ OUT PULONG MembershipCount,
+ OUT PULONG *Aliases);
+
+NTSTATUS
+NTAPI
SamGetMembersInAlias(IN SAM_HANDLE AliasHandle,
OUT PSID **MemberIds,
OUT PULONG MemberCount);
@@ -183,6 +216,14 @@
SamLookupDomainInSamServer(IN SAM_HANDLE ServerHandle,
IN PUNICODE_STRING Name,
OUT PSID *DomainId);
+
+NTSTATUS
+NTAPI
+SamLookupNamesInDomain(IN SAM_HANDLE DomainHandle,
+ IN ULONG Count,
+ IN PUNICODE_STRING Names,
+ OUT PULONG *RelativeIds,
+ OUT PSID_NAME_USE *Use);
NTSTATUS
NTAPI
@@ -207,6 +248,12 @@
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);
@@ -219,6 +266,12 @@
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 DomainInformation);