[SAMSRV]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 18 Aug 2013 21:43:47 +0000 (21:43 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 18 Aug 2013 21:43:47 +0000 (21:43 +0000)
Implement the last part of SamrSetInformationUser.UserAllInformation: USER_ALL_PASSWORDEXPIRED.

svn path=/trunk/; revision=59777

reactos/dll/win32/samsrv/samrpc.c

index 3c8a952..e0df244 100644 (file)
@@ -7311,7 +7311,24 @@ SampSetUserAll(PSAM_DB_OBJECT UserObject,
         WriteFixedData = TRUE;
     }
 
-    /* FIXME: USER_ALL_PASSWORDEXPIRED */
+    if (WhichFields & USER_ALL_PASSWORDEXPIRED)
+    {
+        if (Buffer->All.PasswordExpired)
+        {
+            /* The pasword was last set ages ago */
+            FixedData.PasswordLastSet.LowPart = 0;
+            FixedData.PasswordLastSet.HighPart = 0;
+        }
+        else
+        {
+            /* The pasword was last set right now */
+            Status = NtQuerySystemTime(&FixedData.PasswordLastSet);
+            if (!NT_SUCCESS(Status))
+                goto done;
+        }
+
+        WriteFixedData = TRUE;
+    }
 
     if (WriteFixedData == TRUE)
     {