Author: ekohl
Date: Mon Sep 24 15:04:32 2012
New Revision: 57378
URL:
http://svn.reactos.org/svn/reactos?rev=57378&view=rev
Log:
[ADVAPI32]
Implement LsaCreateTrustedDomainEx and LsaEnumerateAccounts.
Modified:
trunk/reactos/dll/win32/advapi32/advapi32.spec
trunk/reactos/dll/win32/advapi32/sec/lsa.c
trunk/reactos/include/psdk/ntsecapi.h
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Mon Sep 24 15:04:32 2012
@@ -355,7 +355,7 @@
@ stdcall LsaDelete(ptr)
@ stdcall LsaDeleteTrustedDomain(ptr ptr)
@ stdcall LsaEnumerateAccountRights(ptr ptr ptr ptr)
-@ stub LsaEnumerateAccounts
+@ stdcall LsaEnumerateAccounts(ptr ptr ptr long ptr)
@ stdcall LsaEnumerateAccountsWithUserRight(ptr ptr ptr ptr)
@ stub LsaEnumeratePrivileges
@ stdcall LsaEnumeratePrivilegesOfAccount(ptr ptr)
Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/lsa…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Mon Sep 24 15:04:32 2012
@@ -316,10 +316,30 @@
IN ACCESS_MASK DesiredAccess,
OUT PLSA_HANDLE TrustedDomainHandle)
{
- FIXME("LsaCreateTrustedDomainEx(%p %p %p 0x%08lx %p) stub\n",
+ PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL EncryptedAuthInfo = NULL;
+ NTSTATUS Status;
+
+ TRACE("LsaCreateTrustedDomainEx(%p %p %p 0x%08lx %p) stub\n",
PolicyHandle, TrustedDomainInformation, AuthenticationInformation,
DesiredAccess, TrustedDomainHandle);
- return STATUS_SUCCESS;
+
+ RpcTryExcept
+ {
+ /* FIXME: Encrypt AuthenticationInformation */
+
+ Status = LsarCreateTrustedDomainEx2((LSAPR_HANDLE)PolicyHandle,
+
(PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX)TrustedDomainInformation,
+ EncryptedAuthInfo,
+ DesiredAccess,
+ (PLSAPR_HANDLE)TrustedDomainHandle);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
@@ -412,6 +432,50 @@
{
MIDL_user_free(UserRightsSet.UserRights);
}
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaEnumerateAccounts(IN LSA_HANDLE PolicyHandle,
+ IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
+ OUT PVOID *Buffer,
+ IN ULONG PreferedMaximumLength,
+ OUT PULONG CountReturned)
+{
+ LSAPR_ACCOUNT_ENUM_BUFFER AccountEnumBuffer;
+ NTSTATUS Status;
+
+ TRACE("LsaEnumerateAccounts(%p %p %p %lu %p)\n",
+ PolicyHandle, EnumerationContext, Buffer,
+ PreferedMaximumLength, CountReturned);
+
+ AccountEnumBuffer.EntriesRead = 0;
+ AccountEnumBuffer.Information = NULL;
+
+ RpcTryExcept
+ {
+ Status = LsarEnumerateAccounts((LSAPR_HANDLE)PolicyHandle,
+ EnumerationContext,
+ &AccountEnumBuffer,
+ PreferedMaximumLength);
+
+ *Buffer = AccountEnumBuffer.Information;
+ *CountReturned = AccountEnumBuffer.EntriesRead;
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ if (AccountEnumBuffer.Information != NULL)
+ MIDL_user_free(AccountEnumBuffer.Information);
+
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
Modified: trunk/reactos/include/psdk/ntsecapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntsecapi.h?re…
==============================================================================
--- trunk/reactos/include/psdk/ntsecapi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/ntsecapi.h [iso-8859-1] Mon Sep 24 15:04:32 2012
@@ -689,6 +689,8 @@
NTSTATUS NTAPI LsaDeleteTrustedDomain(LSA_HANDLE,PSID);
NTSTATUS NTAPI LsaDeregisterLogonProcess(HANDLE);
NTSTATUS NTAPI LsaEnumerateAccountRights(LSA_HANDLE,PSID,PLSA_UNICODE_STRING*,PULONG);
+NTSTATUS NTAPI LsaEnumerateAccounts(LSA_HANDLE,PLSA_ENUMERATION_HANDLE,PVOID*,
+ ULONG,PULONG);
NTSTATUS NTAPI LsaEnumerateAccountsWithUserRight(LSA_HANDLE,PLSA_UNICODE_STRING,
PVOID*,PULONG);
NTSTATUS NTAPI LsaEnumeratePrivilegesOfAccount(LSA_HANDLE,PPRIVILEGE_SET*);