[LSASRV]
authorEric Kohl <eric.kohl@reactos.org>
Sat, 8 Dec 2012 23:12:30 +0000 (23:12 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 8 Dec 2012 23:12:30 +0000 (23:12 +0000)
Implement LsarSetServerRole, LsarSetModification and LsarSetAuditFull.

svn path=/trunk/; revision=57832

reactos/dll/win32/lsasrv/policy.c

index 88463b2..8b3b3cf 100644 (file)
@@ -238,7 +238,7 @@ LsarQueryPrimaryDomain(PLSA_DB_OBJECT PolicyObject,
 Done:
     if (!NT_SUCCESS(Status))
     {
-        if (p)
+        if (p != NULL)
         {
             if (p->Name.Buffer)
                 MIDL_user_free(p->Name.Buffer);
@@ -886,8 +886,12 @@ NTSTATUS
 LsarSetServerRole(PLSA_DB_OBJECT PolicyObject,
                   PPOLICY_LSA_SERVER_ROLE_INFO Info)
 {
-    FIXME("\n");
-    return STATUS_NOT_IMPLEMENTED;
+    TRACE("(%p %p)\n", PolicyObject, Info);
+
+    return LsapSetObjectAttribute(PolicyObject,
+                                  L"PolSrvRo",
+                                  Info,
+                                  sizeof(POLICY_LSA_SERVER_ROLE_INFO));
 }
 
 
@@ -917,8 +921,12 @@ NTSTATUS
 LsarSetModification(PLSA_DB_OBJECT PolicyObject,
                     PPOLICY_MODIFICATION_INFO Info)
 {
-    FIXME("\n");
-    return STATUS_NOT_IMPLEMENTED;
+    TRACE("(%p %p)\n", PolicyObject, Info);
+
+    return LsapSetObjectAttribute(PolicyObject,
+                                  L"PolMod",
+                                  Info,
+                                  sizeof(POLICY_MODIFICATION_INFO));
 }
 
 
@@ -926,8 +934,36 @@ NTSTATUS
 LsarSetAuditFull(PLSA_DB_OBJECT PolicyObject,
                  PPOLICY_AUDIT_FULL_QUERY_INFO Info)
 {
-    FIXME("\n");
-    return STATUS_NOT_IMPLEMENTED;
+    PPOLICY_AUDIT_FULL_QUERY_INFO AuditFullInfo = NULL;
+    ULONG AttributeSize;
+    NTSTATUS Status;
+
+    TRACE("(%p %p)\n", PolicyObject, Info);
+
+    AttributeSize = sizeof(POLICY_AUDIT_FULL_QUERY_INFO);
+    AuditFullInfo = MIDL_user_allocate(AttributeSize);
+    if (AuditFullInfo == NULL)
+        return STATUS_INSUFFICIENT_RESOURCES;
+
+    Status = LsapGetObjectAttribute(PolicyObject,
+                                    L"PolAdtFl",
+                                    AuditFullInfo,
+                                    &AttributeSize);
+    if (!NT_SUCCESS(Status))
+        goto done;
+
+    AuditFullInfo->ShutDownOnFull = Info->ShutDownOnFull;
+
+    Status = LsapSetObjectAttribute(PolicyObject,
+                                    L"PolAdtFl",
+                                    AuditFullInfo,
+                                    AttributeSize);
+
+done:
+    if (AuditFullInfo != NULL)
+        MIDL_user_free(AuditFullInfo);
+
+    return Status;
 }