Implement LsaEnumerateAccountRights.
authorEric Kohl <eric.kohl@reactos.org>
Sun, 7 Feb 2010 13:51:25 +0000 (13:51 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 7 Feb 2010 13:51:25 +0000 (13:51 +0000)
svn path=/trunk/; revision=45484

reactos/dll/win32/advapi32/sec/lsa.c
reactos/dll/win32/lsasrv/lsarpc.c

index f792f8c..6cc8701 100644 (file)
@@ -217,7 +217,7 @@ LsaDeleteTrustedDomain(
 }
 
 /*
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 NTSTATUS
 WINAPI
  */
 NTSTATUS
 WINAPI
@@ -227,10 +227,35 @@ LsaEnumerateAccountRights(
     PLSA_UNICODE_STRING *UserRights,
     PULONG CountOfRights)
 {
     PLSA_UNICODE_STRING *UserRights,
     PULONG CountOfRights)
 {
-    FIXME("(%p,%p,%p,%p) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights);
-    *UserRights = 0;
-    *CountOfRights = 0;
-    return STATUS_OBJECT_NAME_NOT_FOUND;
+    LSAPR_USER_RIGHT_SET UserRightsSet;
+    NTSTATUS Status;
+
+    TRACE("(%p,%p,%p,%p) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights);
+
+    UserRightsSet.Entries = 0;
+    UserRightsSet.UserRights = NULL;
+
+    RpcTryExcept
+    {
+        Status = LsarEnmuerateAccountRights((LSAPR_HANDLE)PolicyHandle,
+                                            AccountSid,
+                                            &UserRightsSet);
+
+        *CountOfRights = UserRightsSet.Entries;
+        *UserRights = (PUNICODE_STRING)UserRightsSet.UserRights;
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+
+        if (UserRightsSet.UserRights != NULL)
+        {
+            MIDL_user_free(UserRightsSet.UserRights);
+        }
+    }
+    RpcEndExcept;
+
+    return Status;
 }
 
 /*
 }
 
 /*
@@ -288,7 +313,8 @@ LsaEnumerateTrustedDomainsEx(
 /*
  * @implemented
  */
 /*
  * @implemented
  */
-NTSTATUS WINAPI
+NTSTATUS
+WINAPI
 LsaFreeMemory(PVOID Buffer)
 {
     TRACE("(%p)\n", Buffer);
 LsaFreeMemory(PVOID Buffer)
 {
     TRACE("(%p)\n", Buffer);
index d2a3644..eb9852f 100644 (file)
@@ -560,8 +560,14 @@ NTSTATUS LsarEnmuerateAccountRights(
     PRPC_SID AccountSid,
     PLSAPR_USER_RIGHT_SET UserRights)
 {
     PRPC_SID AccountSid,
     PLSAPR_USER_RIGHT_SET UserRights)
 {
-    UNIMPLEMENTED;
-    return STATUS_NOT_IMPLEMENTED;
+    FIXME("(%p,%p,%p) stub\n", PolicyHandle, AccountSid, UserRights);
+
+    if (!LsapValidateDbHandle(PolicyHandle))
+        return STATUS_INVALID_HANDLE;
+
+    UserRights->Entries = 0;
+    UserRights->UserRights = NULL;
+    return STATUS_OBJECT_NAME_NOT_FOUND;
 }
 
 
 }