Author: ekohl
Date: Sat Oct 16 16:26:52 2010
New Revision: 49174
URL:
http://svn.reactos.org/svn/reactos?rev=49174&view=rev
Log:
[ADVAPI32]
Implement LsaAddPrivilegesToAccount(), LsaCreateTrustedDomain(), LsaDeleteTrustedDomain()
and LsaOpenTrustedDomainByName().
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] Sat Oct 16 16:26:52 2010
@@ -345,12 +345,12 @@
@ stub LookupSecurityDescriptorPartsA
@ stub LookupSecurityDescriptorPartsW
@ stdcall LsaAddAccountRights(ptr ptr ptr long)
-@ stub LsaAddPrivilegesToAccount
+@ stdcall LsaAddPrivilegesToAccount(ptr ptr)
@ stub LsaClearAuditLog
@ stdcall LsaClose(ptr)
@ stdcall LsaCreateAccount(ptr ptr long ptr)
@ stub LsaCreateSecret
-@ stub LsaCreateTrustedDomain
+@ stdcall LsaCreateTrustedDomain(ptr ptr long ptr)
@ stdcall LsaCreateTrustedDomainEx(ptr ptr ptr long ptr)
@ stdcall LsaDelete(ptr)
@ stdcall LsaDeleteTrustedDomain(ptr ptr)
@@ -395,10 +395,9 @@
@ stdcall LsaRemoveAccountRights(ptr ptr long ptr long)
@ stub LsaRemovePrivilegesFromAccount
@ stdcall LsaRetrievePrivateData(ptr ptr ptr)
-# @ stub LsaSetDomainInformationPolicy
-# @ stub LsaSetForestTrustInformation
+@ stdcall LsaSetDomainInformationPolicy(ptr long ptr)
+@ stub LsaSetForestTrustInformation
@ stdcall LsaSetInformationPolicy(long long ptr)
-@ stub LsaSetForestTrustInformation
@ stub LsaSetInformationTrustedDomain
@ stub LsaSetQuotasForAccount
@ stdcall LsaSetSecret(ptr 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] Sat Oct 16 16:26:52 2010
@@ -95,8 +95,9 @@
/*
* @implemented
*/
-NTSTATUS WINAPI
-LsaClose(LSA_HANDLE ObjectHandle)
+NTSTATUS
+WINAPI
+LsaClose(IN LSA_HANDLE ObjectHandle)
{
NTSTATUS Status;
@@ -119,8 +120,9 @@
/*
* @implemented
*/
-NTSTATUS WINAPI
-LsaDelete(LSA_HANDLE ObjectHandle)
+NTSTATUS
+WINAPI
+LsaDelete(IN LSA_HANDLE ObjectHandle)
{
NTSTATUS Status;
@@ -161,10 +163,37 @@
*/
NTSTATUS
WINAPI
+LsaAddPrivilegesToAccount(IN LSA_HANDLE AccountHandle,
+ IN PPRIVILEGE_SET PrivilegeSet)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p) stub\n", AccountHandle, PrivilegeSet);
+
+ RpcTryExcept
+ {
+ Status = LsarAddPrivilegesToAccount((LSAPR_HANDLE)AccountHandle,
+ (PLSAPR_PRIVILEGE_SET)PrivilegeSet);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
LsaCreateAccount(IN LSA_HANDLE PolicyHandle,
IN PSID AccountSid,
IN ULONG Flags,
- IN OUT PLSA_HANDLE AccountHandle)
+ OUT PLSA_HANDLE AccountHandle)
{
NTSTATUS Status;
@@ -188,6 +217,38 @@
/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaCreateTrustedDomain(IN LSA_HANDLE PolicyHandle,
+ IN PLSA_TRUST_INFORMATION TrustedDomainInformation,
+ IN ACCESS_MASK DesiredAccess,
+ OUT PLSA_HANDLE TrustedDomainHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, TrustedDomainInformation,
+ DesiredAccess, TrustedDomainHandle);
+
+ RpcTryExcept
+ {
+ Status = LsarCreateTrustedDomain((LSAPR_HANDLE)PolicyHandle,
+
(PLSAPR_TRUST_INFORMATION)TrustedDomainInformation,
+ DesiredAccess,
+ (PLSAPR_HANDLE)TrustedDomainHandle);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
+/*
* @unimplemented
*/
NTSTATUS
@@ -205,16 +266,29 @@
}
/*
- * @unimplemented
- */
-NTSTATUS
-WINAPI
-LsaDeleteTrustedDomain(
- LSA_HANDLE PolicyHandle,
- PSID TrustedDomainSid)
-{
- FIXME("(%p,%p) stub\n", PolicyHandle, TrustedDomainSid);
- return STATUS_SUCCESS;
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaDeleteTrustedDomain(IN LSA_HANDLE PolicyHandle,
+ IN PSID TrustedDomainSid)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p)\n", PolicyHandle, TrustedDomainSid);
+
+ RpcTryExcept
+ {
+ Status = LsarDeleteTrustedDomain((LSAPR_HANDLE)PolicyHandle,
+ TrustedDomainSid);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
/*
@@ -526,7 +600,7 @@
* @implemented
*/
ULONG WINAPI
-LsaNtStatusToWinError(NTSTATUS Status)
+LsaNtStatusToWinError(IN NTSTATUS Status)
{
TRACE("(%lx)\n", Status);
return RtlNtStatusToDosError(Status);
@@ -541,7 +615,7 @@
LsaOpenAccount(IN LSA_HANDLE PolicyHandle,
IN PSID AccountSid,
IN ULONG Flags,
- IN OUT PLSA_HANDLE AccountHandle)
+ OUT PLSA_HANDLE AccountHandle)
{
NTSTATUS Status;
@@ -573,15 +647,14 @@
* x3 []
* x4 []
*
- * @unimplemented
- */
-NTSTATUS
-WINAPI
-LsaOpenPolicy(
- IN PLSA_UNICODE_STRING SystemName,
- IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
- IN ACCESS_MASK DesiredAccess,
- IN OUT PLSA_HANDLE PolicyHandle)
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaOpenPolicy(IN PLSA_UNICODE_STRING SystemName,
+ IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
+ IN ACCESS_MASK DesiredAccess,
+ OUT PLSA_HANDLE PolicyHandle)
{
NTSTATUS Status;
@@ -615,19 +688,36 @@
/*
- * @unimplemented
- */
-NTSTATUS
-WINAPI
-LsaOpenTrustedDomainByName(
- LSA_HANDLE PolicyHandle,
- PLSA_UNICODE_STRING TrustedDomainName,
- ACCESS_MASK DesiredAccess,
- PLSA_HANDLE TrustedDomainHandle)
-{
- FIXME("(%p,%p,0x%08x,%p) stub\n", PolicyHandle, TrustedDomainName,
DesiredAccess, TrustedDomainHandle);
- return STATUS_OBJECT_NAME_NOT_FOUND;
-}
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaOpenTrustedDomainByName(IN LSA_HANDLE PolicyHandle,
+ IN PLSA_UNICODE_STRING TrustedDomainName,
+ IN ACCESS_MASK DesiredAccess,
+ OUT PLSA_HANDLE TrustedDomainHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, TrustedDomainName,
+ DesiredAccess, TrustedDomainHandle);
+
+ RpcTryExcept
+ {
+ Status = LsarOpenTrustedDomainByName((LSAPR_HANDLE)PolicyHandle,
+ (PRPC_UNICODE_STRING)TrustedDomainName,
+ DesiredAccess,
+ TrustedDomainHandle);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
/*
* @unimplemented
@@ -660,10 +750,11 @@
/*
* @implemented
*/
-NTSTATUS WINAPI
-LsaQueryInformationPolicy(LSA_HANDLE PolicyHandle,
- POLICY_INFORMATION_CLASS InformationClass,
- PVOID *Buffer)
+NTSTATUS
+WINAPI
+LsaQueryInformationPolicy(IN LSA_HANDLE PolicyHandle,
+ IN POLICY_INFORMATION_CLASS InformationClass,
+ OUT PVOID *Buffer)
{
PLSAPR_POLICY_INFORMATION PolicyInformation = NULL;
NTSTATUS Status;
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] Sat Oct 16 16:26:52 2010
@@ -671,15 +671,16 @@
BOOLEAN WINAPI RtlGenRandom(PVOID,ULONG);
NTSTATUS NTAPI LsaAddAccountRights(LSA_HANDLE,PSID,PLSA_UNICODE_STRING,ULONG);
+NTSTATUS NTAPI LsaAddPrivilegesToAccount(LSA_HANDLE, PPRIVILEGE_SET);
NTSTATUS NTAPI LsaCallAuthenticationPackage(HANDLE,ULONG,PVOID,ULONG,PVOID*,
PULONG,PNTSTATUS);
NTSTATUS NTAPI LsaClose(LSA_HANDLE);
NTSTATUS NTAPI LsaConnectUntrusted(PHANDLE);
NTSTATUS NTAPI LsaCreateAccount(LSA_HANDLE, PSID, ULONG, PLSA_HANDLE);
-NTSTATUS NTAPI LsaCreateTrustedDomainEx(LSA_HANDLE,
- PTRUSTED_DOMAIN_INFORMATION_EX,
- PTRUSTED_DOMAIN_AUTH_INFORMATION,ACCESS_MASK,
- PLSA_HANDLE);
+NTSTATUS NTAPI LsaCreateTrustedDomain(LSA_HANDLE, PLSA_TRUST_INFORMATION,
+ ACCESS_MASK, PLSA_HANDLE);
+NTSTATUS NTAPI LsaCreateTrustedDomainEx(LSA_HANDLE, PTRUSTED_DOMAIN_INFORMATION_EX,
+ PTRUSTED_DOMAIN_AUTH_INFORMATION, ACCESS_MASK, PLSA_HANDLE);
NTSTATUS NTAPI LsaDeleteTrustedDomain(LSA_HANDLE,PSID);
NTSTATUS NTAPI LsaDeregisterLogonProcess(HANDLE);
NTSTATUS NTAPI LsaEnumerateAccountRights(LSA_HANDLE,PSID,PLSA_UNICODE_STRING*,PULONG);
@@ -707,6 +708,8 @@
NTSTATUS NTAPI LsaOpenAccount(LSA_HANDLE, PSID, ULONG, PLSA_HANDLE);
NTSTATUS NTAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,
ACCESS_MASK,PLSA_HANDLE);
+NTSTATUS NTAPI LsaOpenTrustedDomainByName(LSA_HANDLE, PLSA_UNICODE_STRING,
+ ACCESS_MASK, PLSA_HANDLE);
NTSTATUS NTAPI LsaQueryDomainInformationPolicy(LSA_HANDLE,
POLICY_DOMAIN_INFORMATION_CLASS,PVOID*);
NTSTATUS NTAPI LsaQueryInformationPolicy(LSA_HANDLE,POLICY_INFORMATION_CLASS,PVOID*);