[ADVAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 16 Oct 2010 09:41:47 +0000 (09:41 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 16 Oct 2010 09:41:47 +0000 (09:41 +0000)
Implement LsaCreateAccount(), LsaOpenAccount() and LsaSetInformationPolicy().

svn path=/trunk/; revision=49164

reactos/dll/win32/advapi32/advapi32.spec
reactos/dll/win32/advapi32/sec/lsa.c
reactos/include/psdk/ntsecapi.h

index fe952b9..1963f80 100644 (file)
 @ stub LsaAddPrivilegesToAccount
 @ stub LsaClearAuditLog
 @ stdcall LsaClose(ptr)
-@ stub LsaCreateAccount
+@ stdcall LsaCreateAccount(ptr ptr long ptr)
 @ stub LsaCreateSecret
 @ stub LsaCreateTrustedDomain
 @ stdcall LsaCreateTrustedDomainEx(ptr ptr ptr long ptr)
 @ stdcall LsaLookupPrivilegeValue(ptr ptr ptr)
 @ stdcall LsaLookupSids(ptr long ptr ptr ptr)
 @ stdcall LsaNtStatusToWinError(long)
-@ stub LsaOpenAccount
-@ stdcall LsaOpenPolicy(long long long long)
+@ stdcall LsaOpenAccount(ptr ptr long ptr)
+@ stdcall LsaOpenPolicy(ptr ptr long ptr)
 @ stub LsaOpenPolicySce
 @ stub LsaOpenSecret
 @ stub LsaOpenTrustedDomain
index 6839aa3..e479c3a 100644 (file)
@@ -155,6 +155,38 @@ LsaAddAccountRights(
     return STATUS_OBJECT_NAME_NOT_FOUND;
 }
 
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaCreateAccount(IN LSA_HANDLE PolicyHandle,
+                 IN PSID AccountSid,
+                 IN ULONG Flags,
+                 IN OUT PLSA_HANDLE AccountHandle)
+{
+    NTSTATUS Status;
+
+    TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, AccountSid, Flags, AccountHandle);
+
+    RpcTryExcept
+    {
+        Status = LsarCreateAccount((LSAPR_HANDLE)PolicyHandle,
+                                   AccountSid,
+                                   Flags,
+                                   AccountHandle);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return Status;
+}
+
+
 /*
  * @unimplemented
  */
@@ -500,6 +532,38 @@ LsaNtStatusToWinError(NTSTATUS Status)
     return RtlNtStatusToDosError(Status);
 }
 
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaOpenAccount(IN LSA_HANDLE PolicyHandle,
+               IN PSID AccountSid,
+               IN ULONG Flags,
+               IN OUT PLSA_HANDLE AccountHandle)
+{
+    NTSTATUS Status;
+
+    TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, AccountSid, Flags, AccountHandle);
+
+    RpcTryExcept
+    {
+        Status = LsarOpenAccount((LSAPR_HANDLE)PolicyHandle,
+                                 AccountSid,
+                                 Flags,
+                                 AccountHandle);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return Status;
+}
+
+
 /******************************************************************************
  * LsaOpenPolicy
  *
@@ -701,20 +765,36 @@ LsaSetDomainInformationPolicy(
     return STATUS_UNSUCCESSFUL;
 }
 
+
 /*
- * @unimplemented
+ * @implemented
  */
 NTSTATUS
 WINAPI
-LsaSetInformationPolicy(
-    LSA_HANDLE PolicyHandle,
-    POLICY_INFORMATION_CLASS InformationClass,
-    PVOID Buffer)
+LsaSetInformationPolicy(IN LSA_HANDLE PolicyHandle,
+                        IN POLICY_INFORMATION_CLASS InformationClass,
+                        IN PVOID Buffer)
 {
-    FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
-    return STATUS_UNSUCCESSFUL;
+    NTSTATUS Status;
+
+    TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
+
+    RpcTryExcept
+    {
+        Status = LsarSetInformationPolicy((LSAPR_HANDLE)PolicyHandle,
+                                          InformationClass,
+                                          (PLSAPR_POLICY_INFORMATION)Buffer);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return Status;
 }
 
+
 /*
  * @unimplemented
  */
index 8853153..b6ae994 100644 (file)
@@ -675,6 +675,7 @@ 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,
@@ -703,6 +704,7 @@ NTSTATUS NTAPI LsaLookupPrivilegeValue(LSA_HANDLE, PLSA_UNICODE_STRING, PLUID);
 NTSTATUS NTAPI LsaLookupSids(LSA_HANDLE,ULONG,PSID*,
                             PLSA_REFERENCED_DOMAIN_LIST*,PLSA_TRANSLATED_NAME*);
 ULONG NTAPI LsaNtStatusToWinError(NTSTATUS);
+NTSTATUS NTAPI LsaOpenAccount(LSA_HANDLE, PSID, ULONG, PLSA_HANDLE);
 NTSTATUS NTAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,
                             ACCESS_MASK,PLSA_HANDLE);
 NTSTATUS NTAPI LsaQueryDomainInformationPolicy(LSA_HANDLE,